Initial commit

This commit is contained in:
2026-06-13 13:38:52 +07:00
commit 1c9cc7dfbb
41 changed files with 6993 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
include 'db.php';
$data = json_decode(file_get_contents("php://input"), true);
$tipe = $data['tipe'];
$status = $data['status'] ?? '';
$nilai = $data['nilai'] ?? 0;
$geom = json_encode($data['geom']);
error_log("Save data: tipe=$tipe, status=$status, nilai=$nilai");
if($tipe == "jalan"){
$panjang = $nilai ? $nilai : 0;
$sql = "INSERT INTO data_unified (tipe, status, panjang, geom)
VALUES ('jalan', '$status', $panjang, '$geom')";
}
if($tipe == "parsil"){
$luas = $nilai ? $nilai : 0;
$sql = "INSERT INTO data_unified (tipe, status, luas, geom)
VALUES ('parsil', '$status', $luas, '$geom')";
}
if ($conn->query($sql) === TRUE) {
echo "Sukses";
} else {
echo "Error: " . $conn->error;
error_log("SQL Error: " . $conn->error);
}
?>