ESH/excel_approved_requisition_list.php

80 lines
2.5 KiB
PHP
Raw Permalink Normal View History

2024-10-23 18:28:06 +05:30
<?php
header("Content-type:application/octet-stream");
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=excel_item_issue.xls");
header("Pragma: no-cache");
header("Expires: 0");
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
?>
<?php
include('includes/config/config.php');
include('includes/functions.php')
//include('pop_up_top.php');
?>
<body>
<table border="1" width="100%">
<?php
$sql=base64_decode($filterkey);
$results_req = mysqli_query($conn,$sql);
?>
<strong><tr bgcolor="#eeeeee"><td align="left" width="2%" >Sr.</td><td align="left" width="10%">Requisition No.</td><td align="left" width="10%">Requisition Date</td><td align="left" width="10%">OHC Location</td><td valign="top" align="left" width="25%">Item Desc</td><td width="10%" valign="top" align="left">Approval Status</td>
<td valign="top" align="left" width="15%">Remarks</td></strong></tr>
<?php
$count=0;
while ($row_req= mysqli_fetch_assoc($results_req)){
extract($row_req);
$item_desc="";
$item_unit_id="";
$item_unit="";
$ohc_type="";
$status="";
?>
<?php
// $issue_date = getTableFieldValue('stock_issue','issue_date','stock_issue_id',$row_req['stock_issue_id']);
$ohc_type = getTableFieldValue('ohc_type','ohc_type_name','ohc_type_id',$row_req['ohc_location_id']);
//echo $ohc_type;
$sql_req_items="select * from requisition_items where req_id='".$row_req['req_id']."'";
$results_req_items = mysqli_query($conn,$sql_req_items);
while ($row_req_items= mysqli_fetch_assoc($results_req_items)) {
$item_desc = $item_desc.' <p> '.getTableFieldValue('tbl_items','item_code','item_id',$row_req_items['item_id'])." ";
//$item_desc = $item_desc.getTableFieldValue('tbl_items','item_name','item_id',$row_req_items['item_id'])."<br/>";
$item_unit_id=getTableFieldValue('tbl_items','unit_id','item_id',$row_req_items['item_id']);
$item_unit =getTableFieldValue(' unit_master','unit_name','unit_id',$item_unit_id);
$item_desc=$item_desc.'<b> Qty: '.$row_req_items['qty'].' '.$item_unit.'</b>';
$item_desc=$item_desc."</p>";
}
$status=($row_req['status']=='Y'?'<b>Approved</b>':'Rejected');
$count=$count+1;
?>
<tr><td><?php echo $count?></td><td><?php echo $row_req['req_ref_no']?></td><td align="left"><?php echo date_format(date_create($row_req['req_date']),"d-M-Y ")?></td><td><?php echo $ohc_type?></td><td><?php echo $item_desc?></td><td><?php echo $status?></td><td><?php echo $row_req['remarks']?></td></tr>
<?php
}
?>
</table>
</body>