<?php 
$url_cancel= "index.php?route=ToolPlants/Transaction/FixedAssetsSalesEntry_index".$rurl;
$url_add= "index.php?route=ToolPlants/Transaction/FixedAssetsSalesEntry".$rurl;
?>

<?php


if(isset($_REQUEST['save']))
{	

	//print_r($_REQUEST);
		
				$data['site']=$_REQUEST['site'];
				$data['date_time']=$_REQUEST['date'].' '.$_REQUEST['time'];
				$data['party_id']=$_REQUEST['party_name'];
				$data['asset_group']=$_REQUEST['machinegroup'];
				$data['removal_date']=$_REQUEST['removal_date'].' '.$_REQUEST['removal_time'];
				$data['created']=date('Y-m-d');
				$data['created_by']=$_SESSION['UserID'];
				
				
				//print_r($data);die;
				//$project=$_REQUEST['tpl_fixed_assetsales_entry']['project'];
				//$autoNo=$autoID->GenerateId('tpl_fixed_assetsales_entry','invoice','project='."'$project'",'/FASI/');
				
		if($s->RecordInsert('tpl_fixed_assetsales_entry',$data))
		{	
			 $last_id=DB_Last_Insert_Id($db,"tpl_fixed_assetsales_entry","id");
			for($i=0;$i<count($_REQUEST['asset_code_prefix']);$i++)
			{	
				
				$data1['tpl_fixed_assetsales_entry_id']=$last_id;
				$data1['asset_name']=$_REQUEST['machine_id'][$i];
				$data1['sale_value']=$_REQUEST['sale_value'][$i];
				$data1['sale_date']=$_REQUEST['sale_date'][$i];
				$data1['total_amount']=$_REQUEST['total_amount'][$i];
				
				$s->RecordInsert('tpl_fixed_assetsales_entry_details',$data1);
									
			}
				unset($_SESSION['manvi']);
				unset($_SESSION['itemSale']);
				unset($_SESSION['site']);
				unset($_SESSION['date']);
				unset($_SESSION['time']);
				unset($_SESSION['machinegroup']);
				unset($_SESSION['party_name']);
				unset($_SESSION['party_address']);
				unset($_SESSION['removal_date']);
				unset($_SESSION['removal_time']);
				$_SESSION['success_msg']="Saved Successfully";
				echo "<script>location.href='$url_cancel'</script>";			

		 }
	
}
				if(isset($_REQUEST['action']) && isset($_REQUEST['isid']))
				{
				//echo $_REQUEST['isid'];die;
					if($_REQUEST['action']=='edit' && !empty($_REQUEST['isid']))
					{	
						$recEdit=DB_fetch_array($s->GetRecordById('tpl_fixed_assetsales_entry','id='.$_REQUEST['isid']));
						extract($recEdit);
						//print_r($recEdit);die;
						//$project=$recEdit;
						
					}
				}
					else {
							$vendor=$_REQUEST['vendor'];
							$project=$_REQUEST['project'];
							$asset_group=$_REQUEST['asset_group']; 
							$invoice_date=FormatDateForSQL($_REQUEST['invoice_date']); 
						}

	if(isset($_REQUEST['update']))
   {
					$purchase_date=FormatDateForSQL($_REQUEST['tpl_fixed_assetsales_entry']['invoice_date']);
					$_REQUEST['tpl_fixed_assetsales_entry']['invoice_date']=$purchase_date;	
					extract($_REQUEST['tpl_fixed_assetsales_entry']);
			
			/*print_r($_REQUEST);
			
			echo 'dsfsd';
			die;*/
			
				$data2['site']=$_REQUEST['site'];
				$data2['date_time']=$_REQUEST['date'].' '.$_REQUEST['time'];
				$data2['party_id']=$_REQUEST['party_name'];
				$data2['asset_group']=$_REQUEST['machinegroup'];
				$data2['removal_date']=$_REQUEST['removal_date'].' '.$_REQUEST['removal_time'];
				$data2['created']=date('Y-m-d');
				$data2['created_by']=$_SESSION['UserID'];
			
					
		   if($s->RecordEdit('tpl_fixed_assetsales_entry',$data2,"id=".$_REQUEST['id']))
		    {
			
						if($s->DeleteRecord('tpl_fixed_assetsales_entry_details',"tpl_fixed_assetsales_entry_id=".$_REQUEST['id']))
						{
							$last_id=$_REQUEST['isid'];
							
					for($i=0;$i<count($_REQUEST['asset_code_prefix']);$i++)
						{				
				$data3['tpl_fixed_assetsales_entry_id']=$last_id;
				$data3['asset_name']=$_REQUEST['machine_id'][$i];
				$data3['sale_value']=$_REQUEST['sale_value'][$i];
				$data3['sale_date']=$_REQUEST['sale_date'][$i];
				$data3['total_amount']=$_REQUEST['total_amount'][$i];
				
				$s->RecordInsert('tpl_fixed_assetsales_entry_details',$data3);									
						}
						
				      }	      
			}
						unset($_SESSION['manvi']);
						unset($_SESSION['itemSale']);
						unset($_SESSION['site']);
						unset($_SESSION['date']);
						unset($_SESSION['time']);
						unset($_SESSION['machinegroup']);
						unset($_SESSION['party_name']);
						unset($_SESSION['party_address']);
						unset($_SESSION['removal_date']);
						unset($_SESSION['removal_time']);
						unset($_REQUEST['tpl_fixed_assetsales_entry']);
						$_SESSION['success_msg']="Update Successfully";
						//
						echo "<script>location.href='$url_cancel'</script>";
				
				
	}
	
	
	
	
