<link rel="stylesheet" href="css/new_mxerp.css">
<?php
$rowdata=DB_query("select * from job_production_card where id='".$_REQUEST['Id']."'",$db);
$data1=DB_fetch_array($rowdata);
?>


<div class="body_contain">
<div class="tab_div">


<h1>View Production Planning  Against Job Card</h1>

<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
<td class="tabledata" style="width:120px;">Branch</td>

<td>
<?php
	
 		$sql = 'SELECT loccode, locationname FROM locations';
	 	$resultStkLocs = DB_query($sql,$db);
		?>
	<select name="site" style="width:100%">
	      <?php    
			while ($myrow=DB_fetch_array($resultStkLocs))
				{
					$k='';
					if($myrow['loccode']==$data['branch_id'])
					{
					$k="selected";	
					}
				?>
      <option value="<?php echo $myrow['loccode']; ?>"<?php echo $k; ?>><?php echo $myrow['locationname'];?></option>
      <?php  }	?> 
    </select></td>

</table>

 
<form action="" method="post" enctype="multipart/form-data">
<table width="100%" cellpadding="0" cellspacing="0" border="0"
       align="center">
    <tr>
        <td nowrap="nowrap" colspan="2" valign="top">
        <div id="enquiryId" style="width:100%; margin:0 auto;">
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
            	
            	<tr>
                 <td class="tabledata" style="width:120px">V. No</td>
                    <td id="vouchar" style="width:261px;"><input type="text" name="vouchar_no" style="width:100%;" id="vouchar_no" value="<?php echo $data1['vouchar_no']; ?>"/></td>
                    	<td class="tabledata">Job Card No</td>
                     <td><select  name="job_ticket" id="job_ticket" style="width:100%" >
                    	                    	<?php
                    	$sql=DB_query("select * from job_route_card",$db);
						while($row=DB_fetch_array($sql))
						{
							$j='';
							if($row['id']==$data1['job_card_id'])
							{
							$j="selected";	
							} 
                    	?>
                    	<option value="<?php echo $row['id']; ?>"<?php echo $j; ?>><?php echo $row['job_card_no']; ?></option>
                    	<?php } ?></select>
                     </td>
                    
      </tr></table></div></td>
      </tr>
      
                <tr>
                  	
                  	
    <td valign="top">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td colspan="4" id="quoteId">
     
        <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" >
    <tr>
        <td nowrap="nowrap" colspan="2" valign="top">
        <div id="enquiryId" style="width:810px;">
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
                <tr>
                 <td class="tabledata" style="width:120px;">Job Card Date	</td>
                    <td><input type="text" name="job_date" id="job_date"  size="6"  style="width:100%;" value="<?php echo $data1['job_card_date']; ?>">
                    	</td>
                    <td class="tabledata">W/O No.</td>
                     <td><input type="text"  style="width:100%;" name="wo_no" id="wo_no" value="<?php echo $data1['sop_no']; ?>">
                     </td>
                  </tr><tr>
                  	<td class="tabledata">Party Name</td>
                    <td><input type="text" name="party_name" id="party_name" style="width:100%;" value="<?php echo $data1['party_name']; ?>"/>
                    	</td>
                      <td class="tabledata">Item Name</td>
                     <td><input type="text"  style="width:100%;" name="item_name1" id="item_name1" value="<?php echo $data1['item_name']; ?>">
                     </td></tr> 
                     <tr>
                  	<td class="tabledata">Order Qty</td>
                    <td colspan="3"><input type="text" name="order_qty" id="order_qty" style="width:100%;" value="<?php echo $data1['order_qty']; ?>"/>
                    	</td></tr>    
                 </table></div>
       
        </td>
        </tr>
    </table></td></tr></table>
    <p align="left"> Production Planning Parameter Against Job Card No: </p>
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
                <tr>     <td class="tabledata"  style="width:120px;">Production/Print Date</td>
                    <td><input type="text" name="print_date" id="print_date"  class="datepicker" value="<?php echo $data1['production_print_date']; ?>"  style="width:100%">
                    	</td>
                    <td class="tabledata" style="width:120px;">Production Shift</td>
                     <td><select name="production_shift" style="width:100%">
                           	<?php
                     	$data=DB_query("select * from production_shift",$db);
                     	while($row=DB_fetch_array($data))
						{
							$t='';
							if($row['id']==$data1['production_shift'])
							{
								$t="selected";
							}
                     	 ?>
                     	<option value="<?php echo $row['id']; ?>" <?php echo $t; ?>><?php echo $row['shift_name']; ?></option>
                     	<?php } ?>
                     </select></td>
                     	  <td class="tabledata" style="white-space:nowrap">Production Qty</td>
                     <td><input type="text"   name="prod_qty" id="prod_qty"   value="<?php echo $data1['production_qty']; ?>"  style="width:100%">
                     </td>
                  </tr>
				  <tr>
                  	<td class="tabledata">Start Time</td>
                    <td><input type="text" name="startdate" id="startdate" value="<?php echo $data1['start_date'];?>"  style="width:50%"  class="datepicker"  />
                    	 <input type="text" name="starttime" id="starttime" value="<?php echo $data1['start_time'];?>"  style="width:35%" />
                    	</td>
                      <td class="tabledata">End Time</td>
                     <td><input type="text" name="enddate" id="enddate" value="<?php echo $data1['enddate'];?>"  style="width:50%" class="datepicker" /> 
                     	<input type="text" name="endTime" id="endTime" value="<?php echo $data1['end_time'];?>" style="width:35%" />
                     
                  	<td class="tabledata">Total Hrs</td>
                    <td><input type="text" name="total_hrs" id="total_hrs" style="width:100%"  value="<?php echo $data1['total_hrs']; ?>"/>
                    	
                     </td></tr>   
                     <tr>
                  	<td class="tabledata">Machine Center</td>
                    <td><select name="machine" style="width:100%"><option value="0">Select</option>
                    	<?php
                    	$machine=DB_query("select * from machine_center",$db);
                    	while($machine_data=DB_fetch_array($machine))
						{
							$m='';
							if($machine_data['id']==$data1['machine_center'])
							{
							$m="selected";	
							}
                    	?>
                    	<option value="<?php echo $machine_data['id']; ?>" <?php echo $m; ?>><?php echo $machine_data['code']; ?></option>
                    	<?php } ?>
                    	
                    </select>
                    	</td>
                      <td class="tabledata">Process</td>
                     <td><select name="process" id="process" style="width:100%">
                     	<?php
                    	$machine1=DB_query("select * from production_process_master",$db);
                    	while($machine_data1=DB_fetch_array($machine1))
						{
							$p='';
							if($machine_data1['id']==$data1['process'])
							{
								$p="selected";
							}
                    	?>
                    	<option value="<?php echo $machine_data1['id']; ?>"<?php echo $p; ?>><?php echo $machine_data1['manuf_process_name']; ?></option>
                    	<?php } ?>
						
						</select></td>
                     
                  	<td class="tabledata">Raw Mat. To Be Consumed.</td>
                    <td><select name="raw_mat" style="width:100%">
                    <option value="As_per_Store">As per Store</option>                  	
                    	
                    	
                    </select>
                    	
                     </td></tr>  
                      <tr>
                  	<td class="tabledata">Rejection allowed %</td>
                    <td><input type="text" name="rejection_allowed" id="rejection_allowed" value="<?php echo $data1['rejection_allow']; ?>" style="width:100%">
                    	</td>
                      <td class="tabledata">After Rejection Qty</td>
                     <td colspan="3"><input type="text"  name="rejqty" id="rejqty" onfocus="percentage()" value="<?php echo $data1['rejqty']; ?>"  style="width:100%" /></td>                     </tr>  
                 </table>
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
                <tr>
                 <td class="tabledata" style="width:120px;">Remarks</td>
                    <td colspan="3"><textarea name="remarks" style="width:100%"><?php echo $data1['remarks']; ?></textarea>
                    	</td>
                   
                  </tr> </table>
<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse; border:#999999 solid 1px;">
                <tr>
                 <td class="tabledata" style="width:120px;">Created By</td>
                    <td ><input type="text" name="created" style="width:100%" value="<?php echo $data1['created_by']; ?>">
                    	
                    	</td>
				     <td class="tabledata">Approved By PPC Head</td><td><select name="approved"  style="width:100%">
					<option value="0">Select</option>
					<option value="Yes"<?php if($data1['approved_ppc']=='Yes') { ?> selected="selected" <?php } ?>>Yes</option>
	<option value="No" <?php if($data1['approved_ppc']=='No') { ?> selected="selected" <?php } ?>>No</option>
	<option value="Pending" <?php if($data1['approved_ppc']=='Pending') { ?> selected="selected" <?php } ?>>Pending</option>
					</select></td></tr>

				     </table></td></tr></table>

</form>

</div></div>

				  
					