initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
|
||||
$id = $data['id'];
|
||||
$sets = array();
|
||||
if(isset($data['nama'])) $sets[] = "nama='".$data['nama']."'";
|
||||
if(isset($data['status'])) $sets[] = "status='".$data['status']."'";
|
||||
if(isset($data['panjang'])) $sets[] = "panjang='".$data['panjang']."'";
|
||||
if(isset($data['geom'])){
|
||||
$geom = json_encode($data['geom']);
|
||||
$sets[] = "geom='".$geom."'";
|
||||
}
|
||||
|
||||
if(count($sets) > 0){
|
||||
$sql = "UPDATE jalan SET " . implode(",", $sets) . " WHERE id='".$id."'";
|
||||
$conn->query($sql);
|
||||
}
|
||||
|
||||
echo json_encode(["msg"=>"ok"]);
|
||||
?>
|
||||
Reference in New Issue
Block a user