if($_REQUEST['Cancel'])
{
	unset($_SESSION['manvi']);
	unset($_SESSION['qutotation_itemcode']);
	unset($_SESSION['site']);
	unset($_SESSION['date']);
	unset($_SESSION['time']);
	unset($_SESSION['machinegroup']);
	unset($_SESSION['party_name']);
	unset($_SESSION['party_address']);
	unset($_SESSION['removal_date']);
	unset($_SESSION['removal_time']);
}


if($_REQUEST['item_add'])
{
	$_SESSION['site']=$_REQUEST['site'];
	$_SESSION['date']=$_REQUEST['date'];
	$_SESSION['time']=$_REQUEST['time'];
	$_SESSION['machinegroup']=$_REQUEST['machinegroup'];
	$_SESSION['party_name']=$_REQUEST['party_name'];
	$_SESSION['party_address']=$_REQUEST['party_address'];
	$_SESSION['removal_date']=$_REQUEST['removal_date'];
	$_SESSION['removal_time']=$_REQUEST['removal_time'];
}


if($_REQUEST['item_delete']){
	for($i=0;$i<count($_REQUEST['select']);$i++)
			{					
				$s->DeleteRecord('tpl_fixed_assetsales_entry_details',"id=".$_REQUEST['asset_id_'.$i]);
									
			}	
	}
?><head>
<script src="ui/jquery.ui.timepicker.js"></script>	
<script language="JavaScript">
			function open_items()
			{
			<?php if(isset($_REQUEST['action']) && isset($_REQUEST['isid'])) { ?>
			window.open("fixedasset_sale_itempopup.php?action=edit&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&isid=<?php echo $_REQUEST['isid']; ?>","item_popup_window","height=300,width=800,toolbar=no,menubar=no,dependent=yes,resizable =yes, scrollbars=yes");
			<?php  } else {?>
				window.open("fixedasset_sale_itempopup.php?action=add&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&isid=<?php echo $_REQUEST['isid']; ?>","item_popup_window","height=300,width=800,toolbar=no,menubar=no,dependent=yes,resizable =yes, scrollbars=yes");
				<?php } ?>
			}	
