$sortBy = isset($_REQUEST['sortField']) ? $_REQUEST['sortField'] : null; $sortOrder = null; if ($sortBy != null) { $sortParam = "sortOrder" . $sortBy; if (isset($_REQUEST[$sortParam])) { $sortOrder = $_REQUEST[$sortParam]; } } if (isset($_REQUEST['pageNO'])) { $pageNO = $_REQUEST['pageNO']; } else { $pageNO = 1; } $leaveController->setId($id); $leaveController->setLeaveTypeId($leaveTypeId); $leaveController->editLeaves("summary", $year, $searchBy, $sortBy, $sortOrder, $pageNO); break; case 'Leave_Quota_Copy_Last_Year': $leaveController->copyLeaveQuotaFromLastYear($_GET['currYear']); break; case 'Leave_Brought_Forward_Copy_Last_Year': $leaveController->copyLeaveBroughtForwardFromLastYear(date('Y')); break; case 'Leave_Quota_Save': $objs = $leaveQuotaExtractor->parseEditData($_POST); $mes = "Empty record"; if (isset($objs)) { foreach ($objs as $obj) { $leaveController->setObjLeave($obj); $mes = $leaveController->saveLeaveQuota(); }