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

<p align="center"><strong><h2 align="center">View Inprocess Audit For Die Punching</h2></strong></p>
<br>
<p align="center"><strong>Branch:</strong>
	 <?php
	
 		$sql ="SELECT loccode, locationname FROM locations where loccode='".$rowdata['branch_id']."'";
	 	$resultStkLocs = DB_query($sql,$db);
		?>
	<select name="site" style="width:100px" onchange="getdata(this.value);" >
	      <?php    
			while ($myrow=DB_fetch_array($resultStkLocs))
				{
				?>
      <option value="<?php echo $myrow['loccode']; ?>"><?php echo $myrow['locationname'];?></option>
      <?php  }	?> 
    </select></p>
   
<p align="left"><strong>General Details</strong></p>
<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%" cellpadding="2" cellspacing="1" border="0">
            	<tr>
                 <th align="left" width="24%"><strong>Dia Punching Slip. No</strong></th>
                    <td width="27%" id="hotfoil"><input type="text"  name="lamination_slip" id="lamination_slip" style="width:100%" value="<?php echo $rowdata['die_punching_slip']; ?> " >                    	
                    	</td>
                    	<th align="left" width="20%"><strong>Date</strong></th>
                     <td><input type="text" id="date" name="date" style="width:100%;" value="<?php echo $rowdata['date']; ?> "/>
                     </td>
      </tr>
            	<tr>
                 <th align="left" width="24%"><strong>Job Card  No.</strong></th>
                    <td width="27%" 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>
                    	<th align="left" width="20%"><strong>Item Name..</strong></th>
                     <td><input type="text" id="item" name="item" style="width:100%;" value="<?php echo $rowdata['item_name']; ?> "/>
                     </td>
      </tr>
            	<tr>
                 <th align="left" width="24%"><strong>Customer</strong></th>
                    <td width="27%" id="vouchar"><input type="text" name="customer_name" style="width:100%;" id="customer_name" value="<?php echo $rowdata['customer_name']; ?> "/></td>
                    	<th align="left" width="20%"><strong>Shift</strong></th>
                     <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:100%; margin:0 auto;">
            <table width="100%" cellpadding="2" cellspacing="1" border="0">
            	 <tr>
        <th align="left" width="24%"><strong>Machine</strong></th>
        <td width="27%" id="vouchar"><input type="text" name="machine" id="machine" style="width:100%" value="<?php echo $rowdata['machine']; ?> ">
                     	
        	
        	
        	</td>
     
        <th align="left" width="20%"><strong>Operator</strong></th>
        <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><p align="left"><strong> INITIAL CHECK POINT </strong></p>
                    <table width="100%" cellpadding="2" cellspacing="1" border="0">
                 <tr>
        <th align="left" width="40%" ><strong>Positioning Register of the punched sheet is as per the die-tracting</strong></th>
        <td><table width="100%" border="0">
        	
                    <tr><td width="65%">&nbsp;</td><th width="5%">Yes</th>
                    	<td width="15%"><input type="radio" name="punched_sheed" value="Yes" <?php if($rowdata['punched_sheed']=='Yes'){ ?>checked="checked" <?php }?>/></td>
                    	<th width="10%">No</th>
                    	<td width="15%"><input type="radio" name="punched_sheed" value="No" <?php if($rowdata['punched_sheed']=='No'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
     </tr>
     <tr>
        <th align="left" width="40%"><strong>Finished size of all ups as per party specifications size(4.1mm)</strong></th>
        <td><table width="100%" border="0">
                    <tr><td width="65%">&nbsp;</td><th width="5%">Yes</th>
                    	<td width="15%"><input type="radio" name="finished_size" value="Yes" <?php if($rowdata['finished_size']=='Yes'){ ?>checked="checked" <?php }?>/></td>
                    	<th width="10%">No</th><td width="15%"><input type="radio" name="finished_size" value="No" <?php if($rowdata['finished_size']=='No'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
      </tr>
       <tr>
        <th align="left" width="40%"><strong>Embossing should be ok as per key time. if embossing  in the job(0.5mm)</strong></th>
        <td><table width="100%" border="0">
                    <tr><td width="65%">&nbsp;</td><th width="5%">Yes</th><td width="15%"><input type="radio" name="embossing" value="Ok" <?php if($rowdata['embossing']=='Ok'){ ?>checked="checked" <?php }?> /></td>
                    	<th width="10%">No</th><td width="15%"><input type="radio" name="embossing" value="NotOk" <?php if($rowdata['embossing']=='NotOk'){ ?>checked="checked" <?php }?>/></td></tr>	
                               	
                    </table></td>
      </tr>
     
                    
                 </table></td></tr>
                                 
                <tr><td>&nbsp;</td></tr>
                <tr><td> <p align="center"><strong>Check Point Details</strong></p>
               <?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%" cellpadding="2" cellspacing="1" border="1" align="center" >
            <tr>
           <th>Sr. No</th> 	
          <th width="24%" align="left" class="text">Check Point</th>
          <th width="27%" align="center" valign="top"><center>Observations</center></th>          
          <th  align="left" width="65%"><center>Remarks</center></th>
          <td align="left" valign="top"></td>
          </tr>  
           <tr>
           	<td>1</td>
          	<td><strong>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 width="65%"><textarea style="width:100%" name="punching_remarks"><?php echo $rowcheck['punching_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>2</td>
          	<td><strong>Half cut & full cut should be proper</strong></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 width="65%"><textarea style="width:100%" name="halfcut_remarks"></textarea></td>
          </tr>     
          <tr>
          	<td>3</td>
          	<td><strong>Embossing should be proper (not checking on the edge1)</strong></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 width="65%"><textarea style="width:100%" name="embossing_remarks"><?php echo $rowcheck['embossing_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>4</td>
          	<td><strong>Rough cutting at cutting area</strong></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 width="65%"><textarea style="width:100%" name="rough_cutting_remarks"><?php echo $rowcheck['rough_cutting_remarks']; ?></textarea></td>
          </tr>     
          <tr>
          	<td>5</td>
          	<td><strong>Perforation cut is good not too deep & to shadow</strong></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 width="65%"><textarea style="width:100%" name="perforation_remarks"><?php echo $rowcheck['perforation_remarks']; ?></textarea></td>
          </tr>     
           <tr>
           	<td>6</td>
          	<td><strong>Deep Punch</strong></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 width="65%"><textarea style="width:100%" name="deep_remarks"><?php echo $rowcheck['deep_remarks']; ?></textarea></td>
          </tr>  
           <tr>
           	<td>7</td>
          	<td><strong>Dia Punching Process</strong></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 width="65%"><textarea style="width:100%" name="dia_punching_remarks"><?php echo $rowcheck['dia_punching_remarks']; ?></textarea></td>
          </tr>  
          
                </table></td></tr>
                 <tr><td><table width="100%" cellpadding="2" cellspacing="1" border="0">
                <tr>
                 <th align="left" colspan="2" width="25%"><strong>Remarks</strong></th>
                    <td colspan="2" width="75%"><textarea name="remarks1" style="width:100%" ><?php echo $rowdata['remarks']; ?></textarea>
                    	</td>
                   
                </tr> </table></td></tr>
             <tr><td> <table width="100%" cellpadding="2" cellspacing="1" border="0">
                <tr>
                 <th align="left"  width="25%"><strong>Created By</strong></th>
                    <td  ><input type="text" name="created" style="width:100%" value="<?php echo $rowdata['created_by']; ?>">
                    	</td>
				     <th>Approved By QA Head</th><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>
						