<?php
include 'koneksi.php';

if (isset($_POST['nama_spbu'])) {
    $nama = $_POST['nama_spbu'];
    $pengelola = $_POST['nama_pengelola'];
    $wa = $_POST['no_wa'];
    $buka_24jam = $_POST['buka_24jam'];
    $lat = $_POST['lat'];
    $lng = $_POST['lng'];

    $sql = "INSERT INTO spbu (nama_spbu, nama_pengelola, no_wa, buka_24jam, lat, lng) 
            VALUES ('$nama', '$pengelola', '$wa', '$buka_24jam', '$lat', '$lng')";

    if ($conn->query($sql) === TRUE) {
        echo "Sukses";
    } else {
        echo "Error: " . $conn->error;
    }
}
$conn->close();
?>