
<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  jobcard_quotation_sub 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_quot_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</strong><span style="color:#FF0000">*</span>
      <div id="particulars_quot_validation_div" style="color:#F00"></div></td>
    <td width="159" class="text style1 style5 style21" align="right"><strong>Width </strong><span style="color:#FF0000">*</span><div id="width_quot_validation_div" style="color:#F00"></div>    </td>
    <td width="162" class="text style1 style5 style21" align="right"><strong>Height&nbsp;&nbsp;</strong><span style="color:#FF0000">*</span><div id="height_quot_validation_div" style="color:#F00"></div></td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Rate&nbsp;&nbsp;</strong><span style="color:#FF0000">*</span><div id="rate_quot_validation_div" style="color:#F00"></div>    </td>
        <td width="145" class="text style1 style5 style21" align="right"><strong>Amt&nbsp;&nbsp;</strong><div id="amt_quot_validation_div" style="color:#F00"></div>        </td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Confirmed Amt&nbsp;&nbsp;</strong><span style="color:#FF0000">*</span><div id="confirm_amt_quot_validation_div" style="color:#F00"></div>    </td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Qty&nbsp;&nbsp;</strong><div id="qty_quot_validation_div" style="color:#F00"></div>    </td>
    <td width="145" class="text style1 style5 style21" align="right"><strong>Value&nbsp;&nbsp;</strong><div id="values_quot_validation_div" style="color:#F00"></div>    </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   jobcard_quotation_sub where (jobcard_quot_no='$jobcard_no1' or jobcard_quot_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_quot_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>
      <td width="145" align="right" class="text style5 style4"><?php echo number_format($qty,2);?>&nbsp;&nbsp;</td>
      <td width="145" align="right" class="text style5 style4"><?php echo number_format($jobcard_values,2);?>&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_quot_sub('<?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_quot_sub('<?php echo $job_id;?>','<?php echo $jobcard_no; ?>')" width="20px" height="20px"></td><?php } ?>
  </tr>
    <?php 
		$qty1+=$qty;
	$jobcard_values1+=$jobcard_values;
	} ?>
 <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_quot" id="particulars_quot" tabindex="10" onkeypress="enterevent(event,'jobcard_width_quot','particulars_quot')" onkeyup="jobcard_quot_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_quot" id="jobcard_width_quot" tabindex="11" onKeyUp="get_jobcard_quot_amt(this.value,jobcard_height_quot.value,rate_quot.value),jobcard_quot_sub_clear_validation(this.value)" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false,enterevent(event,'jobcard_height_quot','jobcard_width_quot')"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $width1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="jobcard_height_quot" id="jobcard_height_quot"  class="types_class1" tabindex="12"  onKeyUp="get_jobcard_quot_amt(jobcard_width_quot.value,this.value,rate_quot.value),jobcard_quot_sub_clear_validation(this.value)" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false,enterevent(event,'rate','jobcard_height')" style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $height1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="rate_quot" id="rate_quot" onKeyUp="get_jobcard_quot_amt(jobcard_width_quot.value,jobcard_height_quot.value,this.value),jobcard_quot_sub_clear_validation(this.value)" onkeypress="enterevent(event,'conformed_amt','rate')" 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="amount_quot" id="amount_quot" onKeyUp="jobcard_quot_sub_clear_validation(this.value)"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $amount1; } ?>" readonly/></td>
    <td align="center" class="style5 "><input type="text" name="conformed_amt_quot" id="conformed_amt_quot" onKeyUp="get_jobcard_quot_tot(conformed_amt_quot.value,qty_quot.value),jobcard_quot_sub_clear_validation(this.value)" onkeypress="enterevent(event,'qty_quot','conformed_amt_quot')" tabindex="14"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $conformed_amt1; } ?>" /></td>
    <td align="center" class="style5 "><input type="text" name="qty_quot" id="qty_quot" onKeyUp="get_jobcard_quot_tot(conformed_amt_quot.value,this.value)" onkeypress="enterevent(event,'add','qty_quot')" tabindex="15"  class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $qtyss; }?>" /></td>
    <td align="center" class="style5 "><input type="text" name="values_quot" id="values_quot" readonly onKeyUp="jobcard_sub_clear_validation(this.value)" onkeypress="enterevent(event,'add','freight_rs')"   class="types_class1"  style="width:100%; height:100%;"  
    value="<?php if($edit_ids!=''){ echo $jobcard_valuesss; } ?>" /></td>
    <td colspan="2"><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="jobcard_quot_sub_list(jobcard_no_quot.value,entry_time_quot.value,created_by_quot.value,cust_po_no_quot.value,customer_name_quot.value,jobtype_quot.value,fabric_type_quot.value,particulars_quot.value,jobcard_width_quot.value,jobcard_height_quot.value,rate_quot.value,amount_quot.value,conformed_amt_quot.value,qty_quot.value,values_quot.value,'<?php echo $edit_ids;?>',this.value),enterevent(event,'tax','add'),reload_div();"></td>
  </tr>
  <tr>
  <td class="style5"></td>
  <td><div id="book_particulars_valid_div" style="color:#F00"></div></td>
  <td>  </td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>

    <td class="style3"><input type="hidden" name="overal_tot_quot" id="overal_tot_quot"  value="<?php  echo $jobcard_values1; ?>" /></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($qty1,2);?></strong></td>
        <td width="12%" class="text" style="font-size: 14px;"><strong><?php echo number_format($jobcard_values1,2);?></strong><input type="hidden" name="net_amt_quot" id="net_amt_quot" class="types_class1" value="<?php echo $jobcard_values1;?>" readonly style="width:124px; font-weight:bold; font-size: 18px"></td>
    <td width="24%"></td>

   </tr>


    </table>