ESH/delete_device_result_data.php
2024-10-23 18:28:06 +05:30

31 lines
866 B
PHP

<?php
include('includes/config/config.php');
include('includes/functions.php');
include('log_entry.php');
error_log("Start Printing Request Attributes");
$requestStr = "";
foreach ($_REQUEST as $key => $value) {
$requestStr .= $key . " : " . $value . "\n";
error_log($key . " : " . $value . "<br />\r\n");
}
error_log("End Printing Request Attributes");
$status_code = 200;
$result_ids = $_REQUEST['checkupIds'];
for ($num = 0; $num < sizeof($result_ids); $num++) {
$data = [];
$query = "delete from device_result where result_id='" . $result_ids[$num] . "'; ";
error_log("deleting data " . $query);
if (!$result = mysqli_query($conn, $query)) {
error_log("error in sending for approval " . mysqli_error($conn) . " query is " . $query);
$status_code = 400;
rollback();
}
}
echo json_encode($status_code);