33 lines
1.1 KiB
PHP
33 lines
1.1 KiB
PHP
|
<?php
|
||
|
error_reporting(E_ERROR | E_PARSE);
|
||
|
include('includes/config/config.php');
|
||
|
$cname = trim($_REQUEST['cname']);
|
||
|
$checkup_type_ids = $_REQUEST['checkup_type'];
|
||
|
$checkup_parameter_id = $_REQUEST['checkup_parameter_id'];
|
||
|
|
||
|
error_log("checkup parameter id ". $checkup_parameter_id);
|
||
|
|
||
|
$checkup_type_id = implode(',', $checkup_type_ids);
|
||
|
if($checkup_parameter_id!='' || $checkup_parameter_id!= null){
|
||
|
$query = "select column_name from checkup_parameter where column_name = '".$cname."' and checkup_type_ids in (".$checkup_type_id.") and checkup_parameter_id!='$checkup_parameter_id' ";
|
||
|
}
|
||
|
else{
|
||
|
|
||
|
$query = "select column_name from checkup_parameter where column_name = '".$cname."' and checkup_type_ids in (".$checkup_type_id.") ";
|
||
|
}
|
||
|
error_log("query:".$query);
|
||
|
if (!$result = @mysqli_query($conn,$query)) {
|
||
|
exit(mysqli_error($conn));
|
||
|
}
|
||
|
$data = array();
|
||
|
if(mysqli_num_rows($result) > 0) {
|
||
|
while ($row = mysqli_fetch_assoc($result)) {
|
||
|
$data = $row;
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
$data['status'] = 200;
|
||
|
$data['message'] = "Data not found!";
|
||
|
}
|
||
|
echo json_encode($data);
|