ohctech_p8/excel_manage_item.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

71 lines
3.2 KiB
PHP

<?php //include('pdf_header.php');
include('includes/config/config.php');
include('includes/functions.php');
//include('pop_up_top.php');
header('Content-Type: application/force-download');
header('Content-disposition: attachment; filename=excel_manage_item.xls');
?>
<table border="1">
<?php
$sql = base64_decode($filterkey);
$result = mysqli_query($conn, $sql);
$count = 0;
?><tr bgcolor='#eeeeee'>
<th width=5%>Sr.
<th width=15%>Item Code</th>
<th width=15%>Item Desc</th>
<th width="15%">Salt Name</th>
<th width=10%>Ailment Systems</th>
<th width=15%>Item Form</th>
<th width="10%">Usage Category</th>
<th width=10%>Category</th>
<th width=10%>Status</th>
<th width=10%>Is Prescription</th>
<th width=10%>Reorder Qty</th>
</tr><?php
while ($row1 = mysqli_fetch_array($result)) {
extract($row1);
$item_id = $row1['item_id'];
$cat = getTableFieldValue('tbl_categories', 'cat_name', 'cat_id', $row1['cat'], '');
$item_form = getTableFieldValue('medicine_form', 'form_name', 'form_id', $row1['item_form_id'], '');
$medicine_usage_cat = getTableFieldValue('medicine_usage_cat', 'medicine_usage_cat_name', 'medicine_usage_cat_id', $row1['medicine_usage_cat_id'], '');
//$subcat=getTableFieldValue('sub_category','sub_cat_name','sub_cat_id',$row1['subcat'],'');
$unit = getTableFieldValue('unit_master', 'unit_name', 'unit_id', $row1['unit_id'], '');
/*$item_ingredients =getCommaSeperatedValuesForInClause("select ingredient_name from ingredient ","ingredient_id",$row1['active_ingredients']);*/
$item_ailment_systems = getCommaSeperatedValuesForInClause("select ailment_sys_name from ailment_system ", "ailment_sys_id", $row1['ailments']);
$query_salt = "select group_concat(salt_id) as salt_id from item_salt where item_id='" . $item_id . "' ";
error_log("salt name query " . $query_salt);
if (!$result_salt = @mysqli_query($conn, $query_salt)) {
die(mysqli_error($conn));
}
if (mysqli_num_rows($result_salt) > 0) {
$row_salt = mysqli_fetch_assoc($result_salt);
$salt_name = getCommaSeperatedValuesForInClause("select salt_name from salt_master", 'salt_id', $row_salt['salt_id']);
}
$count = $count + 1;
?>
<tr>
<td><?php echo $count ?></td>
<td><?php echo $item_code ?></td>
<td><?php echo $item_name ?></td>
<td><?php echo $salt_name ?></td>
<td><?php echo $item_ailment_systems ?></td>
<td><?php echo $item_form ?></td>
<td><?php echo $medicine_usage_cat ?></td>
<td> <?php echo $cat ?></td>
<td> <?php echo $status == 1 ? 'Active' : 'Inactive' ?></td>
<td><?php echo $is_prescription == 1 ? 'Yes' : 'No' ?></td>
<td><?php echo $reorder_stock_level ?>
</tr>
<?php
}
?>
</table>
<?php
//include('pdf_footer.php');
?>