<?php $PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['site']!='')
{
$sql="Select * from job_route_card where id='".$_REQUEST['site']."'";
$result=DB_query($sql,$db);
$row=DB_fetch_array($result); 
$item=$s->getField('item_master','id',$row['part_code'],'item_name'); 

$data1=$s->getField('item_master','id',$row['part_code'],'item_name'); 
$data2=$row['job_card_date'];
$data4=$row['order_qty'];
 $data3='';
 
        $data3.="<table width='100%' border='0' cellspacing='2' cellpadding='2' >";
              $data3.="<tr>";
                $data3.="<th align='center'><strong>S.No</strong></th>";
               	$data3.="<th align='center' ><strong>Item Code </strong></th>";
                $data3.="<th align='center' width='25%'><strong>Item Name </strong></th>";
				$data3.="<th align='center'><strong>Unit</strong></th>";
				$data3.="<th align='center'><strong> Group </strong></th>";
                $data3.="<th align='center'><strong>Make</strong></th>";
                $data3.="<th align='center'><strong>Grade</strong></th>";
                $data3.="<th align='center'><strong>Gsm</strong></th>";
                $data3.="<th align='center'><strong>Size</strong></th>";
                $data3.="<th align='center'><strong>Total Req Qty</strong></th>";
                $data3.="<th align='center'><strong>Act Consume Qty</strong></th>";
                  $data3.="<th align='center'><strong>Diff. Qty</strong></th>";
                  
              $data3.="</tr>";
 
 
              $i=1;
              $j=0;
              $data="select id from material_slip_against_job_card where job_card_id='".$_REQUEST['site']."'";
              $query=DB_query($data,$db);
			  $rowdata1=DB_fetch_array($query);
              $sqldata=DB_query("select * from material_job_item where material_slip_id='".$rowdata1['id']."'",$db);
			  while($row5=DB_fetch_array($sqldata))
			  {                
              
           $data3.="<tr>";
              	$data3.="<td align='center'>".$i."</td>";
               	$data3.="<td align='center'><input type='text' name='item_code[$j]'  value='".$row5['item_code']."' readonly/></td>";
                $data3.="<td align='center' width='25%'><input type='text' name='itemname[$j]'  value='".$row5['item_name']."' readonly/></td>";
				 $data3.="<td align='center'><input type='text' name='unit[$j]'  value='".$row5['unit']."'readonly/></td>";
				$data3.="<td align='center'><input type='text'  name='group[$j]'  value='".$row5['group1']."' readonly/></td>";
                $data3.="<td align='center'><input type='text'  name='make[$j]'   value='".$row5['make']."'readonly/></td>";
                $data3.="<td align='center'><input type='text'  name='grade[$j]'  value='".$row5['grade']."'readonly/></td>";
                $data3.="<td align='center'><input type='text'  name='gsm[$j]'    value='".$row5['gsm']."'readonly/></td>";
                $data3.="<td align='center'><input type='text'  name='size[$j]'   value='".$row5['size']."'readonly/></td>";
                $data3.="<td align='center'><input type='text'  name='total_req_qty[$j]'  value='".$row5['total_req_qty']."' id='total_req_qty_$j' readonly/></td>";  
                $data3.="<td align='center'><input type='text'  name='act_cons[$j]'  id='act_cons_$j' /></td>";   
                $data3.="<td align='center'><input type='text'  name='diff_qty[$j]'  id='diff_qty_$j' onfocus='caldiff($j)' readonly/></td>";
              $data3.="</tr>";
               $i++; $j++; }
              
    echo  $data=$data1."__".$data2."__".$data3."__".$data4;          
           }  ?>
