<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['site1']!='')
{
$job_against_indent = "SELECT against_indent,against_production FROM tbl_values_production where CompanyID='".$_SESSION['ACGCompanyId']."' and ApprovalType='OtherConfig'";
$job_against_indent_result = DB_query($job_against_indent,$db);
$job_against_indent_Row = DB_fetch_array($job_against_indent_result);

$sql="Select * from job_card where id='".$_REQUEST['site1']."'";
$result=DB_query($sql,$db);
$row=DB_fetch_array($result); 
//$process=$s->getField('production_process_master','id',$row['process_name'],'manuf_process_name');
//if($row['order_type']==1){
if($row['mao']==1){
	$sopname = $s->getField('manufacturing_advice','id',$row['wo_no'],'advice_no');
}else{
	
	if($job_against_indent_Row['against_indent']==1) {
    $sopname = $s->getField('prd_wo','id',$row['wo_no'],'wo_no');
	}else{
	$sopname = $s->getField('salesorder','id',$row['wo_no'],'OrderNo');
	}
}

$pro_query = "SELECT prodqty, mst_itemid FROM job_card_item_details WHERE jobid='".$_REQUEST['site1']."'";
$presult = DB_query($pro_query,$db);
$prodRow = DB_fetch_array($presult);
$item=$s->getField('item_master','id',$prodRow['mst_itemid'],'item_name');

 ?>
 <table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">

            	
            	<tr>
                 <th align="left"><strong>Job Card Date</strong></th>
                    <td><input type="text" readonly="" name="job_date" id="job_date"  size="6"  style="width:100%;" value="<?php echo date('d/m/Y',strtotime($row['job_date'])); ?>">                    	</td>
                    <th align="left"><strong>Item Name</strong></th>
                     <td><input type="text" readonly="" name="item_name1" id="item_name1" style="width:100%;" value="<?php echo $item; ?>"/>
                     </td>
                  </tr><tr>
                  	<th width="24%" align="left"><strong>W/O No</strong></th>
                    <td width="27%">
					<input type="text" readonly="" name="wo_no1" id="wo_no1" style="width:100%;" value="<?php echo $sopname; ?>"/>
					<input type="hidden" readonly="" name="wo_no" id="wo_no" style="width:100%;" value="<?php echo $row['wo_no']; ?>"/>
					</td>
                     <th align="left"><strong>Batch No.</strong></th>
                     <td><input type="text" readonly="" style="width:100%;" name="batch_no" id="batch_no" value="<?php echo $row['lotno'];?>" >
                     </td></tr>    
                     <tr>
                  	<th width="24%" align="left"><strong>Production Qty</strong></th>
                    <td width="27%">
					<input type="text" style="width:100%;" name="order_qty"  id="order_qty" value="<?php echo $prodRow['prodqty']; ?>" readonly="" /></td>
                     <th align="left"><strong><!--Indent No.--></strong></th>
                      <td>
					  <!--<input type="text"  style="width:100%;"  readonly="true" name="indent_no" id="indent_no"  value="<?php echo $s->GetFieldValue('indent_so_main','id="'.$row['indent_no'].'"','indent_no');?>">
					  <input type="hidden"  style="width:100%;" name="indent_id" id="indent_id"  value="<?php echo $row['indent_no'];?>">   -->
					  </td>
                     </td></tr>
                     <!--<tr>
                  	<th width="23%" align="left"><strong>Size</strong></th>
                    <td width="25%">
					<?php $sizes=$s->GetFieldValue('job_card_item_details','mst_itemid="'.$prodRow['mst_itemid'].'" and jobid="'.$_REQUEST['site1'].'"','size_id');?>
					<input type="text"  style="width:100%;" readonly="true" name="size" id="size"  value="<?php echo $s->GetFieldValue('size_master','id="'.$sizes.'"','size');?>">
					  <input type="hidden"  style="width:100%;" name="size_id" id="size_id"  value="<?php echo $sizes;?>"> 
					  </td>
                      <th align="left"><strong>&nbsp;</strong></th>
                      <td>&nbsp;</td>
				</tr> -->             
                 </table>
         
<?php  }  ?>
