Memperbaiki penamaan folder dan menambahkan index.html sebagai landing page

This commit is contained in:
powji17
2026-06-09 15:47:38 +07:00
parent cd9c12bd3c
commit 64ca4e3565
42 changed files with 70 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
header('Content-Type: application/json');
$conn = new mysqli("localhost", "root", "", "webgis");
$sql = "SELECT * FROM area_polygon";
$result = $conn->query($sql);
$data_area = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
// Mengubah string geojson dari database kembali menjadi Object JSON
// Ini wajib agar Leaflet.geoJSON() di Javascript bisa merendernya
$row['geojson'] = json_decode($row['geojson']);
$data_area[] = $row;
}
}
echo json_encode($data_area);
$conn->close();
?>