public function activeLoans($key = []) { //echo $key['loanno']; $route = 'active-loan-subsidiary'; $croute = 'active-loans'; $output = $this->view->render(VIEW_DIR . "templates/Loans/loans-option-page.html", $this->getActiveTab("1")); $data = UserDataService::getActiveLoans($this->getUserId()); $pagify = new Paginator($data); $data = $pagify->paginate(5); if (isset($_GET['showall'])) { $data = $pagify->showall(); } $tpl = VIEW_DIR . "templates/Loans/view-active-loans.php"; $output = $output . (require_once $tpl); if (!empty($key)) { $output = $output . $this->viewLoanSubsidiary($key['loanno']); } $this->setContent($output); }