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

22 lines
796 B
PHP

<?php
include('includes/config/config.php');
$itemId = $_REQUEST['item_id'];
$query = "select i.item_name, i.item_form_id, d.stock_qty as current_stock_level,d.item_batch_no, i.is_prescription, i.unit_id, i.item_id from tbl_items i inner join item_stock_dispensary d on i.item_id = d.item_id where d.ohc_location_id ='".$_SESSION['current_ohcttype']."' and i.item_id = '".$itemId."' ";
error_log("str availabe_qty".$query);
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
$data = array();
if(mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$data = $row;
}
}
else
{
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);
?>