csrtechnew.ohctech.in/select_delivery.php

39 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2025-04-14 13:28:09 +05:30
<?php
include('includes/config/config.php');
include('log_entry.php');
include('includes/functions.php');
$indent_id = "'".$_REQUEST['indent_id']."'";
$data = array();
$count=0;
$rate=array();
$new_indent_id = getTableFieldValue('grn_master', 'indent_id', 'delivery_no', $indent_id);
$indent_ohc_id = getTableFieldValue('indent_master', 'ohc_type_id', 'indent_id', $new_indent_id);
$ohc_cc_mails = getTableFieldValue('ohc_type', 'primary_email', 'ohc_type_id', $indent_ohc_id);
error_log("for mail".$new_indent_id." - ".$indent_ohc_id." - ".$ohc_cc_mails);
$query = "select * from grn_master where delivery_no = $indent_id";
error_log("select " . $query);
if (!$result = @mysqli_query($conn, $query)) {
exit(mysqli_error($conn));
}
while ($row = @mysqli_fetch_assoc($result)) {
$date=date_create($row['indent_date']);
$count++;
array_push($rate,$item_perUnit_rate);
$row['indent_date']=$date;
$row['ohc_cc_mails']=$ohc_cc_mails;
$data[] = $row;
}
$data['count']=$count;
$data['perunitRate']=$rate;
error_log(print_r($data, true));
echo json_encode($data);