<?php
require '../monitoring/koneksi.php';

$stmt = $conn->prepare("
    UPDATE sites SET
        nama_site=?,
        code_site=?,
        lat=?,
        lon=?,
        alamat=?,
        email=?,
        no_tlp=?
    WHERE id=?
");

$stmt->bind_param(
    "sidssssi",
    $_POST['nama_site'],
    $_POST['code_site'],
    $_POST['lat'],
    $_POST['lon'],
    $_POST['alamat'],
    $_POST['email'],
    $_POST['no_tlp'],
    $_POST['id']
);

$stmt->execute();
echo json_encode(["status" => "updated"]);
