function checkNghiHuu() { $employeesModel = new Front_Model_Employees(); $list_employees = $employeesModel->getNghiHuu(array())->toArray(); if (sizeof($list_employees)) { return 1; } return 0; }
public function nghihuuAction() { $translate = Zend_Registry::get('Zend_Translate'); $this->view->title = 'Quản lý cán bộ sắp nghỉ hưu - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED; $option = array('layout' => '1_column/layout', 'layoutPath' => $layoutPath); Zend_Layout::startMvc($option); $pb_selected = $this->_getParam('phongban', 0); $chucvuModel = new Front_Model_Chucvu(); $list_chuc_vu = $chucvuModel->fetchData(array('cv_status' => 1)); $ngachcongchucModel = new Front_Model_NgachCongChuc(); $list_ngach_cong_chuc = $ngachcongchucModel->fetchData(array('ncc_status' => 1)); $phongbanModel = new Front_Model_Phongban(); $list_phong_ban = $phongbanModel->fetchAll(); $phong_ban = array(); $list_phong_ban_option = $phongbanModel->fetchData(0, $phong_ban); $phong_ban_choosed = array(); $phongbanModel->fetchData($pb_selected, $phong_ban_choosed); $pb_ids = array($pb_selected); foreach ($phong_ban_choosed as $pb) { $pb_ids[] = $pb->pb_id; } $employeesModel = new Front_Model_Employees(); if (!$pb_selected) { $list_employees = $employeesModel->getNghiHuu(array()); } else { $list_employees = $employeesModel->getNghiHuu($pb_ids); } $paginator = Zend_Paginator::factory($list_employees); $paginator->setItemCountPerPage(NUM_PER_PAGE); $paginator->setCurrentPageNumber($this->_page); $this->view->page = $this->_page; $this->view->pb_id = $pb_selected; $this->view->paginator = $paginator; $this->view->list_chuc_vu = $list_chuc_vu; $this->view->list_phong_ban = $list_phong_ban; $this->view->list_phong_ban_option = $list_phong_ban_option; $this->view->list_ngach_cong_chuc = $list_ngach_cong_chuc; }