18 lines
423 B
PHP
18 lines
423 B
PHP
<?php
|
|
require_once 'db_pdo.php';
|
|
require_once 'auth.php';
|
|
require_admin_login(true);
|
|
header('Content-Type: application/json');
|
|
|
|
try {
|
|
$stmt = $pdo->query("SELECT * FROM rumah_ibadah ORDER BY nama ASC");
|
|
$data = $stmt->fetchAll();
|
|
|
|
echo json_encode([
|
|
'success' => true,
|
|
'data' => $data
|
|
]);
|
|
} catch (Exception $e) {
|
|
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
|
|
}
|