function checkdata(str)
{	
	if(document.getElementById("select_"+str).checked)
	{	
			document.getElementById("sale_value_"+str).removeAttribute('readOnly');	
			document.getElementById("other_receivables_"+str).removeAttribute('readOnly');	
			document.getElementById("tax_"+str).removeAttribute('readOnly');	
			document.getElementById("tax_addition_"+str).removeAttribute('readOnly');	
			document.getElementById("tax_deductions_"+str).removeAttribute('readOnly');
			document.getElementById("total_amount_"+str).removeAttribute('readOnly');
	}	
	else
	{
			document.getElementById("sale_value_"+str).setAttribute('readOnly',true);	
			document.getElementById("other_receivables_"+str).setAttribute('readOnly',true);	
			document.getElementById("tax_"+str).setAttribute('readOnly',true);	
			document.getElementById("tax_addition_"+str).setAttribute('readOnly',true);	
			document.getElementById("tax_deductions_"+str).setAttribute('readOnly',true);	
			document.getElementById("total_amount_"+str).setAttribute('readOnly',true);		
	}
}
			function caltotal(i)
			{
					var sale=document.getElementById("sale_value_"+i).value;
					//alert(sale);	
					if(sale==''){ sale=0;}
					var amt=parseFloat(sale);
					var totalamt=amt;
					document.getElementById("total_amount_"+i).value=totalamt.toFixed(2);	
}
  
function getdata(str) 
{	 
		if (str.length==0)
		  {
		  document.getElementById("vouchar").innerHTML="";
		  return;
		  }
			if (window.XMLHttpRequest)
			  {
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			    {
			    document.getElementById("vouchar").innerHTML=xmlhttp.responseText;
			      }
			  }
			 
			xmlhttp.open("GET","tpl_fixedrecipt_reciptmo_creation.php?site="+str,true);
			xmlhttp.send();
}

function getclientdata(str) 
{	 
	//alert(str.length);return false;
		if (str.length==0)
		  {
		  document.getElementById("client_info").innerHTML='<textarea name="tpl_fixed_assetsales_entry[party_address]" rows="3" cols="15" style="width:220px;" ></textarea>';
		  return;
		  }
			if (window.XMLHttpRequest)
			  {
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
			    {
			    document.getElementById("client_info").innerHTML=xmlhttp.responseText;
			      }
			  }
			 
			xmlhttp.open("GET","client_info.php?site="+str,true);
			xmlhttp.send();
}
	
	function check_items(){	
					if($('input:checkbox:checked').length>0){
					return true;
					}else{
					alert('Please select a asset first.')
					return false;					
					}					
}
	
	
</script>

</head>


