first commit
This commit is contained in:
@@ -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";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user