$errorFields[] = 'userID'; throw new Exception('validation'); } $ajaxReturn['data'] = $adminService->deactivateUser($_GET['userID']); } elseif ($_GET['function'] === 'getJob') { if (!isset($_GET['jobID']) || !$adminService->isIntR($_GET['jobID'])) { $errorFields[] = 'jobID'; throw new Exception('validation'); } $ajaxReturn['data'] = $adminService->getJob($_GET['jobID']); } elseif ($_GET['function'] === 'getUser') { if (!isset($_GET['userID']) || !$adminService->isIntR($_GET['userID'])) { $errorFields[] = 'userID'; throw new Exception('validation'); } $ajaxReturn['data'] = $adminService->getUser($_GET['userID']); } elseif ($_GET['function'] === 'updateJob') { if (!isset($_GET['jobID']) || !$adminService->isIntR($_GET['jobID'])) { $errorFields[] = 'jobID'; } if (!isset($_GET['location']) || !$adminService->isStringR($_GET['location'])) { $errorFields[] = 'location'; } if (!isset($_GET['job']) || !$adminService->isStringR($_GET['job'])) { $errorFields[] = 'job'; } if (!isset($_GET['account']) || !$adminService->isStringR($_GET['account'])) { $errorFields[] = 'account'; } if (!isset($_GET['rate']) || !$adminService->isNumberR($_GET['rate'])) { $errorFields[] = 'rate';