Datepicker for date of birth input field - javascript

I have a registration portal in which I change its view according to my template and now I want to add an input field to add date of birth with date picker how to use script in this registration page to add date picker.
<html>
<head>
<title></title>
<link href="catalog/view/theme/default/stylesheet/stylesheet1.css" rel=stylesheet type="text/css" />
<link href="catalog/view/theme/default/stylesheet/register.css" rel="stylesheet" type="text/css" />
<link href="catalog/view/theme/default/stylesheet/Menu.css" rel="stylesheet" type="text/css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<div id="Holder">
<div id="Navbar">
<nav>
<ul>
<li>Login</li>
<li>Register</li>
<li>Forgot Password</li>
</ul>
</nav>
</div>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?>
<div id="content"><?php echo $content_top; ?>
<h1><?php echo $heading_title; ?></h1>
<p><?php echo $text_account_already; ?></p>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div id="Details">
<div id="YourPersonalDetails">
<h2><?php echo $text_your_details; ?></h2>
<div class="content">
<table class="form">
<tr>
<td><span class="required">*</span> <?php echo $entry_emp_name; ?></td>
<td><input type="text" name="emp_name" value="<?php echo $emp_name; ?>" />
<?php if ($error_emp_name) { ?>
<span class="error"><?php echo $error_emp_name; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_emp_ID; ?></td>
<td><input type="text" name="emp_ID" value="<?php echo $emp_ID; ?>" />
<?php if ($error_emp_ID) { ?>
<span class="error"><?php echo $error_emp_ID; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> Date Of Birth</td>
<td><input type="text" id="datepicker" name="dob" value="<?php echo $dob; ?>" size="12" id="dob" />
<?php if ($error_dob) { ?>
<span class="error">We require your date of birth!</span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_email; ?></td>
<td><input type="text" name="email" value="<?php echo $email; ?>" />
<?php if ($error_email) { ?>
<span class="error"><?php echo $error_email; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_mobile_no; ?></td>
<td><input type="text" name="mobile_no" value="<?php echo $mobile_no; ?>" />
<?php if ($error_mobile_no) { ?>
<span class="error"><?php echo $error_mobile_no; ?></span>
<?php } ?></td>
</tr>
</table>
</div>
</div>
<div id="YourAddress" >
<h2><?php echo $text_your_address; ?></h2>
<div class="content">
<table class="form">
<tr>
<td><?php echo $entry_company; ?></td>
<td><input type="text" name="company" value="<?php echo $company; ?>" /></td>
</tr>
<tr style="display: <?php echo (count($customer_groups) > 1 ? 'table-row' : 'none'); ?>;">
<td><?php echo $entry_customer_group; ?></td>
<td><?php foreach ($customer_groups as $customer_group) { ?>
<?php if ($customer_group['customer_group_id'] == $customer_group_id) { ?>
<input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" checked="checked" />
<label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
<br />
<?php } else { ?>
<input type="radio" name="customer_group_id" value="<?php echo $customer_group['customer_group_id']; ?>" id="customer_group_id<?php echo $customer_group['customer_group_id']; ?>" />
<label for="customer_group_id<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></label>
<br />
<?php } ?>
<?php } ?></td>
</tr>
<tr id="company-id-display">
<td><span id="company-id-required" class="required">*</span> <?php echo $entry_company_id; ?></td>
<td><input type="text" name="company_id" value="<?php echo $company_id; ?>" />
<?php if ($error_company_id) { ?>
<span class="error"><?php echo $error_company_id; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_office_location; ?></td>
<td><input type="text" name="office_location" value="<?php echo $office_location; ?>" />
<?php if ($error_office_location) { ?>
<span class="error"><?php echo $error_office_location; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><?php echo $entry_address_2; ?></td>
<td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_city; ?></td>
<td><input type="text" name="city" value="<?php echo $city; ?>" />
<?php if ($error_city) { ?>
<span class="error"><?php echo $error_city; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span id="postcode-required" class="required">*</span> <?php echo $entry_postcode; ?></td>
<td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
<?php if ($error_postcode) { ?>
<span class="error"><?php echo $error_postcode; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_country; ?></td>
<td><select name="country_id">
<option value=""><?php echo $text_select; ?></option>
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<?php if ($error_country) { ?>
<span class="error"><?php echo $error_country; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_zone; ?></td>
<td><select name="zone_id">
<option value=""><?php echo $text_select; ?></option>
<option value="1483">Delhi</option>
<option value="1505">UP</option>
</select>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?></td>
</tr>
</table>
</div>
</div>
</div>
<div id="YourPassword">
<h2><?php echo $text_your_password; ?></h2>
<div class="content">
<table class="form">
<tr>
<td><span class="required">*</span> <?php echo $entry_password; ?></td>
<td><input type="password" name="password" value="<?php echo $password; ?>" />
<?php if ($error_password) { ?>
<span class="error"><?php echo $error_password; ?></span>
<?php } ?></td>
</tr>
<tr>
<td><span class="required">*</span> <?php echo $entry_confirm; ?></td>
<td><input type="password" name="confirm" value="<?php echo $confirm; ?>" />
<?php if ($error_confirm) { ?>
<span class="error"><?php echo $error_confirm; ?></span>
<?php } ?></td>
</tr>
</table>
</div>
</div>
<div id="NewsLetter">
<h2><?php echo $text_newsletter; ?></h2>
<div class="content">
<table class="form">
<tr>
<td><?php echo $entry_newsletter; ?></td>
<td><?php if ($newsletter) { ?>
<input type="radio" name="newsletter" value="1" checked="checked" />
<?php echo $text_yes; ?>
<input type="radio" name="newsletter" value="0" />
<?php echo $text_no; ?>
<?php } else { ?>
<input type="radio" name="newsletter" value="1" />
<?php echo $text_yes; ?>
<input type="radio" name="newsletter" value="0" checked="checked" />
<?php echo $text_no; ?>
<?php } ?></td>
</tr>
</table>
</div>
</div>
<?php if ($text_agree) { ?>
<div class="buttons">
<div class="right"><?php echo $text_agree; ?>
<?php if ($agree) { ?>
<input type="checkbox" name="agree" value="1" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="agree" value="1" />
<?php } ?>
<input type="submit" value="<?php echo $button_continue; ?>" class="button" />
</div>
</div>
<?php } else { ?>
<div class="buttons">
<div class="right">
<input type="submit" value="<?php echo $button_continue; ?>" class="button" />
</div>
</div>
<?php } ?>
</form>
<?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('input[name=\'customer_group_id\']:checked').live('change', function() {
var customer_group = [];
<?php foreach ($customer_groups as $customer_group) { ?>
customer_group[<?php echo $customer_group['customer_group_id']; ?>] = [];
customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_display'] = '<?php echo $customer_group['company_id_display']; ?>';
customer_group[<?php echo $customer_group['customer_group_id']; ?>]['company_id_required'] = '<?php echo $customer_group['company_id_required']; ?>';
customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_display'] = '<?php echo $customer_group['tax_id_display']; ?>';
customer_group[<?php echo $customer_group['customer_group_id']; ?>]['tax_id_required'] = '<?php echo $customer_group['tax_id_required']; ?>';
<?php } ?>
if (customer_group[this.value]) {
if (customer_group[this.value]['company_id_display'] == '1') {
$('#company-id-display').show();
} else {
$('#company-id-display').hide();
}
if (customer_group[this.value]['company_id_required'] == '1') {
$('#company-id-required').show();
} else {
$('#company-id-required').hide();
}
if (customer_group[this.value]['tax_id_display'] == '1') {
$('#tax-id-display').show();
} else {
$('#tax-id-display').hide();
}
if (customer_group[this.value]['tax_id_required'] == '1') {
$('#tax-id-required').show();
} else {
$('#tax-id-required').hide();
}
}
});
$('input[name=\'customer_group_id\']:checked').trigger('change');
//--></script>
<script type="text/javascript"><!--
$('select[name=\'country_id\']').bind('change', function() {
$.ajax({
url: 'index.php?route=account/register/country&country_id=' + this.value,
dataType: 'json',
beforeSend: function() {
$('select[name=\'country_id\']').after('<span class="wait"> <img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');
},
complete: function() {
$('.wait').remove();
},
success: function(json) {
if (json['postcode_required'] == '1') {
$('#postcode-required').show();
} else {
$('#postcode-required').hide();
}
html = '<option value=""><?php echo $text_select; ?></option>';
if (json['zone'] != '') {
for (i = 0; i < json['zone'].length; i++) {
html += '<option value="' + json['zone'][i]['zone_id'] + '"';
if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
html += ' selected="selected"';
}
html += '>' + json['zone'][i]['name'] + '</option>';
}
} else {
html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
}
$('select[name=\'zone_id\']').html(html);
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('select[name=\'country_id\']').trigger('change');
//--></script>
<script type="text/javascript"><!--
$(document).ready(function() {
$('.colorbox').colorbox({
width: 640,
height: 480
});
});
//--></script>
</div>
</body>
</html>

You can use Jquery date picker. Look at this https://jqueryui.com/datepicker/
You just need to use
("#inputField").Datepicker()
Place your html anywhere in the form.
The line above should go inside script> tag
Update You need to include jquery files like this in your page's header section
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">

Related

Page redirect After Update data with custom code in wordpress

I have put a WordPress code to change the profile. The data is being updated, but after updating it is not redirected to the main page. Now I have to redirect it to another page if it gets redirected, then data not update. How could I do that?
<form method="post" id="adduser" action="<?php the_permalink(); ?>" class="profile-field">
<table class="table table-bordered">
<tbody>
<!--tr>
<td>Name</td>
<td><?php echo $user_details['first_name'][0]; ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo wp_get_current_user()->user_email;?></td>
</tr-->
<p class="form-username">
<label for="first-name"><?php _e('First Name', 'profile'); ?></label>
<input class="text-input" name="first-name" type="text" id="first-name"
value="<?php the_author_meta( 'first_name', $current_user->ID ); ?>" />
</p>
<p class="form-username">
<label for="last-name"><?php _e('User mail', 'profile'); ?></label>
<input class="text-input" name="last-name" type="text" id="last-name"
value="<?php the_author_meta( 'user_email', $current_user->ID ); ?>" />
</p>
<!--tr>
<td>Company Code</td>
<td><?php echo $user_details['companycode'][0]; ?></td>
</tr>
<tr>
<td>Industry</td>
<td><?php echo $user_details['industury'][0]; ?></td>
</tr>
<tr>
<td>Job title</td>
<td><?php echo $user_details['jobtitle'][0]; ?></td>
</tr>
<tr>
<td>Experience</td>
<td><?php echo $user_details['experience'][0]; ?> Years</td>
</tr>
</tbody>
</table-->
<?php do_action('edit_user_profile',$current_user); ?>
<p class="form-submit">
<?php echo $referer; ?>
<div>
<button name="updateuser" type="submit" id="updateuser" class="submit button"
value="<?php _e('Update', 'profile'); ?>">update</button>
<?php //wp_nonce_field( 'update-user' ) ?>
<input name="action" type="hidden" id="action" value="update-user" />
</p>
<!--a class="profileinfo-edit" id ="edit" href="<?php echo site_url();?>/my-profile">Update Profile</a-->
</form>
<?php endif; ?>
See: https://codex.wordpress.org/Action_Reference/profile_update
add_action( 'profile_update', 'my_profile_update', 10, 2 );
function my_profile_update( $user_id, $old_user_data ) {
// Redirect
$redirect_url = '/your-redirect/permalink';
wp_redirect( $redirect_url );
exit();
}

Sec0nd Data Accessing error in my view page

I have fetched some 10 records from database and accessed in view page using foreach.But i can only give approve to first record not other records.Why it is not happening.
this is my view page
<tr><tbody>
<?php`enter code here`
if(isset($result))
{
foreach($result as $value){?>
<td><?php echo $name;?> </td>
<td><?php echo $value->date1;?> </td>
<td><?php echo $value->purpose;?> </td>
<td><?php echo $value->amount;?> </td>
<td><?php echo $value->rep_date;?> </td>
<?php if($value->temp==1){?>
<td> Approved </td>
<td><?php echo $value->id;?> </td>
<?php } else {?>
<td>
<form method="POST" action="<?php echo base_url().'Admin/updatestatus';?>">
<input type="hidden" name ="hid" id="hid" value="<?php echo $value->id;?>">
<input type="submit" name="sub" id="sub" class="btn green" value="Approve" >
</td>
<?php }?>
<td> chat </td>
</tr>
<?php } }?>
</tbody>
This is my controller
function updatestatus()
{
$this->load->database();
$this->load->library('session');
$this->load->model('lpmodel');
$frmdate=$this->session->userdata('from');
$todate=$this->session->userdata('to');
$status=$this->session->userdata('stat');
$emp_id=$this->session->userdata('id');
$hidid=$this->input->post('hid');
echo $hidid;
$data=array(
'temp'=>'1');
$query=$this->lpmodel->ad_aprove_data($emp_id,$data,$hidid);
if($query==true)
{ //echo "hi";
?> <script>
alert('Approved');
</script><?php
//$value['result']=$this->lpmodel->selectapproverow($id);
$name=$this->session->userdata('name');
$value['name']=$name;
//$status=$this->session->set_userdata('stat');
$value['result']=$this->lpmodel->ad_selectreimb($emp_id,$status,$frmdate,$todate);
$this->load->view('ad_reimbursement',$value);
}
else
{// echo "error";
?> <script>
alert('Try Again');
</script><?php
$value['new']=$this->lpmodel->fetchname();
$this->load->view('ad_reimbursement',$value);
}
}

submit product with session with add to cart

I have asked this question before. But it is updated with ajax and add to cart.
I have a form, which have some input fields and also have some check box fields. If any one fill fields and select some checkbox and then submit. Then some data according submission shows on another div.
Now If same person again fill that fields after first submission and select checkbox and submit. Then some data according submission shows on div. But it replace old submission content. I need all submission content, on div including all old submission content.
My code is:
<form class="reservation-form mb-0" action="" method="post" novalidate autocomplete="off">
<input name="name1" class="form-control required " type="text" placeholder="Enter Name" aria-required="true" required>
<input name="age" class="form-control required " type="number" placeholder="Enter Age" aria-required="true" required>
<select required id="selectarea" class="form-control" name="selectgender">
<option>Select Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
<?php
$query1=mysql_query("select * from lab_location_package_rel where city_id='$selectcity1' AND area_id='$selectarea1' AND lab_id='$selectlab1'") or die (mysql_error());
while($value = mysql_fetch_array($query1)) {
$mrp=$value['mrp'];
$opp=$value['offer_price_perc'];
$package_id=$value['package_id'];
$per=$mrp*$opp/100;
$total=$mrp-$per;
$query2=mysql_query("select * from package_master where id='$package_id'") or die (mysql_error());
$value2 = mysql_fetch_array($query2);
?>
<li class="list-group-item">
<div class="checkbox">
<input type="checkbox" id="checkbox" name="namec[]" class="quantity<?php echo $value["id"]; ?>" value="<?php echo $value["id"]; ?>" />
<label for="checkbox">
<b>Package Name:</b> <?php $package_title1=$value2['package_title']; echo $package_title1;?> <br>
<b>MRP:</b> <strike><?php $mrp1=$value['mrp']; echo $mrp1; ?> </strike><br>
<b>Offer Price:</b> <?php $total1=$total; echo $total1; ?>
</label>
</div>
</li>
<?php }
?>
<input type="button" class="pull-right btn btn-warning" value="Submit" onclick="add_cart('<?php echo $value["id"]; ?>')">
</form>
<div class="cart_data">
</div>
My AJAX is:
<script>
function add_cart(p_id=""){
var quantity = $(".quantity"+p_id).val();
$.ajax({
type:"post",
url:"ajax_cart.php",
data:{action:'add',p_id:p_id,quantity:quantity},
success:function(result){
$('.cart_data').html(result);
}
});
}
function remove_cart(p_id){
//alert(p_id);
$.ajax({
type:"post",
url:"ajax_cart.php",
data:{action:'delete',p_id:p_id},
success:function(result){
$('.cart_data').html(result);
}
});
}
function empty_cart(){
$.ajax({
type:"post",
url:"ajax_cart.php",
data:{action:'empty'},
success:function(result){
$('.cart_data').html(result);
}
});
}
</script>
My ajax_cart.php is:
<?php
include"connection.php";
$action = $_REQUEST['action'];
#$p_id = trim($_REQUEST['p_id']);
//$_SESSION['product_cart'] = array();
if($action == 'add'){
#$quantity = $_REQUEST['quantity'];
if(!empty($p_id)){
$query1=mysql_query("select * from lab_location_package_rel where id='$p_id'") or die (mysql_error());
while($product_data = mysql_fetch_assoc($query1)) {
$mrp=$product_data['mrp'];
$opp=$product_data['offer_price_perc'];
$package_id=$product_data['package_id'];
$per=$mrp*$opp/100;
$total=$mrp-$per;
$query2=mysql_query("select * from package_master where id='$package_id'") or die (mysql_error());
$value2 = mysql_fetch_array($query2);
}
$product = array("p_id"=>$product_data['id'],"title"=>$value2['package_title'],"price"=>$product_data['mrp']*$quantity,"image"=>$product_data['offer_price_perc']);
if(isset($_SESSION['product_cart']) && !empty($_SESSION['product_cart']))
{
if(!array_key_exists($product_data['id'],$_SESSION['product_cart']))
{
$_SESSION['product_cart'][$product_data['id']] = $product;
}
}
else{
$_SESSION['product_cart'][$product_data['id']] = $product;
}
}
}
if($action == "delete"){
unset($_SESSION['product_cart'][$p_id]);
}
if($action == "empty"){
session_destroy();
}
?>
<div class="cart_data">
<?php
if(isset($_SESSION['product_cart'])){
foreach($_SESSION['product_cart'] as $data){
?>
<h5>Patient Details</h5>
<table class="table table-bordered">
<tbody>
<tr>
<th>Name</th>
<th>Age</th>
<th>Sex</th>
<th></th>
</tr>
<tr>
<?php //if(isset($_POST["submit"])==true)
{
?>
<td><?php //echo $_POST['name1']; ?></td>
<td><?php //echo $_POST['age']; ?></td>
<td><?php //echo $_POST['selectgender']; ?></td>
<td>Update</td>
</tr>
</tbody></table>
<br><br>
<h5>Package Details</h5>
<table class="table table-bordered">
<tbody>
<tr>
<th>Package</th>
<th>MRP</th>
<th>Offer Price</th>
<th></th>
</tr>
<tr>
<td><?php echo $data['title']; ?></td>
<td><strike><?php echo $data['price']; ?></strike></td>
<td><?php echo $data['image']; ?></td>
<td>Delete</td>
</tr>
<?php
}
?>
</tr>
</tbody></table>
<?php } } ?>
</div>

How Do Set open popup And get Chacked value in another page

(1) Select To book(onchange value) Then open popup is ok.
(2)open popup in Checked NetAmount then i want to get Total in Text
Box.
(3)then Cheked NetAmount To Display This Record in index page.
i Want To point(2,3).
index.php
script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function ()
{
$("#Debit_id").change(function ()
{
var Debit_id = document.getElementById('Debit_id').value;
if(Debit_id!="")
{
window.open("getpopup.php?Debit_id="+Debit_id,'popup','width=700,height=400,left=200,top=200,scrollbars=1');
}
});
});
</script>
Book : <select name="Debit_id" id="Debit_id">
<option value="" selected="selected">Select Book</option>
<?php
$result1 = mysql_query("SELECT AccountName,CID FROM account")or die(mysql_error());
while($row1 = mysql_fetch_array($result1))
if($row1)
{ ?>
<option value="<?php echo $row1['CID']; ?>"><?php echo $row1['AccountName']; ?></option><?php
} ?>
</select>
<br />
NetAmount Total : <input type="text" class="input" name="NetAmount" id="TotalCost">
popup.php
<?php
include("../config.php");
$Debit_id = intval($_GET['Debit_id']);
?>
<table>
<tr>
<th>SrNo</th>
<th>EntryDate</th>
<th>NetAmount</th>
</tr>
<?php
$sql="SELECT * FROM transaction WHERE Credit_id = '".$Debit_id."'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$SrNo =$row['SrNo'];
$EntryDate = $row['EntryDate'];
$NetAmount =$row['NetAmount'];
?>
<tr>
<td><?php echo $SrNo ?></td>
<td><?php echo $EntryDate ?></td>
<td><?php echo $NetAmount ?><input type="checkbox" name="<?php echo $SrNo ?>" value="<?php echo $NetAmount ?>"></td>
</tr>
<?php }?>
<tr>
<td colspan="3" align="center">
<input type="submit" value="ok" />
</td>
</tr>
</table>

How to set maximum attachment size in Squirrelmail

I am using squirrelmail and I have a max size limit 5mb. When User tries to upload file larger than this limit Squirrelmail shows warning message successfully.
The problem is when user tries to upload file larger than "post_max_size"(php.ini) value, my php page just refreshes and Squirrelmail doesn't display any warning message. Is there any way to handle files larger than "post_max_size" value?
<div class="compose">
<table cellspacing="0" class="table1" id="attachment_table">
<tr class="header">
<td class="fieldName" style="width: 1%; white-space: nowrap;">
<?php echo _("New attachment");?>:
</td>
<td class="fieldValue">
<?php
if($max_file_size != -1) {
echo '<input type="hidden" name="MAX_FILE_SIZE" value="' . $max_file_size . '" />';
}
?>
<input type="file" name="attachfile" size="48" <?php if ($accesskey_compose_attach_browse != 'NONE') echo 'accesskey="' . $accesskey_compose_attach_browse . '" '; ?>/>
<input type="submit" name="attach" <?php if ($accesskey_compose_attach != 'NONE') echo 'accesskey="' . $accesskey_compose_attach . '" '; ?>value="<?php echo _("Attach"); ?>" />
<?php
if($max_file_size != -1) {
echo '(' . _("Max.") . ' ' . humanReadableSize($max_file_size) . ')';
}
if (!empty($plugin_output['add_attachment_notes'])) echo $plugin_output['add_attachment_notes'];
?>
</td>
</tr>
<?php
if (!empty($plugin_output['attachment_inputs'])) echo $plugin_output['attachment_inputs'];
$attachment_count = 1;
foreach ($attachments as $attach) {
?>
<tr class="attachment">
<td class="fieldName" style="width: 1%">
<input type="checkbox" name="delete[]" id="delete<?php echo $attachment_count; ?>" accesskey="<?php echo ($attachment_count % 10); ?>" value="<?php echo $attach['Key']; ?>" />
</td>
<td class="fieldValue"><label for="delete<?php echo $attachment_count; ?>">
<?php echo $attach['FileName']; ?> - <?php echo $attach['ContentType']; ?> (<?php echo humanReadableSize($attach['Size']); ?>)
</label></td>
</tr>
<?php
$attachment_count++;
}
if (count($attachments) > 0) {
?>
<tr class="header">
<td colspan="2">
<input type="submit" name="do_delete" <?php if ($accesskey_compose_delete_attach != 'NONE') echo 'accesskey="' . $accesskey_compose_delete_attach . '" '; ?>value="<?php echo _("Delete Selected Attachments"); ?>" />
</td>
</tr>
<?php
}
?>
</table>
</div>

Categories

Resources