first commit

This commit is contained in:
Anderi Saputra
2026-06-10 17:00:19 +07:00
commit adec71e763
38 changed files with 9278 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
session_start();
$role = isset($_SESSION['role']) ? $_SESSION['role'] : '';
if ($role !== 'infrastruktur') { echo "unauthorized"; exit; }
include "koneksi.php";
$nama = $conn->real_escape_string($_POST['nama']);
$wa = $conn->real_escape_string($_POST['wa']);
$buka = $conn->real_escape_string($_POST['buka']);
$lat = doubleval($_POST['lat']);
$lng = doubleval($_POST['lng']);
$sql = "INSERT INTO tb_spbu (nama_spbu,no_wa,buka_24jam,latitude,longitude)
VALUES ('$nama','$wa','$buka','$lat','$lng')";
if($conn->query($sql)){
echo "success|".$conn->insert_id;
}else{
echo "error";
}
?>