31 lines
933 B
PHP
31 lines
933 B
PHP
|
<?php
|
||
|
include('includes/config/config.php');
|
||
|
$bill_id = $_REQUEST['bill_id'];
|
||
|
|
||
|
|
||
|
$query = "select a.*,b.product_list,b.rate_per_unit,b.qty,b.total_before_discount,b.discount_percentage,b.discount_amount,b.total_after_discount,b.tax_code1,b.tax_rate1,b.tax_code2,b.tax_rate2,b.total_tax,b.total_amount from bill_master a left join bill_details b on b.bill_id=a.bill_id where a.bill_id = '".$bill_id."' ";
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error ($conn));
|
||
|
}
|
||
|
$data = array();
|
||
|
$data_all=array();
|
||
|
$i=1;
|
||
|
if(mysqli_num_rows($result) > 0) {
|
||
|
while ($row = mysqli_fetch_assoc($result)) {
|
||
|
$data[$i] = $row;
|
||
|
|
||
|
array_push($data_all,$data[$i]);
|
||
|
$i++;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
$data['status'] = 200;
|
||
|
$data['message'] = "Data not found!";
|
||
|
}
|
||
|
$data_all[0]['counter']=$i-1;
|
||
|
echo json_encode($data_all);
|
||
|
?>
|