init: publish to github

This commit is contained in:
Syariffullah
2026-05-06 10:05:49 +07:00
commit 448083d2ea
31 changed files with 2746 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
header("Content-Type: application/json; charset=UTF-8");
include_once '../db_connect.php';
$query = "SELECT * FROM penduduk_miskin";
$result = $conn->query($query);
$arr = array();
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$item = array(
"id" => $row['id'],
"nama" => $row['nama'],
"kategori_bantuan" => $row['kategori_bantuan'],
"lat" => (float)$row['lat'],
"lng" => (float)$row['lng']
);
array_push($arr, $item);
}
echo json_encode(["status" => "success", "data" => $arr]);
} else {
echo json_encode(["status" => "success", "data" => []]);
}
?>