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


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

<h1>View Inprocess Audit For Die Punching</h1>

<table width="100%" border="1" cellpadding="3" cellspacing="0"
       style="border-collapse:collapse; border:#666666 solid 1px;">
   <tr><td class="tabledata" style="width:146px;">Branch:</td>
      <td>
	 <?php
	
 		$sql ="SELECT loccode, locationname FROM locations where loccode='".$rowdata['branch_id']."'";
	 	$resultStkLocs = DB_query($sql,$db);
		?>
	<select name="site" style="width:100%" onchange="getdata(this.value);" >
	      <?php    
			while ($myrow=DB_fetch_array($resultStkLocs))
				{
				?>
      <option value="<?php echo $myrow['loccode']; ?>"><?php echo $myrow['locationname'];?></option>
      <?php  }	?> 
    </select></td>
 </tr>
 </table>
   
<h3>General Details</h3>
<table cellpadding="0" cellspacing="0" border="1" align="center">
    <tr>
        <td nowrap="nowrap" colspan="2" width="50%" valign="top">
        <div id="enquiryId" style="width:100%; margin:0 auto;">
	   <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
            	<tr>
                 <td class="tabledata" style="width:146px">Dia Punching Slip. No</td>
                    <td id="hotfoil"><input type="text"  name="lamination_slip" id="lamination_slip" style="width:100%" value="<?php echo $rowdata['die_punching_slip']; ?> " >                    	
                    	</td>
                    	<td class="tabledata">Date</td>
                     <td><input type="text" id="date" name="date" style="width:100%;" value="<?php echo $rowdata['date']; ?> "/>
                     </td>
      </tr>
            	<tr>
                 <td class="tabledata">Job Card  No.</td>
                    <td id="vouchar"><select  name="job_ticket" id="job_ticket" style="width:100%"  >
                    	
                    	<?php
                    	$sql=DB_query("select * from job_route_card where id='".$rowdata['job_card_id']."'",$db);
						while($row=DB_fetch_array($sql))
						{ 
                    	?>
                    	<option value="<?php echo $row['id']; ?>"><?php echo $row['job_card_no']; ?></option>
                    	<?php } ?></select>                   	
                    	
                    	</td>
                    	<td class="tabledata">Item Name..</td>
                     <td><input type="text" id="item" name="item" style="width:100%;" value="<?php echo $rowdata['item_name']; ?> "/>
                     </td>
      </tr>
            	<tr>
                 <td class="tabledata">Customer</td>
                    <td id="vouchar"><input type="text" name="customer_name" style="width:100%;" id="customer_name" value="<?php echo $rowdata['customer_name']; ?> "/></td>
                    	<td class="tabledata">Shift</td>
                     <td><input type="text" name="shift" style="width:100%" id="shift" value="<?php echo $rowdata['shift']; ?> ">            	                 	
                       	
                     </td>
       </tr>
      </table></div></td>
      </tr> 
   
    <tr>
        <td nowrap="nowrap" colspan="2" width="50%" valign="top">
        <div id="enquiryId" style="width:810px;">
	   <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
            	 <tr>
        <td class="tabledata" style="width:146px">Machine</td>
        <td id="vouchar" style="width:246px"><input type="text" name="machine" id="machine" style="width:100%" value="<?php echo $rowdata['machine']; ?> ">
                     	
        	
        	
        	</td>
     
        <td class="tabledata" style="width:136px">Operator</td>
        <td  id="vouchar"><input type="text" name="operator" style="width:100%" id="operator" value="<?php echo $rowdata['operator']; ?> ">
                     	
        	
        	
        	</td>
      </tr>
      
      </table></div></td>
      </tr> 
      <tr><td>&nbsp;</td></tr>
   
   <tr><td><h3>Initial Check Point</h3>
      <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
                 <tr>
        <td class="tabledata">Positioning Register of the punched sheet is as per the die-tracting</td>
        <td><table width="100%" border="0">
        	
                    <tr><td class="tabledata">Yes</td>
                    	<td><input type="radio" name="punched_sheed" value="Yes" <?php if($rowdata['punched_sheed']=='Yes'){ ?>checked="checked" <?php }?>/></td>
                    	<td class="tabledata">No</td>
                    	<td><input type="radio" name="punched_sheed" value="No" <?php if($rowdata['punched_sheed']=='No'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
     </tr>
     <tr>
        <td class="tabledata">Finished size of all ups as per party specifications size(4.1mm)</td>
        <td><table width="100%" border="0">
                    <tr><td class="tabledata">Yes</td>
                    	<td><input type="radio" name="finished_size" value="Yes" <?php if($rowdata['finished_size']=='Yes'){ ?>checked="checked" <?php }?>/></td>
                    	<td class="tabledata">No</td><td><input type="radio" name="finished_size" value="No" <?php if($rowdata['finished_size']=='No'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
      </tr>
       <tr>
        <td class="tabledata">Embossing should be ok as per key time. if embossing  in the job(0.5mm)</td>
        <td><table width="100%" border="0">
                    <tr><td class="tabledata">Yes</td><td><input type="radio" name="embossing" value="Ok" <?php if($rowdata['embossing']=='Ok'){ ?>checked="checked" <?php }?> /></td>
                    	<td class="tabledata">No</td><td><input type="radio" name="embossing" value="NotOk" <?php if($rowdata['embossing']=='NotOk'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
      </tr>
     
                    
                 </table></td></tr>
                                 
                <tr></tr>
                <tr><td> <h3>Check Point Details</h3>
               <?php
                 $row1=DB_query("select * from tbl_inprocess_die_punching_details where parent_id='".$_REQUEST['Id']."'",$db);
				 $rowcheck=DB_fetch_array($row1);
                 
                 ?>  
                 
		 <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
            <tr>
           <td class="tabledata">Sr. No</td> 	
          <td class="tabledata">Check Point</td>
          <td class="tabledata" align="center" valign="top"><center>Observations</center></td>          
          <td class="tabledata"><center>Remarks</center></td>
          </tr>  
           <tr>
           	<td>1</td>
          	<td>Punching Out</stong></td><td>
          	<table border="0">
          	<tr><td><input type="text" class="datepicker" name="punching_date" value="<?php echo $rowcheck['punching_date']; ?>" /></td>
          	<td><input type="text"  name="punching_time" value="<?php echo $rowcheck['punching_time']; ?>" /></td>
          	<td><select name="punching_period" id="punching_period" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['punching_period']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['punching_period']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>	
          	</td><td><textarea style="width:100%;height:25px;" name="punching_remarks"><?php echo $rowcheck['punching_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>2</td>
          	<td>Half cut & full cut should be proper</td><td>
          	<table border="0">
          	<tr><td><input type="text" class="datepicker" name="halfcut_date" value="<?php echo $rowcheck['halfcut_date']; ?>"/></td>
          		<td><input type="text"  name="halfcut_time" value="<?php echo $rowcheck['halfcut_time']; ?>"/></td>
          	<td><select name="start_AMPM_period" id="start_AMPM_period" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_period']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_period']=='PM'?'selected':'')?>>PM</option>
	 </select></td>	
          		
          	</tr>	
          	</table>	
          	</td><td><textarea style="width:100%;height:25px;" name="halfcut_remarks"></textarea></td>
          </tr>     
          <tr>
          	<td>3</td>
          	<td>Embossing should be proper (not checking on the edge1)</td><td>
          	<table border="0">
          		
          	<tr><td><input type="text" class="datepicker" name="embossing" value="<?php echo $rowcheck['embossing']; ?>"/></td>
          		<td><input type="text" name="embossing_time" value="<?php echo $rowcheck['embossing_time']; ?>" /></td>
          		<td><select name="start_AMPM_embossing" id="start_AMPM_wrinkless" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_embossing']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_embossing']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>	
          		
          	</td><td><textarea style="width:100%;height:25px;" name="embossing_remarks"><?php echo $rowcheck['embossing_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>4</td>
          	<td>Rough cutting at cutting area</td><td>
          	<table border="0">
          	<tr><td><input type="text" class="datepicker"  name="rough_cutting_date" value="<?php echo $rowcheck['rough_cutting_date']; ?>"/></td>
          		<td><input type="text"  name="rough_cutting_time" value="<?php echo $rowcheck['rough_cutting_time']; ?>" /></td>
          		<td><select name="start_AMPM_rough_cutting" id="start_AMPM_rough_cutting" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_rough_cutting']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_rough_cutting']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>	
          	</td><td><textarea style="width:100%;height:25px;" name="rough_cutting_remarks"><?php echo $rowcheck['rough_cutting_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>5</td>
          	<td>Perforation cut is good not too deep & to shadow</td><td>
          	<table border="0">
          		
          	<tr><td><input type="text" class="datepicker" name="preforation_date" value="<?php echo $rowcheck['preforation_date']; ?>"/></td>
          		<td><input type="text"  name="preforation_time" value="<?php echo $rowcheck['preforation_time']; ?>" /></td>
          		<td><select name="start_AMPM_preforation" id="start_AMPM_preforation" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_preforation']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_preforation']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>
          	</td><td><textarea style="width:100%;height:25px;" name="perforation_remarks"><?php echo $rowcheck['perforation_remarks']; ?></textarea></td>
          </tr>     
           <tr>
           	<td>6</td>
          	<td>Deep Punch</td><td>
          	<table border="0">
          		
          	<tr><td><input type="text" class="datepicker" name="deep_date" value="<?php echo $rowcheck['deep_date']; ?>"/></td>
          		<td><input type="text"  name="deep_time" value="<?php echo $rowcheck['deep_time']; ?>" /></td>
          		<td><select name="start_AMPM_deep" id="start_AMPM_deep" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_deep']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_deep']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>
          	</td><td><textarea style="width:100%;height:25px;" name="deep_remarks"><?php echo $rowcheck['deep_remarks']; ?></textarea></td>
          </tr>  
           <tr>
           	<td>7</td>
          	<td>Dia Punching Process</td><td>
          	<table border="0">
          		
          	<tr><td><input type="text" class="datepicker" name="dia_punching_date" value="<?php echo $rowcheck['dia_punching_date']; ?>"/></td>
          		<td><input type="text"  name="dia_punching_time" value="<?php echo $rowcheck['dia_punching_time']; ?>" /></td>
          		<td><select name="start_AMPM_dia_punching" id="start_AMPM_dia_punching" style="width:40px">
	 <option value="AM"<?php echo ($rowcheck['start_AMPM_dia_punching']=='AM'?'selected':'')?>>AM</option>
	 <option value="PM"<?php echo ($rowcheck['start_AMPM_dia_punching']=='PM'?'selected':'')?>>PM</option>
	 </select></td>
          	</tr>	
          	</table>
          	</td><td><textarea style="width:100%;height:25px;" name="dia_punching_remarks"><?php echo $rowcheck['dia_punching_remarks']; ?></textarea></td>
          </tr>  
          
                </table></td></tr>
                 <tr><td><table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
                <tr>
                 <td class="tabledata" style="width:146px">Remarks</td>
                    <td colspan="3"><textarea name="remarks1" style="width:100%" ><?php echo $rowdata['remarks']; ?></textarea>
                    	</td>
                   
                </tr> </table></td></tr>
             <tr><td><table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
                <tr>
                 <td class="tabledata" style="width:146px">Created By</td>
                    <td><input type="text" name="created" style="width:100%" value="<?php echo $rowdata['created_by']; ?>">
                    	</td>
				     <td class="tabledata">Approved By QA Head</td><td><select name="approved"  style="width:100%">
					
				<option value="Yes"<?php if($rowcheck['approved_by']=='Yes') { ?> selected="selected" <?php } ?>>Yes</option>
	<option value="No" <?php if($rowcheck['approved_by']=='No') { ?> selected="selected" <?php } ?>>No</option>
	<option value="Pending" <?php if($rowcheck['approved_by']=='Pending') { ?> selected="selected" <?php } ?>>Pending</option>
					</select></td></tr>
										</table></td></tr></table>
						