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
+38
View File
@@ -0,0 +1,38 @@
<?php
header('Content-Type: application/json');
// Konfigurasi Database (Sesuaikan dengan milik Anda)
$host = "localhost";
$user = "root";
$pass = "";
$db = "webgis"; // UBAH INI
$conn = new mysqli($host, $user, $pass, $db);
if ($conn->connect_error) {
echo json_encode(["status" => "error", "message" => "Koneksi database gagal"]);
exit;
}
$data = json_decode(file_get_contents("php://input"), true);
if ($data && isset($data['id'])) {
$id = $data['id'];
// Hapus data dari tabel jalan_polyline berdasarkan ID
$stmt = $conn->prepare("DELETE FROM jalan_polyline WHERE id = ?");
$stmt->bind_param("i", $id);
if ($stmt->execute()) {
echo json_encode(["status" => "success", "message" => "Garis jalan berhasil dihapus"]);
} else {
echo json_encode(["status" => "error", "message" => "Gagal menghapus data: " . $stmt->error]);
}
$stmt->close();
} else {
echo json_encode(["status" => "error", "message" => "ID tidak valid"]);
}
$conn->close();
?>