Sindbad~EG File Manager

Current Path : /home/copmadinaarea/thecopmadinaarea.org/portal/api/
Upload File :
Current File : /home/copmadinaarea/thecopmadinaarea.org/portal/api/get-assemblies.php

<?php
require_once '../config/config.php';

header('Content-Type: application/json');

if (!isLoggedIn()) {
    echo json_encode([]);
    exit();
}

$districtId = $_GET['district_id'] ?? 0;

if (!$districtId) {
    echo json_encode([]);
    exit();
}

$db = Database::getInstance()->getConnection();
$stmt = $db->prepare("SELECT id, assembly_name, assembly_code FROM assemblies WHERE district_id = :district_id AND is_active = 1 ORDER BY assembly_name");
$stmt->execute(['district_id' => $districtId]);

echo json_encode($stmt->fetchAll());

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists