<?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='4'>Issue Register Report</th>";
$data.="</tr>";
$data.="<tr>";
$data.="<th>ISSUE NO.</th>";
$data.="<th>ISSUE DATE </th>";
$data.="<th>ISSUE TO  </th>";
$data.="<th>ISSUED 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['issue_slipno']."</td>";  
	  $data.="<td>".$item_row['issuedate']."</td>"; 
	  $data.="<td>". $floorname=$s->getField('floor_master','id',$item_row['issueto'],'floorName')."</td>"; 
      $data.="<td>".$item_row['issueqty']. "</td>";
    $data.="</tr>";
  $i++;
  }
  }
  $data.="</table>";
 // echo $data;
 header("Content-type: application/x-msdownload"); 
header("Content-Disposition: attachment; filename=data.xls"); 
header("Pragma: no-cache"); 
header("Expires: 0"); 
print "$header\n$data";  

  ?>
  