<?php

header('Content-Type: application/json');

include '../config/koneksi.php';

$nomor_parsil = $_POST['nomor_parsil'] ?? '';
$status       = $_POST['status'] ?? '';
$luas         = $_POST['luas'] ?? 0;
$geom         = $_POST['geom'] ?? '';

$query = mysqli_query(
    $conn,
    "INSERT INTO parsil_tanah (
        nomor_parsil,
        status_kepemilikan,
        luas,
        geom
    ) VALUES (
        '$nomor_parsil',
        '$status',
        '$luas',
        '$geom'
    )"
);

echo json_encode([
    "success" => $query
]);