top.window.location = '../../index.php'"; exit; } require_once __DIR__ . "/" . "../../includes/include_basics_only.php"; require_once __DIR__ . "/" . "../../includes/classes/ConnectPDO.php"; use includes\classes\ConnectPDO; $conn = ConnectPDO::getInstance(); $post = $_POST; $areaAdmin = 0; if (isset($_SESSION['s_area_admin']) && $_SESSION['s_area_admin'] == '1' && $_SESSION['s_nivel'] != '1') { $areaAdmin = 1; } if ((!isset($post['client']) || $post['client'] == '') && isset($post['origin']) && !empty($post['origin'])) { $data['']['department'] = TRANS('SEL_CLIENT_FIRST'); echo json_encode($data); return false; } $departments = []; $terms = ""; if (isset($post['client']) && !empty($post['client'])) { $departments = getDepartments($conn, null, null, null, $post['client']); } else { $departments = getDepartments($conn, null, null, null, null); } $data = $departments; echo json_encode($data);