<form name="" id="" method="POST">
<div align="center">
<fieldset style="width:800px"><legend><strong>Fixed Asset Sales Entry</strong></legend>	
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="padding:5px"><!-- General details -->
      <table width="100%" cellspacing="4" cellpadding="4" border="0" style="color:#FF0000">
        <tr>
          <td style="padding:5px; text-align:center;" colspan="4" align="right"></td>
        </tr>
        <tr>
          <td style="text-align:center;" colspan="4"><b></b></td>
        </tr>
         <input type="hidden" value="<?php if($_REQUEST['action']=='edit') echo $id; ?>" name="id">
          <tr style="height:25px">
          <th>Site</th>
         
          <td width="30%" align="left" >
          <select name="site" id="site" class="detailedViewTextBox" style="width:100%;" >
          <option value="0">Select Site	</option>
          <?php
		    $query4=DB_query("Select * from locations where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
			while($row4=DB_fetch_array($query4))
				{
					$s='';
					if($site==$row4['loccode'] || $_SESSION['site']==$row4['loccode'])
					$s="selected";
					?>
					<option value=<?php echo $row4['loccode'];?> <?php echo $s;?>><?php echo $row4['locationname'];?></option>
				<?php }  ?>
          </select>
          </td>
          <th>Date & Time</th>
          <td width="30%" align="left"  >
		  <?php $date=explode(' ',$date_time); ?>
           <input type="text" name="date" value="<?php if($_SESSION['date']!=''){ echo $_SESSION['date'] ; }else{ echo 
		   $date[0];} ?>" id="date" class="datepicker" style="width:70%;"> 
		    <input type="text" name="time" id="time" class="timepicker" style="width:25%;" value='<?php if($_SESSION['time']!=''){ echo $_SESSION['time']; }else { echo $date[1]; } ?>'>   	
		  </td>
        </tr>
        <tr style="height:25px">
          <th>Party Name </th>
          <td width="30%" align="left" >
			   <select name="party_name" id="party_name" class="detailedViewTextBox" style="width:100%;" onchange="getclientdata(this.value)" >
			  <option value="">Select Party Name</option>
          <?php
		    $query4=DB_query("Select * from clientmaster where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
			while($row4=DB_fetch_array($query4))
				{
					$s='';
					if($party_id==$row4['id']  || $_SESSION['party_name']==$row4['id'])
					$s="selected";
					?>
					<option value=<?php echo $row4['id'];?> <?php echo $s;?>><?php echo $row4['c_name'];?></option>
				<?php }  ?>
          		</select>  
           </td>        
           <th>Machine Group</th>
           <td width="30%" align="left" >
    		  <select name="machinegroup" id="machinegroup" class="detailedViewTextBox" style="width:100%;" >
			  <option value="0">Select Group</option>
          <?php
		    $query4=DB_query("Select * from tpl_materialcategorydefinition where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
			while($row4=DB_fetch_array($query4))
				{
					$s='';
					if($asset_group==$row4['id'] || $_SESSION['machinegroup']==$row4['id'])
					$s="selected";
					?>
					<option value=<?php echo $row4['id'];?> <?php echo $s;?>><?php echo $row4['asset_capitalisation'];?></option>
				<?php }  ?>					
          		</select>
           </td>		  		 
		 </tr>
		 <tr style="height:25px"> 
		  <th>Party Address</th>
          <td width="25%" colspan="3" >
		  	<div id='client_info'>
          		<textarea name="party_address" rows="3" cols="15" style="width:220px;" ><?php if($_SESSION['party_address']!=''){ echo $_SESSION['party_address']; } else { 
								if(!empty($party_id)){
								$sql='select pre_address1,pre_address2,pre_address3 from clientmaster where id='.$party_id;
								$result = DB_query($sql,$db);
								$myrow=DB_Fetch_array($result);
								
								echo $myrow['pre_address1'].' '.$myrow['pre_address2'].' '.$myrow['pre_address3'];
								}
			 	} ?></textarea>
			 </div>
          </td>	
			    <td align="left" >          
          		</td>		 
			 </tr>
			 <tr style="height:25px">
			 <th>Removal Date</th>
          <td width="25%">
		  <?php $date_remove=explode(' ',$removal_date); ?>
          	 <input type="text" name="removal_date" value="<?php if($_SESSION['removal_date']!=''){ echo $_SESSION['removal_date']; }else{ echo $date_remove[0];} ?>" id="removal_date" class="datepicker" style="width:70%;"> 
		    <input type="text" name="removal_time" id="removal_time" class="timepicker" style="width:25%;" value="<?php if($_SESSION['removal_time']!=''){ echo $_SESSION['removal_time']; }else{ echo $date_remove[1]; } ?>">   	
              </td>	
			   <td align="left" >          
          </td>
			 </tr>
          <tr style="height:25px">
          <td align="left" >          
          </td>
          </tr>       	  
        <tr>
		<input type="hidden" name="created" value="<?php echo date('Y-m-d')?>">
		   <input type="hidden" name="created_by" value="<?php echo $_SESSION['UserID']?>">
		   
          <td style="padding:5px; text-align:left;" colspan="4" >
		  <input type="submit" value="Add Assets" name="item_add" class="add" onclick="open_items()">	
		   <?php if(isset($_REQUEST['action']) && isset($_REQUEST['isid']))
				{ ?>
		   <input type="submit" value="Delete Assets" name="item_delete" class="add" onclick="return check_items()">		  
		   <?php } ?>
        </td></tr>
      </table></td>
  </tr>
</table></fieldset>
</div>

<div align="center">
<div style="overflow:auto; width:800px; height:150px">
<table width="100%" border="0" align="center">
<tr>
<td bgcolor="#c6c6c6" ><table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
  <tr>   
    <td width="2%" bgcolor="#c6c6c6"><strong>S.No.</strong></td>
    <td width="2%"><strong>Asset Code</strong></td>
    <td width="2%"><strong>Asset Name</strong></td>
    <td width="2%"><strong>Purchase Value</strong></td>
    <td width="2%"><strong>Purchase Date</strong></td>
    <td width="2%"><strong>Sale Value</strong></td>
    <td width="2%"><strong>Sale Date</strong></td>
    <td width="2%"><strong>Total Amount</strong></td>
  </tr>
	<tr>
	<?php 	
	if($_REQUEST['isid']!='')
	{	
		$query=DB_query("select * from tpl_fixed_assetsales_entry_details where tpl_fixed_assetsales_entry_id='".$_REQUEST['isid']."'",$db);
		$i=0;		
		$_SESSION['itemSale']=array();		
		
		while($item_row_info=DB_fetch_array($query))
		{ 	
		//print_r($item_row);die;
		$item_sql="Select * from tpl_fixed_asset_definition where id='".$item_row_info[asset_name]."'";
		$item_result=DB_query($item_sql,$db);
		while($item_row=DB_fetch_array($item_result))
		{
			
		$_SESSION['itemSale'][]=$item_row['id'];
			?>
		<td><input type="checkbox" name="select[]" id="select_<?php echo $i;?>" class='check_box'> <input type="hidden" name='asset_id_<?php echo $i; ?>' value='<?php echo $item_row_info['id']; ?>' /></td>
		<td><?php echo $item_row['asset_code_prefix'];?><input type="hidden" name="asset_code_prefix[]" value="<?php echo $item_row['asset_code_prefix'];?>" id="asset_code_prefix_<?php echo $i;?>"/><input type="hidden" name="machine_id[]" value="<?php echo $item_row['id'];?>" id="machine_id_<?php echo $j;?>"/></td>
		<td><?php echo $item_row['asset_name'];?><input type="hidden" name="asset_name[]" value="<?php echo $item_row['asset_name'];?>" id="asset_name_<?php echo $i;?>"/></td>
		<td><?php echo $item_row['asset_amount'];?><input type="hidden" name="purchase_value[]" value="<?php echo $item_row['asset_amount'];?>" id="purchase_value_<?php echo $i;?>" readonly='true'/></td>
		<td><?php echo $item_row['purchase_date'];?><input type="hidden" name="purchase_date[]" value="<?php echo $item_row['purchase_date'];?>" id="purchase_date_<?php echo $i;?>" readonly='true'/></td>
		<td><input type="text" name="sale_value[]" value="<?php echo $item_row_info['sale_value'];?>" id="sale_value_<?php echo $i;?>"/></td>
		<td><input type="text" name="sale_date[]" value="<?php echo $item_row_info['sale_date'];?>" id="sale_date_<?php echo $i;?>"  class='datepicker'/></td>
		<td><input type="text" name="total_amount[]" value="<?php echo $item_row_info['total_amount'];?>" id="total_amount_<?php echo $i;?>" onfocus="caltotal(<?php echo $i; ?>)" readonly /></td>

		</tr>
		<?php  }
		 $i++;
		}
		if($_SESSION['manvi']!='')
		{			
		$Sale=array();
		$Sale=explode('#',$_SESSION['manvi']);
		for($j=0,$k=$i;$j<count($Sale);$j++,$k++)
        {	
		if($j%2==0)
		{$bg="#CCCCCC";}
		else
		$bg="#C8BECB";
		$yy=explode(",",$Sale[$j]);
        $_SESSION['itemSale'][]=$yy[0];
		$item_sql="Select * from tpl_fixed_asset_definition where id='".$yy[0]."'";
		$item_result=DB_query($item_sql,$db);
		while($item_row=DB_fetch_array($item_result))
		{
 ?>
		<td><input type="checkbox" name="select[]" id="select_<?php echo $j;?>" class='check_box' /></td>
		<td><?php echo $item_row['asset_code_prefix'];?><input type="hidden" name="asset_code_prefix[]" value="<?php echo $item_row['asset_code_prefix'];?>" id="asset_code_prefix_<?php echo $k;?>"/><input type="hidden" name="machine_id[]" value="<?php echo $item_row['id'];?>" id="machine_id_<?php echo $k;?>" /></td>
		<td><?php echo $item_row['asset_name'];?><input type="hidden" name="asset_name[]" value="<?php echo $item_row['asset_name'];?>" id="asset_name_<?php echo $k;?>"/></td>
		<td><?php echo $item_row['asset_amount'];?><input type="hidden" name="purchase_value[]" value="<?php echo $item_row['asset_amount'];?>" id="purchase_value_<?php echo $k;?>" readonly='true'/></td>
		<td><?php echo $item_row['purchase_date'];?><input type="hidden" name="purchase_date[]" value="<?php echo $item_row['purchase_date'];?>" id="purchase_date_<?php echo $k;?>" readonly='true'/></td>
		<td><input type="text" name="sale_value[]" value="<?php echo $item_row_info['sale_value'];?>" id="sale_value_<?php echo $k;?>"/></td>
		<td><input type="text" name="sale_date[]" value="<?php echo $item_row_info['sale_date'];?>" id="sale_date_<?php echo $k;?>"  class='datepicker'/></td>
		<td><input type="text" name="total_amount[]" value="<?php echo $item_row_info['total_amount'];?>" id="total_amount_<?php echo $k;?>" onfocus="caltotal(<?php echo $k; ?>)" readonly /></td>
		</tr>
		<?php  } }  }?>
 <input type="hidden" name="counter" value="<?php echo ($i+$j);?>" id="counter" />
 <?php  } else { 

if($_SESSION['manvi']!='')
{ 
		$itemArray=array();
		$itemArray=explode('#',$_SESSION['manvi']);
		for($j=0;$j<count($itemArray);$j++)
	    {
		if($j%2==0)
		{$bg="#CCCCCC";}
		else
		$bg="#C8BECB";
		$item_sql="Select * from tpl_fixed_asset_definition where id='".$itemArray[$j]."'";
		$item_result=DB_query($item_sql,$db);
		while($item_row=DB_fetch_array($item_result))
		{
 ?>
		<td><input type="checkbox" name="select[]" id="select_<?php echo $j;?>" class='check_box' ></td>
		<td><?php echo $item_row['asset_code_prefix'];?><input type="hidden" name="asset_code_prefix[]" value="<?php echo $item_row['asset_code_prefix'];?>" id="asset_code_prefix_<?php echo $j;?>"/><input type="hidden" name="machine_id[]" value="<?php echo $item_row['id'];?>" id="machine_id_<?php echo $j;?>"/></td>
		<td><?php echo $item_row['asset_name'];?><input type="hidden" name="asset_name[]" value="<?php echo $item_row['asset_name'];?>" id="asset_name_<?php echo $j;?>"/></td>
		<td><?php echo $item_row['asset_amount'];?><input type="hidden" name="purchase_value[]" value="<?php echo $item_row['asset_amount'];?>" id="purchase_value_<?php echo $j;?>" readonly='true'/></td>
		<td><?php echo $item_row['purchase_date'];?><input type="hidden" name="purchase_date[]" value="<?php echo $item_row['purchase_date'];?>" id="purchase_date_<?php echo $j;?>" readonly='true'/></td>
		<td><input type="text" name="sale_value[]" value="" id="sale_value_<?php echo $j;?>"/></td>
		<td><input type="text" name="sale_date[]" value="" id="sale_date_<?php echo $j;?>"  class='datepicker'/></td>
		<td><input type="text" name="total_amount[]" value="<?php echo $item_row['total_amount'];?>" id="total_amount_<?php echo $j;?>" onfocus="caltotal(<?php echo $j; ?>)" readonly/></td>
		</tr>
		<?php } } }}?>
 </table>
</td>
</tr>
</table>
</div>
</div><tr>
 <td style="padding:5px; text-align:center;" colspan="4" align="right">
		  <input type="submit" value="Save" name="<?php if($_REQUEST['action']=='edit') echo 'update'; else echo 'save'; ?>" class="add">
		    <a href="<?php echo $url_cancel;?>"><input type="button" value="Cancel" name="button" onclick="<?php unset($_SESSION['manvi']);
			unset($_SESSION['itemSale']); ?>" class="add"></a>
        </td></tr>
</form>
<script>
$('.timepicker').timepicker();

</script>