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

?>


<div class="body_contain">
<div class="tab_div">
<h1 align="center">View Job Route Card  </h1>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php if(count($msgErr)>0){?>
   <tr>
   <td colspan="4"><?php
   for($i=0;$i<count($msgErr);$i++)
   {
     echo "<div class='error'>".$msgErr[$i].'</div>';
   }
    ?></td>
   </tr>
   <?php } ?>
 <tr><td></td></tr>
	<tr><td>&nbsp;</td></tr>
    <tr>
        <td>
        <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
        <tr>
            <td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                  <tr>
                    <th width="21%" align="left">Job Ticket No</th>
                    <td width="28%"><input type="text" name="job_ticket" id="job_ticket" style="width:100%" value="<?php echo $rowdata['job_card_no']; ?>" >
                      			</td>
                    <th width="24%" align="left">Date</th>
                    <td width="27%"><input type="text" name="job_date" id="job_date"  size="6"  style="width:100%;" class="datepicker" value="<?php echo $rowdata['job_card_date']; ?>">
                    </td>
                  </tr>
                  <tr>
                    <th align="left">Batch No</th>
                    <td><input type="text" name="batch_no" id="batch_no" style="width:100%;" value="<?php echo $rowdata['batch_no']; ?>"/></td>
                    <th align="left">W/O No</th>
                     <td><select style="width:250px;" name="sop_no" id="sop_no" " >
			        	<option value="0">Select</option>	 
			        	<?php 
			        	$sql="select * from salesorder";
						$query=DB_query($sql,$db);
						while($row=DB_fetch_array($query))
						{
						$k='';
						if($row['id']==$rowdata['sop_no'])	
						{
						$k="selected";	
						}
			        	?>	
			        	<option value="<?php echo $row['id']; ?>" <?php echo $k; ?>><?php echo $row['orderNo']; ?></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" width="50%" valign="top">
        <div id="enquiryId" style="width:100%; margin:0 auto;">
            <table width="100%" cellpadding="2" cellspacing="1" border="0">
                <tr>
                  <th width="21%" align="left" nowrap="nowrap">Sop Date</th>
                  <td> <input type="text" name="sop_date" style="width:100%;"  value="<?php echo $rowdata['sop_date']; ?>"> </td>
                       <th width="24%"  align="left" nowrap="nowrap">Item Description</th>
                       <td width="27%">
                       <?php
                      
                       $itemname=$s-> getField('item_master','StockID',$rowdata['part_code'],'item_name');
                       
                        ?>
                       	<input type="text" name="item_desc" id="item_desc" style="width:100%;"  value="<?php echo $itemname; ?>">  
                       	
                       </td>
                  </tr>
                  <tr>
                    <th width="21%" align="left" nowrap="nowrap">Customer Name</th>
                    <td><input type="text" name="customer_name" id="customer_name" style="width:100%;"  value="<?php echo $rowdata['customer_name']; ?>"/></td>
                    <th width="24%"  align="left" nowrap="nowrap">Process Name</th>
                     <td width="27%"><select   style="width:250px;" name="process_name" id="process_name"   >
                     <option value="0">Select </option>
            	<?php
            	$sql=DB_query("select * from production_process_master",$db);
				while($rowsql=DB_fetch_array($sql))
				{
					$j='';
					if($rowsql['id']==$rowdata['process_name'])	
					{
					$j="selected";	
					}		
            	 ?>
            	 <option value="<?php echo $rowsql['id']; ?>" <?php echo $j; ?>><?php echo $rowsql['manuf_process_name']; ?></option>
            	<?php } ?></select></td></tr>
                <tr>
                  <th width="21%" align="left" nowrap="nowrap" >Order Qty</th>
                  <td><input name="order_qty" type="text"  style="width:100%;"  id="order_qty"  value="<?php echo $rowdata['order_qty']; ?>"></td>
                  <th width="24%"  align="left" nowrap="nowrap" >Customer PO Ref No</th>
                  	<td width="27%"><input name="customer_po" type="text"  style="width:100%;"  value="<?php echo $rowdata['party_order_no']; ?>"></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="21%" align="left">Tollerence %</th>
                    <td width="28%"><input type="text" name="toll_per" id="toll_per" style="width:100%" value="<?php echo $rowdata['tollerence_per']; ?>">
                      			</td>
                    <th width="24%" align="left">Total Production Qty</th>
                    <td width="27%"><input type="text" name="total_prod_qty" id="total_prod_qty"  size="6"  style="width:100%;" value="<?php echo $rowdata['total_prod_qty']; ?>" >
                    </td>
                  	
                  </tr></table></div>
                  	
                  </td></tr>
                   <tr><td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                  <tr>
                  	<th width="21%" align="left">Created By</th>
                    <td width="28%"><input type="text" name="created_by" id="created_by" style="width:100%" value="<?php echo $rowdata['total_prod_qty']; ?>">
                      			</td>
                    <th width="24%" align="left">Approved By Commercial Dept.</th>
                    <td width="27%"><Select  name="approved_by" id="approved_by"   style="width:100%;"  >
                    	<option value="0">Selcct</option>
                    	<option value="Yes">Yes</option>
                    	<option value="No">No</option>
                        <option value="Pending">Pending</option>
                     </select>
                    </td>
                  	
                  </tr></table></div>
                  	
                  </td></tr>
                  <tr><td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                  <tr>
                  	<th width="7%" align="left" colspan="2">Remarks</th>
                    <td width="28%" colspan="2"><textarea  name="created_by" id="created_by" style="width:100%" ><?php echo $rowdata['remarks']; ?></textarea>
                      			</td>
                    
                  	
                  </tr></table></div>
                  	
                  </td></tr>
    
    
    
    </table></td></tr></table>
      
</div></div>