<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:14px;}
#tot_amt::-webkit-input-placeholder { color:#666; }
</style>
<?php error_reporting(0);
date_default_timezone_set('Asia/Kolkata');
/***************************** PREVIOUS NEXT CODING ****************************************/
 include("../../include/db.php");
   
ob_start();
session_start();
$user_id11 = $_SESSION['login_user_id'];

  $edit_ids=$_POST['edit_id']; 
  $jobcard_no=$_POST['jobcard_no'];
  $sql="select * from inward_sub_list where id='$_POST[edit_id]' ";
  $rs=mysql_query($sql);
  while($rsdata=mysql_fetch_array($rs))
  {
       $sno=$sno+1;
	   $id=$rsdata['id'];
	   $jobcard_nos=$rsdata['jobcard_no'];
   	   $inward_particulars=$rsdata['inward_particular'];
	   $roll_widths=$rsdata['roll_width'];
	   $kg_heights=$rsdata['kg_height'];
	   $inward_qtys11=$rsdata['inward_qty'];
	   $inward_qtys111=$rsdata['order_qty'];
	   $inward_datess=$rsdata['inward_date'];
	   }
 ?>
<div style="height:215px; width:83%; padding-left:0px;  overflow-x:hidden; overflow-y:scroll; white-space:nowrap; " align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" >
    <tr  bgcolor="#F2F2F2">
    <td  width="5%" height="25" class="text style5 style1 style21"><strong>&nbsp;S.No&nbsp;</strong></td>
    <td width="5%" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Date</strong></td>
    <td  width="35%"class="text style1 style5 style21"><strong>&nbsp;&nbsp;Particulars<span style="color:#FF0000"> *</span></strong></td>
    <td width="15%" class="text style1 style5 style21" align="right"><strong>Width<span style="color:#FF0000"> *</span></strong>&nbsp;</td>
    <td  width="15%" class="text style1 style5 style21" align="right"><strong>Height<span style="color:#FF0000"> *</span></strong>&nbsp;</td>
    <td width="15%" class="text style1 style5 style21" align="right"><strong>Order Qty<span style="color:#FF0000"> *</span>&nbsp;&nbsp;</strong></td>
	<td width="15%" class="text style1 style5 style21" align="right"><strong>Qty<span style="color:#FF0000"> *</span>&nbsp;&nbsp;</strong></td>
    <td width="15%" class="text style1 style5 style3 style21" align="center"><strong>Action</strong></td>
 </tr>
 
   <?php
    $jobcard_no_get=$_GET['jobcard_no'];
    $jobcard_no_post=$_POST['jobcard_no'];
				//	 echo date('Y-m-d').'T'.date('H:i');
    $lokie = "select * from jobcard_main where jobcard_no='$jobcard_no_post'";
                  $lokie12=mysql_query($lokie);
                  while($lokie129=mysql_fetch_array($lokie12))
      {
        $approve_status=$lokie129['approval_status'];
        // echo $approve_status.'lokie';
      }
      // echo $approve_status.'lokie';
      if($approve_status!=0){

    $sql="select * from  inward_sub_list where jobcard_no='$jobcard_no_post' or jobcard_no='$jobcard_no_get'";
    $rs=mysql_query($sql);
	$sno=0;
   		while($rsdata=mysql_fetch_array($rs))
  			{
   				$sno=$sno+1;
   				$id=$rsdata['id'];
				$jobcard_no=$rsdata['jobcard_no'];
				$entrydates=$rsdata['entrydates'];
				$inward_date=$rsdata['inward_date'];
   				$inward_particular=$rsdata['inward_particular'];
				$roll_width=$rsdata['roll_width'];
				$kg_height=$rsdata['kg_height'];
				$inward_qty=$rsdata['inward_qty'];
					
				$inward_qty1=$rsdata['order_qty'];
				
				$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="5%"  height="27"  align="center" class="text style4  style5"><?php echo $sno; ?></td>
      <td width="5%" align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;&nbsp;<?php echo date('d-m-Y H:i',strtotime($inward_date));?></td>
      <td width="35%"  align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;&nbsp;<?php echo $inward_particular;?></td>
      <td width="15%" align="right" class="text style5 style4"><?php echo $roll_width;?>&nbsp;&nbsp;</td>
      <td width="15%" align="right" class="text style5 style4"><?php echo $kg_height;?>&nbsp;&nbsp;</td>
	   <td width="15%" align="right" class="text style5 style4"><?php echo $inward_qty1;?>&nbsp;&nbsp;</td>
	    <td width="15%" align="right" class="text style5 style4"><?php echo $inward_qty;?>&nbsp;&nbsp;</td>
    <?php if(($user_id11=='1')||($user_id11=='3'))
	 { 
	 ?>   <td width="15%" colspan="2"  align="center" class="style5 style3 style4" > <img src="img/edit-icon.png" onClick="edit_sublist_inward('<?php echo $id;?>',
      '<?php echo $jobcard_no; ?>')" width="18px" height="18px">&nbsp;&nbsp;&nbsp;<img src="img/cross-small.png"  title="Delete" onClick="delete_sublist_inward('<?php echo $id;?>','<?php echo $jobcard_no; ?>')" width="20px" height="20px"></td><?php } ?>
  </tr>
    <?php 
	$inward_qtys+=$inward_qty;
	} ?>
 <tr>
    <td width="50" height="28"  align="center" class="text style4 style5" ><?php echo $sno+1; ?></td>
      <td width="100" align="left" class="style5" ><input type="datetime-local" name="entrydates" id="entrydates"  <?php if($_SESSION['user_type']!=1) { ?> readonly <?php } ?>  onFocus="get_particulars(in_jobcard_no.value)"  tabindex="3" value="<?php if($inward_datess!='') { echo $inward_datess; } else{  echo date('Y-m-d').'T'.date('H:i'); } ?>" style="height:30px; width:200px;"class="types_class1" onkeypress="enterevent(event,'inward_particular','entrydates')" /></td>
    
    <td width="450" align="left" class="style5" ><div id="inward_partic_divs"><select name="inward_particular"  id="inward_particular"  tabindex="4"  onchange="inward_sub_clear_validation(this.id),enterevent(event,'add','inward_particular'),get_rolls_sub(in_jobcard_no.value,inward_particular.value),get_height_sub(in_jobcard_no.value,inward_particular.value),get_qty_sub(in_jobcard_no.value,inward_particular.value)"  style="width:100%; height:30px;">
    <?php if($edit_ids!=''){ ?>
    <option value="<?php if($edit_ids!=''){ echo $inward_particulars; } else {  }?>"><?php if($edit_ids!=''){ echo $inward_particulars; } else {  }?></option>    <?php } ?>
    </select></div></td>
    <td width="100" align="center" class="style5 "><div id="rolls_div"><input type="text" class="types_class1" name="roll_width" id="roll_width" onKeyUp="inward_sub_clear_validation(this.id)" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false"  style="width:100%; height:28px;" value="<?php if($edit_ids!=''){ echo $roll_widths; } else {  }?>" readonly/></div></td>
    <td width="100" align="center" class="style5 "><div id="kg_height_div"><input type="text" name="kg_height" id="kg_height"  class="types_class1"   onKeyUp="inward_sub_clear_validation(this.id)"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" style="width:100%; height:28px;" value="<?php if($edit_ids!=''){ echo $kg_heights; } else {  }?>" readonly/></div></td>
	
	<td width="100" align="center" class="style5 "><div id="qty_sub_div1"><input type="text" name="inward_qty1" id="inward_qty1" onKeyUp="inward_sub_clear_validation(this.id)" onkeypress="enterevent(event,'add','inward_qty1')" tabindex="5"  class="types_class1" style="width:100%; height:28px;" value="<?php if($edit_ids!=''){ echo $inward_qtys111; } else {  }?>" readonly/></div></td>
    <td width="100" align="center" class="style5 "><div id="qty_sub_div"><input type="text" name="inward_qty" id="inward_qty" onKeyUp="inward_sub_clear_validation(this.id)" onkeypress="enterevent(event,'add','inward_qty')" tabindex="5"  class="types_class1" style="width:100%; height:28px;" value="<?php if($edit_ids!=''){ echo $inward_qtys11; } else {  }?>" /></div></td>
	
    <td width="100" colspan="2"><input type="button" name="add" id="add" tabindex="6" value="<?php if($edit_ids!='') { echo "EDIT"; } else { echo "ADD"; } ?>" style="width:100%; height:120%;" onClick="inward_sublist(in_jobcard_no.value,in_cust_name.value,inward_date.value,inward_particular.value,roll_width.value,kg_height.value,inward_qty.value,inward_qty1.value,fabric_type.value,created_by.value,job_types.value,entrydates.value,total_piece.value,customer_dc_no.value,receipt.value,overall_qty.value,invoice_no.value,'<?php echo $edit_ids;?> ',this.value),enterevent(event,'submit','add'),reload_div();"></td>
  </tr>
<?php } ?>
  <tr>
  <td class="style5"></td> 
  <td class="style3"></td> 
  <td style="font-family: Verdana, sans-serif; font-size:12px;"><div id="inward_particular_validation_div" style="color:#F00"></div></td>
  <td  style="font-family: Verdana, sans-serif; font-size:12px;"><div id="roll_width_validation_div" style="color:#F00"></div></td>
  <td  style="font-family: Verdana, sans-serif; font-size:12px;"><div id="kg_height_validation_div" style="color:#F00"></div></td>
  <td  style="font-family: Verdana, sans-serif; font-size:12px;"><div id="inward_qty_validation_div" style="color:#F00"></div></td>
 </tr>
 <tr height="100px">
  <td></td> 
  <td></td> 
  <td></td>
  <td></td>
  <td style="font-family: Verdana, sans-serif; font-size:14px; font-weight:bold;">Total</td>
  <td align="right"  style="font-family: Verdana, sans-serif; font-size:14px; font-weight:bold;"><?php  echo $inward_qtys; ?><input type="hidden" name="overall_qty" id="overall_qty"  value="<?php  echo $inward_qtys; ?>" /></td>
 </tr>
</table>
</div>
