19 lines
515 B
PHP
19 lines
515 B
PHP
<?php
|
|
require_once '../../auth.php';
|
|
requireRole('admin', 'operator');
|
|
|
|
header('Content-Type: application/json');
|
|
$conn = new mysqli("localhost", "root", "", "webgis");
|
|
|
|
$id = (int) $_GET['id'];
|
|
$stmt = $conn->prepare("SELECT * FROM rumah_ibadah WHERE id = ?");
|
|
$stmt->bind_param("i", $id);
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
$data = $result->fetch_assoc();
|
|
|
|
echo $data ? json_encode($data) : json_encode(["status" => "error", "message" => "Data tidak ditemukan"]);
|
|
|
|
$stmt->close();
|
|
$conn->close();
|
|
?>
|