24 lines
666 B
PHP
24 lines
666 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
$itemId = $_REQUEST['item_id'];
|
|
|
|
$query = "select i.item_name,gi.*,ci.item_name child_item_name,ci.unit_id from tbl_items i, group_items gi , tbl_items ci where i.item_id=gi.group_id and gi.item_id=ci.item_id and gi.group_id = '".$itemId."' ";
|
|
|
|
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);
|
|
?>
|
|
|