Пример #1
0
 /**
  * This is used to export schedule report in pdf.
  */
 public function interviewrptpdfAction()
 {
     $this->_helper->layout->disableLayout();
     $param_arr = array();
     $param_arr['interview_date'] = $this->_getParam('interview_date', null);
     $param_arr['requisition_id'] = $this->_getParam('req_id', null);
     $param_arr['interviewer_id'] = $this->_getParam('interviewer_id', null);
     $param_arr['department_id'] = $this->_getParam('department_id', null);
     $param_arr['ins.created_by'] = $this->_getParam('created_by', null);
     $page_no = $this->_getParam('page_no', 1);
     $per_page = $this->_getParam('per_page', PERPAGE);
     $sort_name = $this->_getParam('sort_name', null);
     $sort_type = $this->_getParam('sort_type', null);
     $cols_param_arr = $this->_getParam('cols_arr', array());
     $req_model = new Default_Model_Requisition();
     $req_data = $req_model->getdata_for_interviewrpt($param_arr, $sort_name, $sort_type, $page_no, $per_page);
     $page_cnt = $req_data['page_cnt'];
     $req_arr = $req_data['rows'];
     $field_names = array();
     $field_widths = array();
     $data['field_name_align'] = array();
     foreach ($cols_param_arr as $column_key => $column_name) {
         $field_names[] = array('field_name' => $column_key, 'field_label' => $column_name);
         $field_widths[] = 25;
         $data['field_name_align'][] = 'C';
     }
     if (count($cols_param_arr) != 7) {
         $totalPresentFieldWidth = array_sum($field_widths);
         foreach ($field_widths as $key => $width) {
             $field_widths[$key] = $width * 180 / $totalPresentFieldWidth;
         }
     }
     $data = array('grid_no' => 1, 'project_name' => '', 'object_name' => 'Scheduled Interviews', 'grid_count' => 1, 'file_name' => 'Scheduled_interviews.pdf');
     $pdf = $this->_helper->PdfHelper->generateReport($field_names, $req_arr, $field_widths, $data);
     $this->_helper->json(array('file_name' => $data['file_name']));
 }