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

?>

<table width="100%"	border="0" cellspacing="0" cellpadding="0">
	<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">

 <tr><td><h3 align="center">View Material Requirement Slip Against Job Card </h3></td></tr>
	<tr><td>&nbsp;</td></tr>
    <tr>
        <td>
        <table width="85%" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#ffffff" style="border:1px solid #ccc;" height="55%" >
        <tr>
            <td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                  <tr>
                    <th width="24%" align="left"><strong>Job Ticket No</strong></th>
                    <td width="27%"><select  name="job_ticket" id="job_ticket" style="width:100%"  >
                    	
                    	<?php
                    	
                    	$sql=DB_query("select * from job_route_card where id='".$row['job_card_id']."'",$db);
						while($row1=DB_fetch_array($sql))
						{ 
                    	?>
                    	<option value="<?php echo $row1['id']; ?>"><?php echo $row1['job_card_no']; ?></option>
                    	<?php } ?></select>
                      			</td>
                      			            			
                      			
                      			<th width="23%" align="left"><strong>  Job Card Date</strong></th>
                    <td width="27%" align="left" id="job_date1"><input type="text" name="job_date" id="job_date"  size="6"  style="width:100%;" value="<?php echo $row['job_card_data']; ?>">
                    	
                    	     	
                    	</td>
                   
                    </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" 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"><strong>W/O No</strong></th>
                    <td><input type="text" name="wo_no" id="wo_no" style="width:100%;" value="<?php echo $row['sop_no']; ?>"/></td>
                    <th align="left"><strong>Item Name</strong></th>
                    <?php
                    $itemdata1=$s->getField('item_master','StockID',$row['item_name'],'item_name');
                    
                    
                     ?>
                    
                     <td><input type="text"  style="width:100%;" name="item_name1" id="item_name1" value="<?php echo $itemdata1; ?>" >
                     </td>
                  </tr><tr>
                  	<th width="24%" align="left"><strong>No of Ups</strong></th>
                    <td width="27%"><input type="text" name="no_ups" id="no_ups" style="width:100%;" value="<?php echo $row['no_ups']; ?>"/></td>
                                        <th align="left"><strong>Teeth</strong></th>
                     <td><input type="text"  style="width:100%;" name="teeth" id="teeth" value="<?php echo $row['teeth']; ?>" >
                     </td></tr>    
                     <tr>
                  	<th width="24%" align="left"><strong>Order Qty</strong></th>
                    <td width="27%"><input type="text" name="order_qty" id="order_qty" style="width:100%;" value="<?php echo $row['order_qty']; ?>"/></td>
                                        <th align="left"><strong>Process Name</strong></th>
                     <td><input type="text"  style="width:100%;" name="process_name" id="process_name"  value="<?php echo $row['process_name']; ?>">
                     </td></tr>                
                  
                 </table>
         </div>
        </td>
        </tr>
    </table>
    
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr><td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" >
                  <tr>
                     <th width="24%" align="left"><strong>Mat-Slip No</strong></th>
                     <td  width="27%"><input type="text" name="mat_slip_no" id="mat_slip_no" style="width:100%" value="<?php echo $row['mat_slip_no']; ?>">
                     </td>
                     <td align="left" width="23%"></td>
                    <td width="27%" align="left"></td>
                  </tr></table></div></td></tr>
    </table>
    </td>
    </tr>
    
    
    </table></td></tr>
    
	<tr><td>
    <p align="left"><strong>Raw  Material Details For Job Card No:- </strong></p>
    
     <div align="center"><div style="overflow: auto; width: 1000px; height: 150px;">
      	     <table width="1000px" border="0" cellspacing="2" cellpadding="2" >
              <tr>
                <th align="center"><strong>S.No</strong></th>
               	<th align="center" ><strong>Item Code </strong></th>
                <th align="center" width="25%"><strong>Item Name </strong></th>
				 <th align="center"><strong>Unit</strong></th>
				<th align="center"><strong> Group </strong></th>
                <th align="center"><strong>Make</strong></th>
                <th align="center"><strong>Grade</strong></th>
                <th align="center"><strong>Gsm</strong></th>
                <th align="center"><strong>Size</strong></th>
                <th align="center"><strong>Total Req Qty</strong></th>
                </tr>
                 <tbody id="dataTable">
			  <?php 
			  $i=1;
			  
			  $itemdata=DB_query("select * from material_job_item where material_slip_id='".$_REQUEST['Id']."'",$db);
			  while($data=DB_fetch_array($itemdata))
			  {
			  			  	?>
			  
					<tr>
  	<td><?php echo $i; ?></td>
  	
  	<td><input type="text" name="itemcode[]" id="itemcode" style="width:100%"readonly value="<?php echo $data['item_code']; ?>"></td>
       <td><input type="text" name="item_name[]" id="item_name" style="width:100%" value="<?php echo $data['item_name']; ?>">
    	 	
    </td>
    <td><input type="text" name="uom[]" id="uom" style="width:100%" readonly value="<?php echo $data['unit']; ?>"></td>
     <td><input type="text" name="group[]" id="group" style="width:100%" readonly value="<?php echo $data['group1']; ?>"></td>
    <td><input type="text" name="make[]" id="make" style="width:100%"  value="<?php echo  $data['make']; ?>" ></td>
   
    <td><input type="text" name="grade[]" id="grade" style="width:100%" value="<?php echo $data['grade']; ?>" ></td>
    <td><input type="text" name="gsm[]" id="gsm" style="width:100%" value="<?php echo $data['gsm']; ?>"></td>
    <td><input type="text" name="size" id="size" style="width:100%" value="<?php echo $data['size']; ?>"/></td>
    
    <td><input type="text" name="amount[]" id="amount" style="width:100%"  value="<?php echo $data['total_req_qty']; ?>"></td>
  </tr>
  <?php $i++; } ?>
   </tbody></table></div></div></td></tr>
         <tr><td> <p align="left"><strong>Ink Details(Name/Sequence/Code/Requirement):- </strong></p>               
      <div align="center"><div style="overflow: auto; width: 1000px; height: 150px" >
      	 	<table width="100%" border="0" cellspacing="2" cellpadding="2" valign="top">
              <tr>
   <td><table style="border:1px solid #cccccc;" width="990" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="77" rowspan="2" align="center" class="text">Sr. No.</th>
        <th width="195" rowspan="2" align="left" class="text-wdthout-pad">PARTICULARS</th>
        <th width="116" align="center" valign="top" class="text-wdthout-pad"> No. 1</th>
        <th width="117" align="center" valign="top" class="text-wdthout-pad">No. 2</th>
        <th width="117" align="center" valign="top" class="text-wdthout-pad">No.3</th>
        <th width="117" align="center" valign="top" class="text-wdthout-pad">No. 4</th>
        <th width="117" align="center" valign="top" class="text-wdthout-pad">No.5</th>
        <th width="132" align="center" valign="top" class="text-wdthout-pad">No.6</th>
      </tr>
          </table></td>
  </tr>
  <?php 
   $j=1;
			  $itemdata1=DB_query("select * from material_ink_details where material_slip_id='".$_REQUEST['Id']."'",$db);
			  while($data1=DB_fetch_array($itemdata1))
			  {
			  	?>
  <tr>
    <td align="center" valign="top"><table width="990" border="0" cellspacing="0" cellpadding="0">
    	    <tr id="data">
        <td width="66" align="center" class="text">1.</td>
        <td width="198" class="text-wdthout-pad"><strong>Name</strong></td>
        <td width="126" align="center"><select  style="width:110px" id="name1" name="name1" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name1']."' ",$db);
        	While($row1=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row1['id']; ?>"><?php echo $row1['color']; ?></option>
        	<?php } ?>
        </select></td>
        <td width="117" align="center">
        	<select  style="width:110px" id="name2" name="name2" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name2']."'",$db);
        	While($row2=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row2['id']; ?>"><?php echo $row2['color']; ?></option>
        	<?php } ?>
        	
        </select>
        	</td>
        <td width="120" align="center">
        <select  style="width:110px" id="name3" name="name3" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name3']."'",$db);
        	While($row3=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row3['id']; ?>"><?php echo $row3['color']; ?></option>
        	<?php } ?>
        	
        </select>
        	</td>
        <td width="119" align="center"><select  style="width:110px" id="name4" name="name4" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name4']."'",$db);
        	While($row4=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row4['id']; ?>"><?php echo $row4['color']; ?></option>
        	<?php } ?>
        	
        </select>
        	</td>
        <td width="117" align="center">
        	<select  style="width:110px" id="name5" name="name5" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name5']."'",$db);
        	While($row5=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row5['id']; ?>"><?php echo $row5['color']; ?></option>
        	<?php } ?>
        	
        </select>
        	</td>
        <td width="127" align="center">
        	<select  style="width:110px" id="name6" name="name6" >
        	
        	<?php 
        	$sql=DB_query("select * from product_color where id='".$data1['color_name6']."'",$db);
        	While($row6=DB_fetch_array($sql))
			{
        	?>
        	<option value="<?php echo $row6['id']; ?>"><?php echo $row6['color']; ?></option>
        	<?php } ?>
        	
        </select>
        	</td>
      </tr>
      <tr>
        <td align="center" class="text">2.</td>
        <td class="text-wdthout-pad"><strong>Code</strong></td>
        <td align="center"><input style="width:110px" type="text" id="code1" name="code1" value="<?php echo $data1['color_code1'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="code2" name="code2" value="<?php echo $data1['color_code2'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="code3" name="code3" value="<?php echo $data1['color_code3'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="code4" name="code4" value="<?php echo $data1['color_code4'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="code5" name="code5" value="<?php echo $data1['color_code5'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="code6" name="code6" value="<?php echo $data1['color_code6'];?>"/></td>
        </tr>
      <tr>
        <td align="center" class="text">3.</td>
        <td class="text-wdthout-pad"><strong>Requirement</strong></td>
        <td align="center"><input style="width:110px" type="text" id="requirement1" name="requirement1" value="<?php echo $data1['requirement_no1'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="requirement2" name="requirement2" value="<?php echo $data1['requirement_no2'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="requirement3" name="requirement3" value="<?php echo $data1['requirement_no3'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="requirement4" name="requirement4" value="<?php echo $data1['requirement_no4'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="requirement5" name="requirement5" value="<?php echo $data1['requirement_no5'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="requirement6" name="requirement6" value="<?php echo $data1['requirement_no6'];?>"/></td>
        </tr>
        <tr>
        <td align="center" class="text">4.</td>
        <td class="text-wdthout-pad"><strong>Actual Consumptions</strong></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu1" name="actul_consu1" value="<?php echo $data1['actul_consumption_no1'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu2" name="actul_consu2" value="<?php echo $data1['actul_consumption_no2'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu3" name="actul_consu3" value="<?php echo $data1['actul_consumption_no3'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu4" name="actul_consu4" value="<?php echo $data1['actul_consumption_no4'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu5" name="actul_consu5" value="<?php echo $data1['actul_consumption_no5'];?>"/></td>
        <td align="center"><input style="width:110px" type="text" id="actul_consu6" name="actul_consu6" value="<?php echo $data1['actul_consumption_no6'];?>"/></td>
        </tr>  
        <?php } ?>
        </table>
        </div>
            </div>
        </td></tr> 
        
      </table></td></tr>
    
       <tr><td>               
         <div align="center">
<table width="100%">
<tr><th colspan="2" width="10%">Remarks</th><td colspan="2"><textarea name="remarks"  style="width:100%" ><?php echo $row['remarks']; ?></textarea></td></tr>
<tr><td colspan="4">&nbsp;</td></tr>
<tr><th width="10%">Created By</th><td><input type="text" name="created_by" style="width:100%" value="<?php echo $row['created_by']; ?>"></td><th width="20%">Approved By Store Head</th><td><select name="approved"  style="width:100%"
	>
	<option value="Yes"<?php if($row['approved']=='Yes') { ?> selected="selected" <?php } ?>>Yes</option>
	<option value="No" <?php if($row['approved']=='No') { ?> selected="selected" <?php } ?>>No</option>
	<option value="Pending" <?php if($row['approved']=='Pending') { ?> selected="selected" <?php } ?>>Pending</option>
	
</select></td>
	</tr>
</table></div></td></tr>
         	
        </table>
        
          
