18 lines
400 B
PHP
18 lines
400 B
PHP
<?php
|
|
include 'koneksi.php';
|
|
|
|
// ambil data JSON dari JS
|
|
$data = json_decode(file_get_contents("php://input"), true);
|
|
|
|
$id = $data['id'];
|
|
$geom = json_encode($data['geom']);
|
|
$type = $data['type'];
|
|
|
|
if ($type == 'jalan') {
|
|
$conn->query("UPDATE jalan SET geom='$geom' WHERE id=$id");
|
|
} elseif ($type == 'kavling') {
|
|
$conn->query("UPDATE kavling SET geom='$geom' WHERE id=$id");
|
|
}
|
|
|
|
echo "OK";
|
|
?>
|