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

27 lines
909 B
PHP

<?php
error_reporting(E_ERROR | E_PARSE);
include('includes/config/config.php');
$sql_requisition_items="select a.*,b.*,c.item_code,trim(concat(ifnull(d.form_name,''),' ',c.item_name)) itemwithformname from indent_master a left join indent_items b on a.indent_id = b.indent_id left join tbl_items c on c.item_id = b.item_id left join medicine_form d on d.form_id = c.item_form_id where a.indent_id='".$_POST['indent_id']."'";
error_log("get indent query:".$sql_requisition_items);
if (!$result_requisition_items = @mysqli_query($conn,$sql_requisition_items)) {
exit(mysqli_error($conn));
}
$data = array();
if(mysqli_num_rows($result_requisition_items) > 0) {
while ($row_requisition_items = mysqli_fetch_assoc($result_requisition_items)) {
//extract($row);
$data[] = $row_requisition_items;
}
}
else
{
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);