<?php

session_start();

if(!isset($_SESSION['role'])){

    header("Location: ../index.php");
    exit;
}

if($_SESSION['role'] != 'admin'){

    header("Location: ../index.php");
    exit;
}

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

$nama =
mysqli_real_escape_string(
$conn,
$_POST['nama']
);

$alamat =
mysqli_real_escape_string(
$conn,
$_POST['alamat']
);

$latitude = $_POST['latitude'];
$longitude = $_POST['longitude'];

mysqli_query($conn,

"INSERT INTO rumah_ibadah
(nama,alamat,latitude,longitude)

VALUES

('$nama','$alamat','$latitude','$longitude')"

);

header("Location: rumah_ibadah.php");

?>