ESH/select_ohc_type.php

51 lines
1.8 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('includes/config/config.php');
$ohc_type_id = number_format($_REQUEST['ohc_type_id']);
$query = " select * from ohc_type where ohc_type_id='" . ($_REQUEST['ohc_type_id']) . "' ";
error_log("query " . $query);
if (!$result = @mysqli_query($conn, $query)) {
error_log("Failed to get the OHC type details:" . mysqli_error($conn) . " Failing Query:" . $query);
exit(mysqli_error($conn));
}
$data = array();
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
// $data = $row;
$data['ohc_type_id'] = $row['ohc_type_id'];
$data['ohc_type_name'] = $row['ohc_type_name'];
$data['ohc_desc'] = $row['ohc_desc'];
$data['ohc_code'] = $row['ohc_code'];
$data['pin_code'] = $row['pin_code'];
$data['icon_text'] = $row['icon_text'];
$data['icon_color'] = $row['icon_color'];
$data['state'] = $row['state'];
$data['fax'] = $row['fax'];
$data['primary_phone'] = $row['primary_phone'];
$data['primary_email'] = $row['primary_email'];
$data['ship_address'] = $row['address'];
$data['bill_address'] = $row['billing_address'];
$data['ohc_website'] = $row['ohc_website'];
$data['gstin'] = $row['gstin'];
$data['ohc_logo'] = base64_encode($row['ohc_logo']);
$data['ohc_type'] = base64_encode($row['ohc_type']);
$data['image_type'] = $row['image_type'];
$data['width'] = $row['width'];
$data['height'] = $row['height'];
$data['background-color'] = $row['background-color'];
$data['account_number'] = $row['account_number'];
$data['account_info'] = $row['account_info'];
$data['ifsc_code'] = $row['ifsc_code'];
$data['pan_number'] = $row['pan_number'];
$data['bank_name'] = $row['bank_name'];
$data['ohc_category'] = $row['ohc_category'];
}
} else {
$data['status'] = 200;
$data['message'] = "Data not found!";
}
error_log("data ". print_r($data, true));
echo json_encode($data);