feat: memisahkan monorepo jadi 2 project (Kemiskinan & Publik)

This commit is contained in:
2026-06-11 14:38:22 +07:00
parent 4cbbd3c718
commit d77596f62b
48 changed files with 7277 additions and 36 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
session_start();
if (!isset($_SESSION['role']) || !in_array($_SESSION['role'], ['admin', 'petugas'])) {
header('Content-Type: application/json');
http_response_code(403);
echo json_encode(['status'=>'error','message'=>'Akses ditolak.']);
exit;
}
include '../koneksi.php';
header('Content-Type: application/json');
$id = (int)($_POST['id'] ?? 0);
$status_bantuan = trim($_POST['status_bantuan'] ?? '');
if (!$id || !$status_bantuan) {
echo json_encode(['status'=>'error','message'=>'Data tidak valid.']);
exit;
}
try {
$stmt = $pdo->prepare("UPDATE penduduk_miskin SET status_bantuan=? WHERE id=?");
$stmt->execute([$status_bantuan, $id]);
echo json_encode(['status'=>'success']);
} catch (PDOException $e) {
echo json_encode(['status'=>'error','message'=>$e->getMessage()]);
}
?>