<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: 12px;}

#tot_amt::-webkit-input-placeholder { color:#666; }
</style>
<?php 
error_reporting(0);
include("../../include/db.php");
ob_start();
session_start();
$user_id = $_SESSION['login_user_id'];

  $edit_ids=$_POST['edit_id']; 
  $jobcard_no=$_POST['jobcard_no'];
  $sql="select * from media_sub_list where id='$_POST[edit_id]' ";
  $rs=mysql_query($sql);
  while($rsdata=mysql_fetch_array($rs))
  {
				   $sno=$sno+1;
				   $id=$rsdata['id'];
				   $jobcard_no_edit=$rsdata['jobcard_no'];
				   $media_particular_edit=$rsdata['media_particular'];
				   $roll_name=$rsdata['roll_name'];
	            $order_qty_edit=$rsdata['order_qty'];
				$kg_height_edit=$rsdata['plan_qty'];
				$steps_edit=$rsdata['steps'];
				$total_steps_edit=$rsdata['total_steps'];
				$req_by=$rsdata['req_by'];
				$tot_req_by=$rsdata['tot_req_by'];
				$roll_size=$rsdata['roll_size'];
				$width=$rsdata['width'];
				$height=$rsdata['height'];
}
?>

<div style="height:200px; width:98%; 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="40"  class="text style5 style1 style21"><strong>&nbsp;S.No&nbsp;</strong></td>
    <td width="121" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Date</strong></td>
    <td width="109" class="text style1 style5 style21"><strong>Roll Size</strong></td>
     <td width="96" class="text style1 style5 style21"><strong>Roll Name</strong></td>
    <td width="225" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Particulars</strong></td>
     <td width="61" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Width</strong></td>
      <td width="61" class="text style1 style5 style21"><strong>&nbsp;&nbsp;Height</strong></td>
    <td width="88" align="right" class="text style1 style5 style21"><strong>Order Qty</strong>&nbsp;</td>
    <td class="text style1 style5 style21" align="right"><strong>Plan Qty</strong>&nbsp;</td>
    <td class="text style1 style5 style21" align="right"><strong>Steps</strong>&nbsp;</td>
    <td width="92" align="right" class="text style1 style5 style21"><strong>Total Steps</strong>&nbsp;</td>
    <td width="91" align="right" class="text style1 style5 style21"><strong>Req By</strong>&nbsp;</td>
    <td width="93" align="right" class="text style1 style5 style21"><strong>Total Req</strong>&nbsp;</td>
   
    <td width="101" align="center" class="text style1 style5 style3 style21"><strong>Action</strong></td>
 </tr>
   <?php
    $jobcard_no_get=$_GET['jobcard_no'];
    $jobcard_no_post=$_POST['jobcard_no'];
    $sql="select * from  media_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'];
				$roll_name=$rsdata['roll_name'];
				$entrydates=$rsdata['entrydates'];
				$media_date=$rsdata['media_date'];
   				$media_particular=$rsdata['media_particular'];
				$order_qty=$rsdata['order_qty'];
				$plan_qty=$rsdata['plan_qty'];
				$steps=$rsdata['steps'];
				$total_steps=$rsdata['total_steps'];
				$req_by=$rsdata['req_by'];
				$tot_req_by=$rsdata['tot_req_by'];
				$roll_size=$rsdata['roll_size'];
				$width=$rsdata['width'];
				$height=$rsdata['height'];
				
				$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 align="center" class="text style4  style5"><?php echo $sno; ?></td>
      <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;&nbsp;<?php echo date('d-m-Y H:i',strtotime($media_date));?></td>
      <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;<?php echo $roll_name;?></td>
      <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;&nbsp;<?php echo $roll_size;?></td>
            <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;<?php echo $media_particular;?></td>
 <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;<?php echo $width;?></td>
  <td align="left" class="text style5 style4" style="padding-left:2px;">&nbsp;<?php echo $height;?></td>
      <td align="right" class="text style5 style4"><?php echo $order_qty;?>&nbsp;&nbsp;</td>
      <td align="right" class="text style5 style4"><?php echo $plan_qty;?>&nbsp;&nbsp;</td>
      <td align="right" class="text style5 style4"><?php echo $steps;?>&nbsp;&nbsp;</td>
      <td align="right" class="text style5 style4"><?php echo $total_steps;?>&nbsp;&nbsp;</td>
      <td align="right" class="text style5 style4"><?php echo $req_by;?>&nbsp;&nbsp;</td>
      <td align="right" class="text style5 style4"><?php echo $tot_req_by;?>&nbsp;&nbsp;</td>
   
      
      <?php if(($user_id=='1')||($user_id=='3'))
	 { 
	 ?> <td align="center" class="style5 style3 style4" ><img src="img/cross-small.png"  title="Delete" onClick="delete_sublist_media('<?php echo $id;?>','<?php echo $jobcard_no; ?>')" width="20px" height="20px"></td><?php } ?>
