ESH/dispensary_stock_excel.php
2024-10-23 18:28:06 +05:30

54 lines
1.7 KiB
PHP

<?php //include('pdf_header.php');
header("Content-type:application/octet-stream");
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=dispensary_stock_excel.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');
?>
<table border="1">
<?php
$sql = base64_decode($filterkey);
$result = mysqli_query($conn, $sql);
$count = 0;
?><tr bgcolor='#eeeeee'>
<th width=10%>Sr.</th>
<th width=50%>Item Description</th>
<th width=50%>Price</th>
<th width=40%>Stock Quantity</th>
</tr><?php
while ($row1 = mysqli_fetch_array($result)) {
extract($row1);
$item_id = $row1['item_id'];
$latest_cost = $row1['item_rate_latest'];
$old_cost = $row1['item_rate_old'];
$applicable_date = $row1['applicable_date'];
$item_id = $row1['item_id'];
$item_desc = $item_name = getItemWithFormName($row1['item_id']);
$unit_id = getTableFieldValue('tbl_items', 'unit_id', 'item_id', $row1['item_id']);
$unit_name = getTableFieldValue('unit_master', 'unit_name', 'unit_id', $unit_id);
$count = $count + 1;
?><tr>
<td><?php echo $count; ?></td>
<td> <?php echo $item_desc; ?></td>
<td> <?php echo $latest_cost; ?></td>
<td> <?php echo $row1['stock_qty'] . " " . $unit_name; ?></td>
</tr>
<?php
}
?>
</table>
<?php
//include('pdf_footer.php');
?>