44 lines
925 B
PHP
44 lines
925 B
PHP
|
|
<?php
|
|
include('includes/config/config.php');
|
|
include('log_entry.php');
|
|
include("includes/functions.php");
|
|
$where_key = $_REQUEST['key'];
|
|
//error_log('select file');
|
|
|
|
|
|
switch($where_key)
|
|
{
|
|
|
|
case 'date':
|
|
|
|
|
|
$where_val = $_REQUEST['key_val'];
|
|
|
|
$query = "select * from bio_medical_waste_new where waste_gen_date = STR_TO_DATE('".$where_val."','%d/%m/%Y') ";
|
|
error_log($query);
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
error_log("error in query checking unique value:".mysqli_errno()." Query:".$query);
|
|
exit(mysqli_error($conn));
|
|
}else{
|
|
$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!";
|
|
error_log($data['message']);
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}//end of switch
|
|
echo json_encode($data);
|
|
?>
|