
<style>
.style1 {border-top: solid 1px;border-top-color: #CCCCCC;}
.style21 {border-bottom: solid 1px;border-bottom-color: #CCCCCC;}
.style5 {border-left: solid 1px;border-left-color: #CCCCCC;}
.style3{ border-right: solid 1px;border-right-color: #CCCCCC; }
.style4 {border-bottom: solid 1px;border-bottom-color: #CCCCCC;}
.text{ font-family: Verdana; font-size:13px;}
#tot_amt::-webkit-input-placeholder { color:#666; }
</style>
<?php error_reporting(0);
/***************************** PREVIOUS NEXT CODING ****************************************/
include("../../include/db.php");
ob_start();
session_start();
$user_id11 = $_SESSION['login_user_id'];

  $edit_ids=$_POST['edit_id']; 
  $book_no=$_POST['book_no'];
  $sql="select * from  sample_jobcard_sublist where job_id='$_POST[edit_id]' ";
  $rs=mysql_query($sql);
  while($rsdata=mysql_fetch_array($rs))
  {
       $sno=$sno+1;
	   $job_id=$rsdata['job_id'];
	   $jobcard_no=$rsdata['jobcard_no'];
   	   $particulars1=$rsdata['particulars'];
	   $width1=$rsdata['width'];
	   $height1=$rsdata['height'];
	   $rate1=$rsdata['rate'];
	   $amount1=$rsdata['amount'];
	   $conformed_amt1=$rsdata['conformed_amt'];
	    $qtyss=$rsdata['qty'];
	   $jobcard_valuesss=$rsdata['jobcard_values'];
	   }
 ?>
<div style="height:220px; width:78%; padding-left:0px;  overflow-x:hidden; overflow-y:scroll; white-space:nowrap; ">
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" >
  <tr  bgcolor="#F2F2F2">
    <td width="42" height="25" class="text style5 style1 style21"><strong>&nbsp;S.No&nbsp;</strong></td>
    <td width="588" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Particulars<span style="color:#FF0000">*</span></strong>
      </td>
    <td width="159" class="text style1 style5 style21" align="right"><strong>Width <span style="color:#FF0000">*</span></strong> </td>
    <td width="162" class="text style1 style5 style21" align="right"><strong>Height<span style="color:#FF0000">*</span>&nbsp;&nbsp;</strong></td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Inch<span style="color:#FF0000">*</span>&nbsp;&nbsp;</strong>
         </td>
        <td width="145" class="text style1 style5 style21" align="right"><strong>Qty<span style="color:#FF0000">*</span>&nbsp;&nbsp;</strong>
          </td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Total&nbsp;&nbsp;</strong>
       </td>
   

    <td width="124" class="text style1 style5 style3 style21" align="center"><strong>Action</strong></td>
 </tr>
   <?php
    $jobcard_no=$_GET['jobcard_no'];
    $jobcard_no1=$_POST['jobcard_no'];
  
     $sql="select * from   sample_jobcard_sublist where (jobcard_no='$_POST[jobcard_no]' or jobcard_no='$jobcard_no')";
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{ 
   				$sno=$sno+1;
   				$job_id=$rsdata['job_id'];
     			$jobcard_no=$rsdata['jobcard_no'];
				$particulars=$rsdata['particulars'];
   				$width=$rsdata['width'];
				$height=$rsdata['height'];
				$rate=$rsdata['rate'];
				$amount=$rsdata['amount'];
				$conformed_amt=$rsdata['conformed_amt'];
				$qty=$rsdata['qty'];
				$jobcard_values=$rsdata['jobcard_values'];
				if($weight_kg=="0.00")
				{
					$weight_kg_res='';
				}
				else
				{
					$weight_kg_res=$weight_kg;
				}
				$kg_rate=$rsdata['kg_rate'];
				
				if($kg_rate=="0.00")
				{
					$kg_rate_res='';
				}
				else
				{
					$kg_rate_res=$kg_rate;
				}
				$frieght_charge=$rsdata['frieght_charge'];
				
				$row=$row+1;
								  $row1=$row%2;
								  if($row1==0)
								  {
								  $class='style="background-color:#f6faff;border-bottom:solid 1px;border-color:#E2E2E2"';
								  }
								  else
								  {
								  $class='style="background-color:#f3f3ff;border-bottom:solid 1px;border-color:#E2E2E2"';
								  }
  ?>
   <tr>
      <td width="42" height="27"  align="center" class="text style4  style5"><?php echo $sno; ?></td>
      <td width="588" align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;&nbsp;<?php echo $particulars;?></td>
      <td width="159" align="right" class="text style5 style4"><?php echo $width;?>&nbsp;&nbsp;</td>
      <td width="162" align="right" class="text style5 style4"><?php echo $height;?>&nbsp;&nbsp;</td>
      <td width="145" align="right" class="text style5 style4"><?php echo number_format($rate,3);?>&nbsp;&nbsp;</td>
            <td width="145" align="right" class="text style5 style4"><?php echo $amount;?>&nbsp;&nbsp;</td>
      <td width="145" align="right" class="text style5 style4"><?php echo $conformed_amt;?>&nbsp;&nbsp;</td>
     
      <?php if(($user_id11=='1')||($user_id11=='3'))
	 { 
	 ?><td width="124" colspan="2"  align="center" class="style5 style3 style4" > <img src="img/edit-icon.png" onClick="edit_jobcard_sub_sample('<?php echo $job_id;?>','<?php echo $jobcard_no; ?>')" width="18px" height="18px">&nbsp;&nbsp;&nbsp;<img src="img/cross-small.png"  title="Delete" onClick="del_jobcard_sub_sample('<?php echo $job_id;?>','<?php echo $jobcard_no; ?>')" width="20px" height="20px"></td><?php } ?>
  </tr>
    <?php 
		$amount12+=$amount;
	$conformed_amt12+=$conformed_amt;
	} ?>
 <tr height="20px">
    <td width="42" height="28"  align="center" class="text style4 style5" ><?php echo $sno+1; ?></td>
      <td width="588" align="left" class="style5" ><input type="text" class="types_class1" name="particulars" id="particulars" tabindex="10" onkeypress="enterevent(event,'jobcard_width','particulars'),sampjobcard_sub_clear_validation(this.value)"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $particulars1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" class="types_class1" name="jobcard_width" id="jobcard_width" tabindex="11" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" onkeyup="sampjobcard_sub_clear_validation(this.value),get_total_inch_value(jobcard_width.value,jobcard_height.value)" onfocus="get_total_inch_value(jobcard_width.value,jobcard_height.value)" style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $width1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="jobcard_height" id="jobcard_height" onkeyup="sampjobcard_sub_clear_validation(this.value),get_total_inch_value(jobcard_width.value,jobcard_height.value)" onfocus="get_total_inch_value(jobcard_width.value,jobcard_height.value)"  class="types_class1" tabindex="12"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $height1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="inch" id="inch" readonly="readonly" onkeyup="sampjobcard_sub_clear_validation(this.value),get_total_inch(inch.value,qty.value)" onfocus="get_total_inch(inch.value,qty.value)" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" tabindex="13"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $rate1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="qty" id="qty" onkeyup="sampjobcard_sub_clear_validation(this.value),get_total_inch(inch.value,qty.value)" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" onfocus="get_total_inch(inch.value,qty.value)"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $amount1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="total" id="total"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" tabindex="14"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $conformed_amt1; } ?>" /></td>
    
    <td ><input type="button" name="add" id="add" tabindex="16" value="<?php if($edit_ids!='') { echo "EDIT"; } else { echo "ADD"; } ?>" style="width:100%; height:120%;" onClick="sample_jobcard_sub_list(jobcard_no.value,entry_time.value,customer_name.value,particulars.value,jobcard_width.value,jobcard_height.value,inch.value,qty.value,total.value,'<?php echo $edit_ids;?>',this.value)"></td>
  </tr>
  <tr>
  <td class="style5"></td>
  <td><div id="sampbook_particulars_valid_div" style="color:#F00"></div></td>
  <td>  <div id="sampbook_width_valid_div" style="color:#F00"></div></td>
    <td><div id="sampbook_height_valid_div" style="color:#F00"></div></td>
    <td><div id="sampbook_inch_valid_div" style="color:#F00"></div></td>
    <td><div id="sampbook_qty_valid_div" style="color:#F00"></div></td>
    <td><div id="sampbook_total_valid_div" style="color:#F00"></div></td>
    <td></td>
    <td></td>

    <td class="style3"><input type="hidden" name="overal_tot" id="overal_tot"  value="<?php  echo $conformed_amt12; ?>" /></td>
    </tr>
 <tr height="160px">
   <td colspan="10"  align="center" class="style4 style3 style5" ><table width="100%" border="0" cellpadding="0" cellspacing="0">
    
   </table></td>
   </tr>
    <tr>    </tr>
    </table>
   
</div>
  <table width="119%">
     <tr >
   <td colspan="6"  align="center" ></td>
      <td width="9%"></td>
    <td width="9%"><span class="text" style="font-size: 14px;"><strong><strong>Total</strong></strong></span></td>
    <td width="15%"  class="text" style="font-size: 14px;">&nbsp;</td>
    <td width="7%" class="text" style="font-size: 14px;"><strong><?php echo number_format($amount12,2);?></strong></td>
        <td width="12%" class="text" style="font-size: 14px;"><strong><?php echo number_format($conformed_amt12,2);?></strong><input type="hidden" name="net_amt" id="net_amt" class="types_class1" value="<?php echo $conformed_amt12;?>" readonly style="width:124px; font-weight:bold; font-size: 18px"></td>
    <td width="24%"></td>

   </tr>


    </table>