</tr>
<?php 
$media_qtys+=$media_qty;
} 
?>
<tr>
    <td  class="text style4 style5"><?php echo $sno+1; ?></td>
    <td  align="left" class="text style4 style5" ><input type="datetime-local" name="entrydates" id="entrydates" readonly  tabindex="3" value="<?php if($edit_ids!='') { echo $entrydates; } else{ echo date('Y-m-d').'T'.date('H:i'); } ?>" style="height:28px; width:100%;"class="types_class1" onkeypress="enterevent(event,'media_particular','entrydates')" /></td>
    <td align="left" class="text style4 style5" ><select name="roll_name" onChange="get_roll_size(this.value)"  id="roll_name"  tabindex="4"  style="width:100%; height:30px;">
     <option value="">Select</option><?php error_reporting(0);
 include("../../include/db.php");
	$sql_user="select * from  roll_size_creation ";
		$rs_user=mysql_query($sql_user);
			while($rsdata_user=mysql_fetch_object($rs_user))
			{ 
			$id=$rsdata_user->id;
			$roll_size_name=$rsdata_user->roll_size_name;
			?>
<option value="<?php  echo $roll_size_name; ?>"><?php echo $roll_size_name;?></option><?php } ?></select></td>
  <td align="left" class="text style4 style5" ><input name="roll_size"  id="roll_size"   tabindex="4" value="<?php  ?>"  style=" height:25px; width:100px;">
   
</td>
    <td align="left" class="text style4 style5"><div id="media_partic_divs"><select name="media_particular"  id="media_particular"  tabindex="4"  onchange="get_qty_sub_media(in_jobcard_no_media.value,media_particular.value)"  style=" height:30px; width:100%;">
      <?php if($edit_ids!=''){ ?>
      <option value="<?php if($edit_ids!=''){ echo $media_particulars; } else {  }?>"><?php if($edit_ids!=''){ echo $media_particulars; } else {  }?></option>    <?php } ?>
    </select></div></td>
        <td  class="text style4 style5"><input type="text" class="types_class1" name="width1" id="width1"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" onKeyUp="get_mtrs_width(this.value)"  style=" height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $width; } else {  }?>" /><input type="hidden" name="width_hid" id="width_hid" value="<?php echo $width_hid; ?>"></td>

    <td  class="text style4 style5"><input type="text" class="types_class1" name="height1" id="height1"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" onKeyUp="get_mtrs_height(this.value)"  style="height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $order_qty_edit; } else {  }?>" /><input type="hidden" name="height_hid" id="height_hid" value="<?php echo $width_hid; ?>"></td>

    <td  class="text style4 style5"><div id="qty_sub_divs"><input type="text" class="types_class1" name="order_qty" id="order_qty"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false"  style="height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $order_qty_edit; } else {  }?>" /></div></td>
  <td width="76"  class="text style4 style5"><input type="text" class="types_class1" name="plan_qty" id="plan_qty"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false"  style="height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $plan_qty_edit; } else {  }?>" /></td>
  <td width="92"  class="text style4 style5"><input type="text" class="types_class1" name="steps" id="steps" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false" onKeyUp="get_tot_steps(plan_qty.value,this.value)"   style=" height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $steps_edit; } else {  }?>" onClick="get_divide_value1(this.value,plan_qty.value);" /></td>
  <td  class="text style4 style5"><input type="text" class="types_class1" name="total_steps" id="total_steps" onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false"  style=" height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $total_steps_edit; } else {  }?>" /></td>
  <td  class="text style4 style5"><select name="req_by"  id="req_by"  tabindex="4"  style="height:30px; width:100%;" onChange="get_tot_req(this.value,width_hid.value,height_hid.value,total_steps.value)">
     <option value="">select</option>
     <option value="Width">Width</option>
      <option value="Height">Height</option>
</select></td>

		
  <td  class="text style4 style5"><input type="text" class="types_class1" name="total_req" id="total_req"  onKeyPress="if ((event.keyCode &lt; 46) || (event.keyCode &gt; 57)) event.returnValue = false"  style=" height:30px; width:100%;" value="<?php if($edit_ids!=''){ echo $request_mtr_edit; } else {  }?>" /></td>
  
<td class="text style4 style5"><input type="button" name="add" id="add" tabindex="6" value="<?php if($edit_ids!='') { echo "EDIT"; } else { echo "ADD"; } ?>"  style="height:30px; width:100%;" onClick="media_sublist(in_jobcard_no_media.value,in_cust_name.value,media_date.value,roll_name.value,media_particular.value,order_qty.value,plan_qty.value,steps.value,total_steps.value,req_by.value,total_req.value,roll_size.value,width1.value,fabric_type.value,created_by.value,job_types.value,entrydates.value,height1.value,width_hid.value,height_hid.value,'<?php echo $edit_ids;?> ',this.value),enterevent(event,'submit','add');"></td>
  </tr>
  <tr>
  <td></td> 
  <td colspan="2"></td> 
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
  <tr height="100px">
  <td></td> 
  <td></td> 
  <td></td>
  <td></td>
  <td></td>
  <td></td>
 </tr>
</table>
</div>