ohctech_p8/select_checkup_section_ids.php
Dushant Mali 899fb3e65a Upgrade 7 to 8
Upgrade 7 to 8
2024-11-02 18:03:13 +05:30

37 lines
1.1 KiB
PHP

<?php
include('includes/config/config.php');
// $agencyId = $_REQUEST['agencyId'];
$sub_query = "select checkup_section_ids,add_param_ids from checkup_form where checkup_id = '" . $_REQUEST['checkup_id'] . "'";
$result_sub = mysqli_query($conn, $sub_query);
$row_sub = mysqli_fetch_array($result_sub);
$query = "select section_id,section_name from checkup_form_section where section_id in (" . $row_sub['checkup_section_ids'] . ");";
error_log("CHECKUP SECTIONS::" . $query);
if (!$result = @mysqli_query($conn, $query)) {
die(mysqli_error($conn));
}
$data = array();
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$data[] = $row;
}
// Check if add_param_ids has some value
if (!empty($row_sub['add_param_ids'])) {
$additional_section = array(
'section_id' => 'add_section',
'section_name' => 'Additional/Other Tests',
);
$data[] = $additional_section;
}
} else {
$data['status'] = 200;
$data['message'] = "Data not found!";
}
echo json_encode($data);