fix : dockerfile
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
sendJSON('error', 'Metode tidak diizinkan');
|
||||
}
|
||||
|
||||
$nama = sanitize($_POST['nama'] ?? '', $conn);
|
||||
$geojson = $_POST['geojson'] ?? ''; // Don't strip tags for JSON
|
||||
$tipe = sanitize($_POST['tipe'] ?? '', $conn);
|
||||
$keterangan = sanitize($_POST['keterangan'] ?? '', $conn);
|
||||
|
||||
if (empty($nama) || empty($geojson)) {
|
||||
sendJSON('error', 'Nama dan Data GeoJSON wajib diisi');
|
||||
}
|
||||
|
||||
$stmt = $conn->prepare("INSERT INTO fasilitas_polygon (nama, geojson, tipe, keterangan) VALUES (?, ?, ?, ?)");
|
||||
$stmt->bind_param("ssss", $nama, $geojson, $tipe, $keterangan);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
sendJSON('success', 'Data polygon berhasil disimpan');
|
||||
} else {
|
||||
sendJSON('error', 'Gagal menyimpan: ' . $stmt->error);
|
||||
}
|
||||
$stmt->close();
|
||||
?>
|
||||
Reference in New Issue
Block a user