mirror of
https://github.com/rekywhyd/gis_tugas.git
synced 2026-07-09 03:13:08 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include 'config.php';
|
||||
|
||||
$type = $_POST['type']; // 'jalan' atau 'parsil'
|
||||
$nama = mysqli_real_escape_string($conn, $_POST['nama']);
|
||||
$status = $_POST['status'];
|
||||
$coords = $_POST['coords'];
|
||||
$nilai = $_POST['nilai'];
|
||||
|
||||
if ($type == 'jalan') {
|
||||
$sql = "INSERT INTO data_jalan (nama_jalan, status_jalan, geojson_data, panjang_jalan)
|
||||
VALUES ('$nama', '$status', '$coords', '$nilai')";
|
||||
} else {
|
||||
$sql = "INSERT INTO data_parsil (nomor_parsil, status_sertifikat, geojson_data, luas_m2)
|
||||
VALUES ('$nama', '$status', '$coords', '$nilai')";
|
||||
}
|
||||
|
||||
if (mysqli_query($conn, $sql)) {
|
||||
echo json_encode(['status' => 'success']);
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => mysqli_error($conn)]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user