2024-10-16 19:18:52 +05:30
|
|
|
<?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)) {
|
2024-11-02 18:03:13 +05:30
|
|
|
die(mysqli_error($conn));
|
2024-10-16 19:18:52 +05:30
|
|
|
}
|
|
|
|
$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);
|