<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');
require_once('../lib/dbclass.php');




$id = $_REQUEST['id'];

if ($id > 0) {
    $data = findQuery('select tbl_assembly.* from tbl_assembly left join tbl_district on tbl_district.id=tbl_assembly.district where tbl_assembly.status=0 and district=10 order by tbl_assembly.name asc');
} else {
    $data = findQuery('select tbl_assembly.* from tbl_assembly left join tbl_district on tbl_district.id=tbl_assembly.district where tbl_assembly.status=0 order by tbl_assembly.name asc');
}








if ($data) {
    for ($i = 0;$i < count($data);$i++) {
        $message = 'true';

        $data2[] = [


                'id'     => $data[$i]['id'],
                'name'   => $data[$i]['name'],
            'districtid' => $data[$i]['district'],



            ];
    }
} else {
    $message = 'false';
    $data2[] = ['error' => 'Not Found'];
}

echo json_encode(['Status' => $message, 'data' => $data2]);

return;

?>

