<?php

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

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

$nama_jalan   = $_POST['nama_jalan'] ?? '';
$status_jalan = $_POST['status_jalan'] ?? '';
$panjang      = $_POST['panjang'] ?? 0;
$geom         = $_POST['geom'] ?? '';

$query = mysqli_query(
    $conn,
    "INSERT INTO jalan (
        nama_jalan,
        status_jalan,
        panjang,
        geom
    ) VALUES (
        '$nama_jalan',
        '$status_jalan',
        '$panjang',
        '$geom'
    )"
);

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