36 lines
594 B
PHP
36 lines
594 B
PHP
<?php
|
|
include "db_config.php";
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
$sql = "SELECT
|
|
id,
|
|
nama_rumah_ibadah AS nama_masjid,
|
|
penanggung_jawab AS pic_masjid,
|
|
alamat AS alamat_masjid,
|
|
radius,
|
|
lat,
|
|
lng,
|
|
created_at,
|
|
updated_at
|
|
FROM rumah_ibadah";
|
|
$result = $conn->query($sql);
|
|
|
|
if (!$result) {
|
|
echo json_encode([
|
|
"status" => "error",
|
|
"message" => "Gagal membaca tabel rumah ibadah",
|
|
"detail" => $conn->error
|
|
]);
|
|
exit;
|
|
}
|
|
|
|
$data = [];
|
|
|
|
while($row = $result->fetch_assoc()){
|
|
$data[] = $row;
|
|
}
|
|
|
|
echo json_encode($data);
|
|
?>
|