25 lines
901 B
PHP
25 lines
901 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('log_entry.php');
|
|
$itemId = $_REQUEST['appointment_id'];
|
|
|
|
$query = "select a.*,b.cat_name,c.form_name,d.unit_name,m.medicine_usage_cat_name from tbl_items a left join tbl_categories b on b.cat_id=a.cat left join medicine_form c on c.form_id=a.item_form_id left join unit_master d on d.unit_id=a.unit_id left join medicine_usage_cat m on m.medicine_usage_cat_id = a.medicine_usage_cat_id where a.item_id = '".$itemId."'";
|
|
// error_log($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!";
|
|
$data['sql'] =$query;
|
|
}
|
|
echo json_encode($data);
|
|
?>
|