feat: implement core WebGIS mapping features, sidebar UI, and API endpoints for data management

This commit is contained in:
Syariffullah
2026-05-08 20:44:23 +07:00
parent 448083d2ea
commit 08d6d30e02
14 changed files with 1326 additions and 188 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
header('Content-Type: application/json');
require_once '../db_connect.php';
$miskin_id = isset($_GET['miskin_id']) ? intval($_GET['miskin_id']) : 0;
if (!$miskin_id) {
echo json_encode(['status' => 'error', 'message' => 'miskin_id diperlukan']);
exit;
}
$sql = "
SELECT
lb.id,
lb.tipe_bantuan,
lb.tanggal,
lb.keterangan,
ri.nama AS nama_ibadah,
ri.jenis AS jenis_ibadah
FROM log_bantuan lb
JOIN rumah_ibadah ri ON ri.id = lb.ibadah_id
WHERE lb.miskin_id = ?
ORDER BY lb.tanggal DESC, lb.id DESC
";
$stmt = $conn->prepare($sql);
$stmt->bind_param('i', $miskin_id);
$stmt->execute();
$result = $stmt->get_result();
$data = [];
while ($row = $result->fetch_assoc()) {
$data[] = $row;
}
echo json_encode(['status' => 'success', 'data' => $data]);
$conn->close();