function ajaxToggleStatus($param = NULL) { try { if (!$this->user->isAdmin) { throw new Exception("Access Denied"); } $userOperator = new UserBatchOperator(); $userOperator->toggleStatus($param["userId"]); $result["error"] = "0"; $result["msg"] = "Account is toggled."; } catch (Exception $ex) { $result["error"] = "1"; $result["msg"] = $ex->getMessage(); } echo json_encode($result); }