예제 #1
0
 public function getrequisitionsstatusreportdataAction()
 {
     try {
         $this->_helper->layout->disableLayout();
         $param_arr = $this->_getAllParams();
         $cols_param_arr = $this->_getParam('cols_arr', array());
         if (isset($param_arr['cols_arr'])) {
             unset($param_arr['cols_arr']);
         }
         $page_no = isset($param_arr['page_no']) ? $param_arr['page_no'] : 1;
         $per_page = isset($param_arr['per_page']) ? $param_arr['per_page'] : PERPAGE;
         $sort_name = $this->_getParam('sort_name', NULL);
         $sort_type = $this->_getParam('sort_type', NULL);
         $total_grid_columns = $this->_getParam('total_grid_columns', NULL);
         if (isset($param_arr['page_no'])) {
             unset($param_arr['page_no']);
         }
         if (isset($param_arr['sort_name'])) {
             unset($param_arr['sort_name']);
         }
         if (isset($param_arr['sort_type'])) {
             unset($param_arr['sort_type']);
         }
         if (isset($param_arr['per_page'])) {
             unset($param_arr['per_page']);
         }
         if (isset($param_arr['total_grid_columns'])) {
             unset($param_arr['total_grid_columns']);
         }
         unset($param_arr['module']);
         unset($param_arr['controller']);
         unset($param_arr['action']);
         unset($param_arr['format']);
         $requisition_model = new Default_Model_Requisition();
         $auth = Zend_Auth::getInstance();
         if ($auth->hasIdentity()) {
             $loginUserId = $auth->getStorage()->read()->id;
             $loginuserGroup = $auth->getStorage()->read()->group_id;
         }
         $requisition_data = $requisition_model->getReportData($param_arr, $per_page, $page_no, $sort_name, $sort_type, $loginUserId, $loginuserGroup, 1);
         $page_cnt = $requisition_data['page_cnt'];
         $requisition_data = $requisition_data['rows'];
         $columns_array = array('requisition_code' => 'Requisition Code', 'job_title' => 'Job Title', 'req_status' => 'Requisition Status', 'created_by' => 'Raised By', 'reporting_manager_name' => 'Reporting Manager', 'approver1' => 'Approver -1', 'appstatus1' => 'Status', 'req_no_positions' => 'No.of positions', 'selected_members' => 'Filled positions', 'created_on' => 'Raised On', 'onboard_date' => 'Due Date');
         $mandatory_array = array('requisition_code' => 'Requisition Code', 'job_title' => 'Job title', 'req_status' => 'Requisition Status', 'created_by' => 'Raised By', 'reporting_manager_name' => 'Reporting Manager', 'approver1' => 'Approver -1', 'appstatus1' => 'Status', 'req_no_positions' => 'No.of positions', 'selected_members' => 'Filled positions', 'created_on' => 'Raised On', 'onboard_date' => 'Due Date');
         if (count($cols_param_arr) == 0) {
             $cols_param_arr = $mandatory_array;
         }
         $mandatory_array = array_keys($mandatory_array);
         $this->view->requisition_arr = $requisition_data;
         $this->view->columns_array = $columns_array;
         $this->view->mandatory_array = $mandatory_array;
         $this->view->page_cnt = $page_cnt;
         $this->view->per_page = $per_page;
         $this->view->page_no = $page_no;
         $this->view->cols_param_arr = $cols_param_arr;
         $this->view->sort_name = $sort_name;
         $this->view->sort_type = $sort_type;
         $this->view->total_grid_columns = $total_grid_columns;
     } catch (Exception $e) {
         exit($e->getMessage());
     }
 }