add webtugas folder

This commit is contained in:
2026-06-10 16:50:48 +07:00
parent 19d7bbf798
commit a6df2be316
37 changed files with 8318 additions and 1 deletions
@@ -0,0 +1,22 @@
<?php
include "db_config.php";
header('Content-Type: application/json');
$data = json_decode(file_get_contents("php://input"), true);
$id = isset($data['id']) ? intval($data['id']) : 0;
$status = isset($data['status']) ? $conn->real_escape_string($data['status']) : '';
$allowed = ['Belum Ditangani', 'Diproses', 'Sudah Ditangani'];
if ($id <= 0 || !in_array($status, $allowed)) {
echo json_encode(["status" => "error", "message" => "Data tidak valid"]);
exit;
}
$sql = "UPDATE kemiskinan SET status_penanganan='$status', updated_at=NOW() WHERE id=$id";
if ($conn->query($sql)) {
echo json_encode(["status" => "success"]);
} else {
echo json_encode(["status" => "error", "message" => $conn->error]);
}
?>