Initial commit untuk UAS SIG

This commit is contained in:
z0rayy
2026-06-08 21:16:23 +07:00
commit c90ce9aedc
39 changed files with 7105 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
// backend/read_ibadah.php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
require_once __DIR__ . '/koneksi.php';
$conn = getConnection();
$result = $conn->query("SELECT id, nama, alamat, latitude, longitude FROM rumah_ibadah ORDER BY id DESC");
$data = [];
if ($result && $result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$row['latitude'] = (float) $row['latitude'];
$row['longitude'] = (float) $row['longitude'];
$data[] = $row;
}
}
echo json_encode(['success' => true, 'count' => count($data), 'data' => $data]);
$conn->close();