This commit is contained in:
2026-05-12 10:16:16 +07:00
parent bae0569701
commit c2efc4414f
37 changed files with 2222 additions and 18 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
header('Content-Type: application/json');
include 'db_config.php';
$sql = 'SELECT id, kategori, pelapor_nama, kontak_pelapor, deskripsi, status_tindak_lanjut, tindak_lanjut, foto, latitude, longitude, created_at FROM aduan_warga ORDER BY created_at DESC';
$result = $conn->query($sql);
if (!$result) {
http_response_code(500);
echo json_encode(['status' => 'error', 'message' => 'Query gagal: ' . $conn->error]);
$conn->close();
exit;
}
$data = [];
while ($row = $result->fetch_assoc()) {
$row['latitude'] = (float)$row['latitude'];
$row['longitude'] = (float)$row['longitude'];
$data[] = $row;
}
echo json_encode($data);
$conn->close();
?>