<?php require_once __DIR__ . '/../app/bootstrap.php'; $district=(int)($_GET['district_id']??0); $rows=$district?App\Core\Database::fetchAll('SELECT id,name FROM areas WHERE district_id=? AND status="active" ORDER BY name',[$district]):App\Core\Database::fetchAll('SELECT id,name FROM districts WHERE status="active" ORDER BY name'); App\Core\Response::json(['ok'=>true,'data'=>$rows]);
