Pembaruan pertama: Implementasi WebGIS CRUD dan Layer SPBU

This commit is contained in:
unknown
2026-06-08 20:51:21 +07:00
commit 28a7b04893
9 changed files with 572 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* Kegunaan: Menghapus data secara permanen dari tabel yang relevan.
*/
header('Content-Type: application/json');
require 'koneksi.php';
$data = json_decode(file_get_contents("php://input"), true);
try {
if ($data['type'] === 'jalan') {
$stmt = $koneksi_pdo->prepare("DELETE FROM jalan WHERE id = ?");
}
else if ($data['type'] === 'persil') {
$stmt = $koneksi_pdo->prepare("DELETE FROM persil_tanah WHERE id = ?");
}
else if ($data['type'] === 'spbu') {
$stmt = $koneksi_pdo->prepare("DELETE FROM spbu WHERE id = ?");
}
if (isset($stmt)) {
$stmt->execute([$data['id']]);
}
echo json_encode(["status" => "success"]);
} catch (PDOException $e) {
echo json_encode(["status" => "error", "message" => $e->getMessage()]);
}
?>