Add WebGIS SPBU project documentation

This commit is contained in:
GuavaPopper
2026-06-11 02:29:29 +07:00
commit 529d8bcc70
13 changed files with 1905 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
// ── GET SPBU ──────────────────────────────────────────────────────────────────
require_once __DIR__ . '/config.php';
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit();
}
// ── AMBIL DATA ────────────────────────────────────────────────────────────────
try {
$stmt = $pdo->query("SELECT * FROM spbu ORDER BY created_at DESC");
$rows = $stmt->fetchAll();
echo json_encode($rows);
} catch (PDOException $e) {
http_response_code(500);
echo json_encode(['error' => 'Gagal mengambil data: ' . $e->getMessage()]);
}