24 lines
1.1 KiB
PHP
24 lines
1.1 KiB
PHP
<?php error_reporting(E_ERROR || E_PARSE);
|
|
include ('includes/config/config.php');
|
|
$item_stock_id = $_POST['item_stock_id'];
|
|
$data = array();
|
|
$sql_pending_item_expiry = "select a.*,b.item_name,a.expiry_date,trim(concat(ifnull(f.form_name,''),' ',b.item_name)) itemwithformname from item_stock_miscellaneous a inner join tbl_items b on a.item_id=b.item_id left join medicine_form f on b.item_form_id=f.form_id where a.id='" . $item_stock_id . "'";
|
|
//echo $sql_for_child_items;
|
|
if (!$result_pending_item_expiry = @mysqli_query($conn, $sql_pending_item_expiry)) {
|
|
die(mysqli_error($conn));
|
|
}
|
|
//echo mysqli_num_rows($result_stock_issue_item);
|
|
$data = array();
|
|
if (mysqli_num_rows($result_pending_item_expiry) > 0) {
|
|
while ($row_pending_item_expiry = mysqli_fetch_assoc($result_pending_item_expiry)) {
|
|
//extract($row);
|
|
$data = $row_pending_item_expiry;
|
|
$data['expiry_date'] = date_format(date_create($row_pending_item_expiry['expiry_date']), "d-M-Y ");
|
|
|
|
}
|
|
} else {
|
|
$data['status'] = 200;
|
|
$data['message'] = "Data not found!";
|
|
}
|
|
|
|
echo json_encode($data); |