<?php ob_start();
session_name('CAKEPHP'); session_start();

include("reportconfig.php");
$data='';
$data.="<table width='100%' border='0' cellspacing='2' cellpadding='2'>";
$data.="<tr>";
$data.="<th colspan='5'>Job Work Register</th>";
$data.="</tr>";
$data.="<tr>";
$data.="<th>RETURN SLIP NO</th>";
$data.="<th>PARTY CHALLAN NO</th>";
$data.="<th>RETURN DATE </th>";
$data.="<th>VENDOR</th>";
$data.="<th>TOTAL QUANTITY </th>";
$data.="</tr>"; 
$data5= $_SESSION['query'];
  $result=mysqli_query($con, $data5);
			
		$num=mysqli_affected_rows($con);
		if($num>0)
	{
		$flag=1;
				$i=0;
			    $totalamount=0;
				while($item_row=mysqli_fetch_array($result))
				{					
				$data.="<tr bgcolor='#FFFFFF'>"; 
      $data.="<td>".$item_row['jobNumber'].'===='.$item_row['id']."</td>";  
	  $data.="<td>".$item_row['partyJWNo']."</td>"; 
	  $data.="<td>".$item_row['jobDate']."</td>"; 
      $data.="<td>".$vendorname=$s->getField('suppliers','vendor_code',$item_row['vendor'],'vendor_name')."</td>";
      	  $data.="<td>".$item_row['quantity']."</td>";
    $data.="</tr>";
  $i++;
  }
  }
  $data.="</table>";
 // echo $data;
 header("Content-type: application/x-msdownload"); 
header("Content-Disposition: attachment; filename=data1.xls"); 
header("Pragma: no-cache"); 
header("Expires: 0"); 
print "$header\n$data";  
 

  ?>
  