return false; } else { echo header('Content-Type: application/json'); echo json_encode($business_orgs); } } ?> <?php if (!empty($_GET['org_type']) && $_GET['org_type'] == 'inventory_org') { $org = new org(); $inventory_orgs = $org->findAll_inventory(); if (count($inventory_orgs) == 0) { return false; } else { echo json_encode($inventory_orgs); } } ?> <?php if (!empty($_GET['org_type']) && $_GET['org_type'] == 'legal_org') { $org = new org(); $legal_orgs = $org->findAll_legal(); if (count($legal_orgs) == 0) { return false; } else { echo json_encode($legal_orgs); } }