Upload semua tugas SIG

This commit is contained in:
Wilhelmus Ikchan Dwi Putra
2026-06-13 00:45:23 +07:00
commit c8e75593cb
361 changed files with 78622 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
// get_spbu.php
header('Content-Type: application/json');
$conn = new mysqli("localhost", "root", "", "db_tugas_1_sig"); // sesuaikan dengan database kamu
$response = [];
$result = $conn->query("SELECT * FROM data_spbu");
while($row = $result->fetch_assoc()) {
$geo = json_decode($row['geojson'], true);
// Ekstrak koordinat Longitude dan Latitude dari objek GeoJSON Point
$lng = $geo['geometry']['coordinates'][0];
$lat = $geo['geometry']['coordinates'][1];
$response[] = [
'id' => $row['id'],
'nama' => $row['nama_spbu'],
'status_24jam' => $row['status_24jam'],
'alamat' => $row['alamat'],
'lat' => $lat,
'lng' => $lng
];
}
echo json_encode($response);
$conn->close();
?>