43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
|
<?php
|
||
|
|
||
|
include('includes/config/config.php');
|
||
|
include('includes/functions.php');
|
||
|
include('log_entry.php');
|
||
|
|
||
|
if(isset($_REQUEST['id'])){
|
||
|
|
||
|
$sql = "SELECT * from store_received_return_master where received_id = '".$_REQUEST['id']."'";
|
||
|
error_log('apps'.$sql);
|
||
|
$query = mysqli_query($conn , $sql);
|
||
|
$fetch = mysqli_fetch_assoc($query);
|
||
|
|
||
|
$item_desc = "";
|
||
|
$sql_received_items = "select * from store_received_return_items where received_id='" . $fetch['received_id'] . "'";
|
||
|
$results_received_items = mysqli_query($conn, $sql_received_items);
|
||
|
while ($row_received_items = mysqli_fetch_assoc($results_received_items)) {
|
||
|
|
||
|
$item_desc = $item_desc . getTableFieldValue('tbl_items', 'item_name', 'item_id', $row_received_items['item_id']) . " ";
|
||
|
$item_unit_id = getTableFieldValue('tbl_items', 'unit_id', 'item_id', $row_received_items['item_id']);
|
||
|
$item_unit = getTableFieldValue(' unit_master', 'unit_name', 'unit_id', $item_unit_id);
|
||
|
$item_desc = $item_desc . '- Qty: ' . $row_received_items['received_qty'] . ' ' . $item_unit;
|
||
|
$item_desc = $item_desc ;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
$dm = array(
|
||
|
|
||
|
'received_id' =>$fetch['received_id'],
|
||
|
'received_ref_no' =>$fetch['received_ref_no'],
|
||
|
'received_date' =>$fetch['received_date'],
|
||
|
'item_desc' =>$item_desc,
|
||
|
|
||
|
|
||
|
);
|
||
|
error_log('apps'.print_r($dm,true));
|
||
|
echo json_encode($dm);
|
||
|
|
||
|
|
||
|
|
||
|
}
|