<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

<table width="100%" border="1" cellspacing="0" cellpadding="3" style="border-collapse:collapse;">
  <tr>
    <th><strong>Sr No</strong></th>
    <th><strong>Branch</strong></th>
    <th><strong>Job Card No </strong></th>
	<th><strong>Job Card Date</strong></th>
	<th><strong>Client</strong></th>
	<th><strong>Item</strong></th>
	<th><strong>Process</strong></th>
   <th><strong>QC Status</strong></th>	
    <th><strong>Action</strong></th>
  </tr>
  <?php
  $mrnsql=DB_query("SELECT A.id AS jobid1,A.site,A.client_id,
                    A.job_card_no,A.job_date,A.work_itemid,B.* FROM job_card A INNER JOIN job_process_details B
ON A.id=B.jobid WHERE A.job_date BETWEEN '".$_SESSION['financialYrStart']."'   AND '".$_SESSION['financialYrEnd']."'
AND A.CompanyId='".$_SESSION['ACGCompanyId']."' and B.current_status='S' ",$db);
  
 // $mrnsql='select  FROM job_card A, job_process_details B where where A.id=B.jobid '
  $i=1;
  $numrow=DB_num_rows($mrnsql);
  if($numrow>0)
  {
      
  while($row=DB_fetch_array($mrnsql))
  {
     
      $cnt=DB_query("select * from daily_production_process where job_card_id='".$row['jobid1']."' and process_name='".$row['process']."' ",$db);
      if(DB_num_rows($cnt)>0){
	 ?>
  <tr bgcolor="#FFFFFF">
  	<td ><?php echo $i;?></td>
	<td><?php echo  $s->getField('locations','loccode',$row['site'],'locationname'); ?></td>
    <td><?php echo $row['job_card_no'];?></td>
    <td><?php echo ConvertSQLDate($row['job_date']);?></td>
    <td><?php 	echo $s->getField('clientmaster','id',$row['client_id'],'c_name');?></td>
	<td><?php echo $s->getField('item_master','id',$row['work_itemid'],'item_name'); ?>	</td>
	<td><?php echo $s->getField('production_process_master','id',$row['process'],'manuf_process_name');?>	</td>
	
	  <td><?php if($row['qc_status']==0){ echo "Pending";} else if($row['qc_status']==1){echo "QC Done";} ?></td>
	  <td><a href="index.php?route=QC/transactions/quality_inspection_against&modid=<?php echo $_REQUEST['modid'] ?>&frmid=<?php echo $_REQUEST['frmid'] ?>&mrnid=<?php echo  $row['jobid1'];?>&process=<?php echo $row['process']; ?>"><input type="button"  value="To QC" class="search"></a></td>
  </tr>
  <?php 
  } } 
	}	
  else
  {?>
  <tr>
  <td colspan="12"><h3 align="center"><strong>No Record Found</strong></h3></td>
  </tr>
  <?php 	
  }
  ?>
</table>

</body>
</html>
