- Timestamp:
- Apr 7, 2015 1:52:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/report.php
r818 r883 15 15 public function index() { 16 16 $data = array(); 17 17 18 $admin_info = $this->session->userdata('adminInfo'); 18 19 if ($admin_info) { 19 20 $data['statistics'] = $this->getStatistics(); 20 21 $data['content'] = $this->getPaidlogs(); 21 22 $this->load->view('report/index', $data); … … 30 31 return $this->load->view('report/statistics', $data, true); 31 32 } 32 33 33 34 34 35 public function getPaidlogs($filters = array()) { … … 69 70 $data ['paid_type'] = ( int ) $this->input->post ( 'paid_type' ); 70 71 } 71 72 72 $data['daterange_start'] = ""; 73 73 $data['daterange_end'] = ""; … … 78 78 } 79 79 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 80 80 81 $data['total'] = $this->paidlog_model->countPaidlog($data); 81 $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data)['paid_logs']; 82 $data['total_amount'] = $this->paidlog_model->getPaidlogs($data)['total_amount']; 82 $result = $this->paidlog_model->getPaidlogs($data); 83 $data['paidlogs'] = $result['paid_logs']; 84 $data['total_amount'] = $result['total_amount']; 83 85 84 86 $data['paging_url'] = base_url() . "/admin/doanh_thu_tong_hop/trang/"; 85 87 $data['num_links'] = 2; 86 88 $data['paging'] = pagging($data); 89 90 87 91 foreach ($data['paidlogs'] as $index => $paidlog) { 88 92 $data['paidlogs'][$index]['username'] = @$this->get_fullname($paidlog['us_id']); … … 93 97 } 94 98 return $this->load->view('report/listview', $data, true); 99 95 100 } 96 101 … … 137 142 } 138 143 } 139 144 140 145 public function export(){ 146 141 147 $this->load->model('paidlog_model'); 142 148 $data ['paid_types'] = array ( … … 157 163 $data['daterange_end'] = date('Y-m-d 23:59:59', strtotime($daterange[1])); 158 164 } 165 159 166 $data['total'] = $this->paidlog_model->countPaidlog($data); 160 $data['paidlogs'] = $this->paidlog_model->getPaidlogs($data)['paid_logs']; 161 $data['total_amount'] = $this->paidlog_model->getPaidlogs($data)['total_amount']; 167 $result = $this->paidlog_model->getPaidlogs($data); 168 $data['paidlogs'] = $result['paid_logs']; 169 $data['total_amount'] = $result['total_amount']; 162 170 163 171 foreach ($data['paidlogs'] as $index => $paidlog) { … … 177 185 178 186 179 187 180 188 $sheet->setCellValue('B1', "TẬP ÄOÃN VIá»N THÃNG QUÃN Äá»I"); 181 189 $style = array( … … 278 286 ) 279 287 ); 280 288 281 289 $dem=0; 282 290 foreach ($data['paidlogs'] as $index => $paidlog) { … … 297 305 $dem++; 298 306 } 307 299 308 $writer = new PHPExcel_Writer_Excel5($this->phpexcel); 300 309 header('Content-Type: application/vnd.ms-excel'); 301 310 header('Content-Disposition: attachment; filename="bao_cao_tong_hop_'.date('d-m-Y').'.xls"'); 302 311 $writer->save('php://output'); 312 303 313 } 304 314 }
Note: See TracChangeset
for help on using the changeset viewer.