Initial commit: Upload project WebGIS dengan tema Merah Putih

This commit is contained in:
2026-06-05 20:37:25 +07:00
commit 5857b15aec
28 changed files with 6445 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
include '../koneksi.php';
header('Content-Type: application/json');
$id = (int)($_POST['id'] ?? 0);
$nama = trim($_POST['nama'] ?? '');
$no_wa = trim($_POST['no_wa'] ?? '');
$buka_24 = trim($_POST['buka_24_jam'] ?? '');
$latitude = trim($_POST['latitude'] ?? '');
$longitude = trim($_POST['longitude'] ?? '');
if (!$id || !$nama || !$no_wa || !$buka_24 || !$latitude || !$longitude) {
echo json_encode(['status'=>'error','message'=>'Data tidak lengkap.']);
exit;
}
try {
$stmt = $pdo->prepare(
"UPDATE points SET nama=?, no_wa=?, buka_24_jam=?, latitude=?, longitude=? WHERE id=?"
);
$stmt->execute([$nama, $no_wa, $buka_24, $latitude, $longitude, $id]);
$stmtSelect = $pdo->prepare("SELECT * FROM points WHERE id=?");
$stmtSelect->execute([$id]);
$data = $stmtSelect->fetch(PDO::FETCH_ASSOC);
echo json_encode(['status'=>'success','data'=>$data]);
} catch (PDOException $e) {
echo json_encode(['status'=>'error','message'=>$e->getMessage()]);
}
?>