csrtechnew.ohctech.in/delete_screening_data.php

41 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2025-04-14 13:28:09 +05:30
<?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);
}
error_log("End Printing Request Attributes");
save_log($requestStr, 'delete village', 'DELETE', 'delete_village.php');
error_log($_REQUEST['village_id']."dipak mali");
if (!empty($_REQUEST['village_id'])) {
$villageId = mysqli_real_escape_string($conn, $_REQUEST['village_id']);
$query = "DELETE FROM cancers_screening WHERE id = '$villageId'";
error_log('role_code_delete: ' . $query);
if (!$result = mysqli_query($conn, $query)) {
error_log('Database error: ' . mysqli_error($conn));
echo json_encode(["status" => "FAILURE", "error" => mysqli_error($conn)]);
exit;
} else {
echo json_encode(["status" => "SUCCESS"]);
}
} else {
echo json_encode(["status" => "FAILURE", "message" => "village_id is required."]);
}
?>