csrtechnew.ohctech.in/select_ind_rfq.php
2025-08-29 16:30:39 +05:30

47 lines
2.1 KiB
PHP

<?php
include('includes/config/config.php');
include('log_entry.php');
include('includes/functions.php');
$indent_id = $_REQUEST['indent_id'];
$vendor_id = $_REQUEST['vendor_id'];
$data = array();
$count=0;
$rate=array();
$query = "select * from quotation_list where indent_id = '" . $indent_id . "' and vendor_id= '".$vendor_id."' ";
error_log("select " . $query);
if (!$result = @mysqli_query($conn, $query)) {
exit(mysqli_error($conn));
}
$indent_ohc_id = getTableFieldValue('indent_master', 'ohc_type_id', 'indent_id', $_REQUEST['indent_id']);
$ohc_cc_mails = getTableFieldValue('ohc_type', 'primary_email', 'ohc_type_id', $indent_ohc_id);
while ($row = @mysqli_fetch_assoc($result)) {
if($row['status'] == 'PUSAPP' || $row['status'] == 'HPUSREJ'|| $row['status'] == 'PUSPND'){
$row['email_to']=getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_PUS_EMAIL' . "'") ;
$row['ohc_cc_mails'] = $ohc_cc_mails;
}elseif($row['status'] == 'PUSAPP' || $row['status'] == 'HPUSAPP'|| $row['status'] == 'HODREJ'){
$row['email_to']=getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_HPUS_EMAIL' . "'") ;
$row['ohc_cc_mails'] = $ohc_cc_mails;
}else if($row['status'] == 'HPUSAPP' || $row['status'] == 'APPROVED'){
$row['email_to']=getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_HOD_EMAIL' . "'").','.getTableFieldValue('employer_contractor', 'employer_contractor_email', 'id', "'" . $row['vendor_id'] . "'") ;
$row['ohc_cc_mails'] = $ohc_cc_mails;
}else{
$row['email_to']=getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_HPUS_EMAIL' . "'").','.getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_HOD_EMAIL' . "'") .','.getTableFieldValue('config', 'value', 'key_name', "'" . 'INDENT_PUS_EMAIL' . "'") ;
$row['ohc_cc_mails'] = $ohc_cc_mails;
}
$row['new_vendor_id'] = secureData($vendor_id,'encrypt');
$row['new_indent_id'] = secureData($indent_id,'encrypt');
$data[] = $row;
}
error_log(print_r($data, true));
echo json_encode($data);