Changeset 883
- Timestamp:
- Apr 7, 2015 1:52:40 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode
- Files:
-
- 26 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/config/routes.php
r821 r883 136 136 $route['frontend/lecture/help.pdf'] = 'frontend/lecture/help'; 137 137 138 $route['cong_tac_vien'] = 'collaborator/home'; 139 $route['collaborator'] = 'collaborator/home'; 140 $route['cong_tac_vien/:any'] = 'collaborator/home/viewAsistant'; 141 $route['cong_tac_vien/thong_ke_nguoi_dung/trang/:any'] = 'collaborator/home/getCollaboratorsUsers/$1'; 142 $route['cong_tac_vien/nguoi_dung'] = 'collaborator/user'; 143 $route['cong_tac_vien/thong_tin_ca_nhan'] = 'collaborator/collaborator/profile'; 144 //$route['cong_tac_vien/thong_tin_ca_nhan/thay_doi_mat_khau/:any'] = 'collaborator/collaborator/change_password/$1'; 145 138 146 /* End of file routes.php */ 139 147 /* Location: ./application/config/routes.php */ -
pro-violet-viettel/sourcecode/application/language/message/messages_lang.php
r818 r883 21 21 $lang['_SBG_ADMIN_LOGIN_NAME_REQUIRED_MSG'] = 'Chưa nháºp tà i khoản admin'; 22 22 $lang['_SBG_ADMIN_PASSWORD_REQUIRED_MSG'] = 'Vui lòng nháºp máºt khẩu'; 23 24 // collaborator 25 $lang['_SBG_COLLABORATOR_LOGIN_FAIL_MSG'] = 'Sai username hoặc password!'; 26 $lang['_SBG_COLLABORATOR_LOGIN_NAME_REQUIRED_MSG'] = 'Chưa nháºp tà i khoản cá»ng tác viên'; 27 $lang['_SBG_COLLABORATOR_PASSWORD_REQUIRED_MSG'] = 'Vui lòng nháºp máºt khẩu'; 23 28 24 29 // frontend -
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 } -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportpackage.php
r818 r883 29 29 30 30 $this->load->model('reportmodel'); 31 $data['date']= 1;31 $data['date']=date("d"); 32 32 $data['month'] = date("m"); 33 33 $data['year'] = date("Y"); 34 $data['to_date']= 31;34 $data['to_date']= date("d"); 35 35 $data['to_month'] = date("m"); 36 36 $data['to_year'] = date("Y"); 37 37 if ($this->input->post('month')) { 38 $data['date']= $this->input->post('date'); 38 39 $data['month'] = $this->input->post('month'); 39 40 $data['year'] = $this->input->post('year'); 41 $data['to_date'] = $this->input->post('to_date'); 42 $data['to_month'] = $this->input->post('to_month'); 43 $data['to_year'] = $this->input->post('to_year'); 40 44 } 41 45 $data = $this->getdays($data); … … 70 74 public function export() { 71 75 $this->load->model('reportmodel'); 72 $data['date']=1; 73 $data['month'] = $this->uri->segment(4); 74 $data['year'] = $this->uri->segment(5); 75 $data['to_date']=31; 76 $data['to_month'] = date("m"); 77 $data['to_year'] = date("Y"); 78 $data = $this->getdays($data); 76 //$data['date']=1; 77 $data['date'] = $this->uri->segment(4); 78 $data['month'] = $this->uri->segment(5); 79 $data['year'] = $this->uri->segment(6); 80 $data['to_date'] = $this->uri->segment(8); 81 $data['to_month'] = $this->uri->segment(9); 82 $data['to_year'] = $this->uri->segment(10); 83 //$data = $this->getdays($data); 79 84 $result = $this->reportmodel->getPackages($data); 80 85 $data['provinces'] = $result['provinces']; … … 85 90 $sheet = $this->phpexcel->getActiveSheet(); 86 91 $sheet->setTitle("bao cao thue bao " . $data['month'] . " - " . $data['year']); 87 $sheet->getColumnDimension('A')->setWidth(10);92 $sheet->getColumnDimension('A')->setWidth(10); 88 93 $sheet->getColumnDimension('B')->setWidth(25); 89 $sheet->getColumnDimension('C')->setWidth( 15);94 $sheet->getColumnDimension('C')->setWidth(25); 90 95 $sheet->getColumnDimension('D')->setWidth(15); 91 96 $sheet->getColumnDimension('E')->setWidth(15); 92 97 $sheet->getColumnDimension('F')->setWidth(15); 93 98 $sheet->getColumnDimension('G')->setWidth(15); 94 $sheet->getColumnDimension('H')->setWidth(15); 95 $sheet->setCellValue('A1', "Báo cáo doanh thu theo tá»nh"); 96 $sheet->setCellValue('A2', "Thá»i gian: " . $data['month'] . " - " . $data['year']); 97 $sheet->setCellValue('A4', "STT"); 98 $sheet->setCellValue('B4', "Mã Tá»nh/Thà nh phá»"); 99 $sheet->setCellValue('C4', "Tá»nh/Thà nh phá»"); 99 $sheet->getColumnDimension('H')->setWidth(15); 100 $sheet->getColumnDimension('I')->setWidth(15); 101 $sheet->getColumnDimension('J')->setWidth(15); 102 103 $sheet->setCellValue('B1', "TẬP ÄOÃN VIá»N THÃNG QUÃN Äá»I"); 104 $style = array( 105 'font' => array('bold' => true, 'size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 106 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 107 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 108 'wrap' => true ) 109 ); 110 $sheet->mergeCells('B1:K1'); 111 $sheet->getStyle('B1')->applyFromArray($style); 112 113 $sheet->setCellValue('B2', "Tá»NG CÃNG TY VIá»N THÃNG VIETTEL"); 114 115 $style = array( 116 'font' => array('size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 117 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 118 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 119 'wrap' => true ) 120 ); 121 $sheet->mergeCells('B2:K2'); 122 $sheet->getStyle('B2')->applyFromArray($style); 123 124 $style = array( 125 'font' => array('bold' => true,'size' => 12, 'name' =>'Cambria'), 126 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 127 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 128 'wrap' => true ) 129 ); 130 $sheet->setCellValue('A4', "BÃO CÃO DOANH THU THEO Tá»NH"); 131 $sheet->mergeCells('A4:L4'); 132 $sheet->getStyle('A4:L4')->applyFromArray($style); 133 134 135 $style = array( 136 'font' => array('size' => 11, 'name' =>'Cambria'), 137 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_LEFT, 138 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 139 'wrap' => true ), 140 'borders' => array( 141 'allborders' => array( 142 'style' => \PHPExcel_Style_Border::BORDER_THIN 143 ) 144 ) 145 ); 146 147 $sheet->setCellValue('B6', "Từ ngà y: ".$data['date']."/".$data['month']."/".$data['year']); 148 $sheet->setCellValue('C6', "Äến ngà y: ".$data['to_date']."/".$data['to_month']."/".$data['to_year']); 149 $sheet->setCellValue('B7', "Ngà y kết xuất: ".date("d")."/".date("m")."/".date("Y")); 150 $sheet->setCellValue('C7', "Nhân viên kết xuất: "); 151 152 $sheet->getStyle('B6:C7')->applyFromArray($style); 153 154 $style = array( 155 'font' => array('bold' => true, 'size' => 11, 'name' =>'Cambria'), 156 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 157 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 158 'wrap' => true ), 159 'borders' => array( 160 'allborders' => array( 161 'style' => \PHPExcel_Style_Border::BORDER_THIN 162 ) 163 ) 164 ); 165 166 $sheet->setCellValue('A9', "STT"); 167 $sheet->setCellValue('B9', "Mã Tá»nh/Thà nh phá»"); 168 $sheet->setCellValue('C9', "Tá»nh/Thà nh phá»"); 169 $sheet->getStyle('A9:C9')->applyFromArray($style); 170 100 171 $chars = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"); 101 172 $dem = 2; 102 $stt =1;173 $stt = 1; 103 174 foreach ($data['packages'] as $package) { 104 175 $dem++; 105 $sheet->setCellValue($chars[$dem] . " 4", $package['p_name']);176 $sheet->setCellValue($chars[$dem] . "9", $package['p_name']); 106 177 $dem++; 107 $sheet->setCellValue($chars[$dem] . " 4", "Tá» lá» %");178 $sheet->setCellValue($chars[$dem] . "9", "Tá» lá» %"); 108 179 109 180 $stt++; 110 181 } 111 182 $dem++; 112 $sheet->setCellValue($chars[$dem] . ($index + 4), "Tá»ng TB"); 113 114 $stt=1; 183 $sheet->setCellValue($chars[$dem] . ($index + 9), "Tá»ng TB"); 184 $sheet->getStyle('A9:'.$chars[$dem] . ($index + 9))->applyFromArray($style); 185 186 //$sheet->getStyle($chars[$dem].($index + 9))->applyFromArray($style); 187 188 $sheet->setCellValue('A10', "Tá»ng"); 189 $sheet->mergeCells('A10:C10'); 190 $sheet->getStyle('A10:'.$chars[$dem].($index + 10))->applyFromArray($style); 191 192 $dem = 2; 193 194 foreach ($data['totalVip'] as $vipName=>$totalVip){ 195 $dem++; 196 $sheet->setCellValue($chars[$dem] . '10', $totalVip); 197 $sheet->getStyle($chars[$dem] . '10')->applyFromArray($style); 198 $dem++; 199 } 200 201 //$sheet->getStyle('A10:'.$chars[$dem].($index + 10))->applyFromArray($style); 202 203 $styleSTT = array( 204 'font' => array('size' => 11, 'name' =>'Cambria'), 205 'alignment' => array('bold' => true, 206 'horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 207 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 208 'wrap' => true ), 209 'borders' => array( 210 'allborders' => array( 211 'style' => \PHPExcel_Style_Border::BORDER_THIN 212 ) 213 ) 214 ); 215 216 $style = array( 217 'font' => array('size' => 11, 'name' =>'Cambria'), 218 'alignment' => array('bold' => true, 219 'horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_LEFT, 220 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 221 'wrap' => true ), 222 'borders' => array( 223 'allborders' => array( 224 'style' => \PHPExcel_Style_Border::BORDER_THIN 225 ) 226 ) 227 ); 228 229 $stt=1; 115 230 foreach ($data['provinces'] as $index => $provinces) { 116 231 117 $sheet->setCellValue('A' . ($stt + 5), $provinces['stt']); 118 $sheet->setCellValue('B' . ($stt + 5), $index); 119 $sheet->setCellValue('C' . ($stt + 5), $provinces['province']); 232 $sheet->setCellValue('A' . ($stt + 10), $provinces['stt']); 233 $sheet->getStyle('A'.($stt + 10))->applyFromArray($styleSTT); 234 $sheet->setCellValue('B' . ($stt + 10), $index); 235 $sheet->setCellValue('C' . ($stt + 10), $provinces['province']); 236 $sheet->getStyle('B'.($stt + 10).":C".($stt + 10))->applyFromArray($style); 120 237 $dem = 2; 121 238 foreach ($provinces['packages'] as $package) { 122 239 $dem++; 123 $sheet->setCellValue($chars[$dem] . ($stt + 5), $package['total']); 240 $sheet->setCellValue($chars[$dem] . ($stt + 10), $package['total']); 241 $sheet->getStyle($chars[$dem] . ($stt + 10))->applyFromArray($style); 124 242 $dem++; 125 $sheet->setCellValue($chars[$dem] . ($stt + 5), $package['percent']); 243 $sheet->setCellValue($chars[$dem] . ($stt + 10), $package['percent']); 244 $sheet->getStyle($chars[$dem] . ($stt + 10))->applyFromArray($style); 126 245 } 127 246 $dem++; 128 247 129 $sheet->setCellValue($chars[$dem] . ($stt + 5), $provinces['total']); 248 $sheet->setCellValue($chars[$dem] . ($stt + 10), $provinces['total']); 249 $sheet->getStyle($chars[$dem] . ($stt + 10))->applyFromArray($style); 250 130 251 $stt++; 131 252 } 253 254 132 255 $writer = new PHPExcel_Writer_Excel5($this->phpexcel); 133 header('Content-Disposition: attachment; filename="doanh_thu_' . $data['month'] . "_" . $data['year'] . '.xls"');256 header('Content-Disposition: attachment; filename="doanh_thu_'. $data['date'] . "_" . $data['month'] . "_" . $data['year'] .'-'. $data['to_date'] . "_" . $data['to_month'] . "_" . $data['to_year'] . '.xls"'); 134 257 $writer->save('php://output'); 135 258 } -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportprovince.php
r818 r883 30 30 31 31 $this->load->model('reportmodel'); 32 $data['date'] = date("d");32 $data['date'] = 1; 33 33 $data['month'] = date("m"); 34 34 $data['year'] = date("Y"); … … 37 37 $data['to_year'] = date("Y"); 38 38 if ($this->input->post()) { 39 $data['date'] = $this->input->post('date'); 40 $data['month'] = $this->input->post('month'); 41 $data['year'] = $this->input->post('year'); 39 //$data['month'] = $this->input->post('month'); 40 //$data['year'] = $this->input->post('year'); 41 $data['month'] = $this->input->post('to_month'); 42 $data['year'] = $this->input->post('to_year'); 42 43 $data['to_date'] = $this->input->post('to_date'); 43 44 $data['to_month'] = $this->input->post('to_month'); … … 130 131 public function exportProvince(){ 131 132 $this->load->model('reportmodel'); 132 $data['date'] = date("d");133 $data['date'] = 1; 133 134 $data['month'] = $this->uri->segment(4); 134 135 $data['year'] = $this->uri->segment(5); … … 137 138 $data['to_year'] = date("Y"); 138 139 if ($this->input->post()) { 139 $data['date'] = $this->input->post('date');140 $data['month'] = $this->input->post(' month');141 $data['year'] = $this->input->post(' year');140 //$data['date'] = $this->input->post('date'); 141 $data['month'] = $this->input->post('to_month'); 142 $data['year'] = $this->input->post('to_year'); 142 143 $data['to_date'] = $this->input->post('to_date'); 143 144 $data['to_month'] = $this->input->post('to_month'); … … 362 363 $writer = new PHPExcel_Writer_Excel5($this->phpexcel); 363 364 header('Content-Type: application/vnd.ms-excel'); 364 header('Content-Disposition: attachment; filename="thue_bao_va_doanh_thu_theo_tinh_' . $data["date"]. $data['month'] . $data['year']."_".$data["to_date"]. $data['to_month']. $data['to_year'] . '.xls"');365 header('Content-Disposition: attachment; filename="thue_bao_va_doanh_thu_theo_tinh_' . $data["to_date"].'_'. $data['to_month'].'_'. $data['to_year'] . '.xls"'); 365 366 $writer->save('php://output'); 366 367 } -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
r770 r883 27 27 $this->load->helper ( 'pagging' ); 28 28 $this->load->model ( 'user_model' ); 29 29 30 $provinces = lang('_PROVINCES_'); 30 31 error_log(var_export($provinces, TRUE), 3, '/srv/www/sbg/log/provinces.log'); … … 50 51 } 51 52 $data['provinces'] = $provinces; 52 $data['province_code'] = ''; 53 if ($this->input->post ( 'province-code' )) { 54 $data ['province_code'] = $this->input->post ( 'province-code' ); 53 $data['province'] = ''; 54 if ($this->input->post ( 'province' )) { 55 $data ['province'] = $this->input->post ( 'province' ); 56 } 57 if ($data['province']) 58 $data['districts'] = $this->user_model->getDistrictByProvince($data ['province']); 59 if ($this->input->post ( 'district' )) { 60 $data['district'] = $this->input->post ( 'district' ); 55 61 } 56 62 $data ['keyword'] = ""; … … 58 64 $data ['sorting_field'] = "created_time"; 59 65 if ($this->input->post ( 'sorting_order' )) { 60 if ($this->input->post ( 'sorting_ord er' ) != "sorting") {66 if ($this->input->post ( 'sorting_ord er' ) != "sorting") { 61 67 $data ['sorting_order'] = $this->input->post ( 'sorting_order' ); 62 68 $data ['sorting_field'] = $this->input->post ( 'sorting_field' ); … … 84 90 85 91 foreach ( $us as $u ) { 92 $dist = $this->user_model->getDistrictByIdAndProvince($u['district'], $u['province']); 93 $u['district_name'] = $dist['type']." ".$dist['district_name']; 86 94 $u ['province'] = isset($provinces[$u ['province']]) ? $provinces[$u ['province']] : $u ['province']; 95 87 96 $userinfo = $this->get_userinfo ( $u ['us_id'] ); 88 97 if ($userinfo) { … … 171 180 $this->load->model ( 'user_model' ); 172 181 $data = $this->user_model->get_user_info ( $src, $us_id, $token ); 173 // var_dump($data);174 182 $result = array (); 175 183 parse_str ( $data, $result ); 176 184 return $result; 185 } 186 187 public function export(){ 188 189 $this->load->helper ( 'pagging' ); 190 $this->load->model ( 'user_model' ); 191 $provinces = lang('_PROVINCES_'); 192 193 $data ['current_page'] = $this->uri->segment ( 4, 1 ); 194 $data ['itemsoptions'] = array ( 195 10, 196 25, 197 50, 198 100 199 ); 200 201 $data ['perpage'] = $this->uri->segment (5, 10); 202 $data ['statusoptions'] = array ( 203 0 => "Tất cả", 204 1 => "Äã ÄÄng kÜ VIP", 205 2 => "Dùng thá» 7 ngà y", 206 3=> "Dùng thá» hạn chế", 207 4=> "Hết hạn" 208 ); 209 $data ['status'] = $this->uri->segment (7, 0); 177 210 /* 178 * if (strpos($data, '&')){ $arr_users = explode("&", $data); $str_username = $arr_users[1]; $arr_username = explode("=", $str_username); return $arr_username[1]; }else { return ""; } 179 */ 180 } 211 if ($this->input->post ( 'status' )) { 212 $data ['status'] = ( int ) $this->input->post ( 'status' ); 213 } 214 */ 215 $data['provinces'] = $provinces; 216 $data['province'] = $this->uri->segment (8); 217 if ($data['province'] == 'default') $data['province'] = null; 218 if ($this->input->post ( 'province' )) { 219 $data ['province'] = $this->input->post ( 'province' ); 220 } 221 if ($data['province']) 222 $data['districts'] = $this->user_model->getDistrictByProvince($data ['province']); 223 if ($this->input->post ( 'district' )) { 224 $data['district'] = $this->input->post ( 'district' ); 225 } 226 227 $data['district'] = $this->uri->segment (9); 228 if ($data['district'] == 'default') $data['district'] = null; 229 $data ['keyword'] = $this->uri->segment (6); 230 if ($data['keyword'] == 'default') $data['keyword'] = null; 231 $data ['sorting_order'] = "sorting_desc"; 232 $data ['sorting_field'] = "created_time"; 233 $data ['sorting_order'] = $this->uri->segment (11); 234 $data ['sorting_field'] = $this->uri->segment (12); 235 236 if ($this->input->post ( 'sorting_order' )) { 237 if ($this->input->post ( 'sorting_order' ) != "sorting") { 238 $data ['sorting_order'] = $this->input->post ( 'sorting_order' ); 239 $data ['sorting_field'] = $this->input->post ( 'sorting_field' ); 240 } 241 } 242 243 if ($this->input->post ( 'items' )) { 244 $data ['perpage'] = $this->input->post ( 'items' ); 245 } 246 247 if ($this->input->post ( 'keyword' )) { 248 $data ['keyword'] = $this->input->post ( 'keyword' ); 249 } 250 251 $data ['daterange_start'] = ""; 252 $data ['daterange_end'] = ""; 253 $daterange = $this->uri->segment (10); 254 if ($daterange == 'default') $daterange = null; 255 if($daterange){ 256 $daterange = explode ( " - ", $daterange ); 257 $daterange [0] = str_replace ( '/', '-', $daterange [0] ); 258 $daterange [1] = str_replace ( '/', '-', $daterange [1] ); 259 $data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) ); 260 $data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) ); 261 } 262 if ($this->input->post ( 'daterange' )) { 263 $daterange = explode ( " - ", $this->input->post ( 'daterange' ) ); 264 $daterange [0] = str_replace ( '/', '-', $daterange [0] ); 265 $daterange [1] = str_replace ( '/', '-', $daterange [1] ); 266 $data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) ); 267 $data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) ); 268 } 269 $data ['start'] = ($data ['current_page'] - 1) * $data ['perpage']; 270 $data ['total'] = $this->user_model->get_total_users ( $data ); 271 $us = $this->user_model->get_list_users ( $data ); 272 $users = array (); 273 274 foreach ( $us as $u ) { 275 $dist = $this->user_model->getDistrictByIdAndProvince($u['district'], $u['province']); 276 $u['district_name'] = $dist['type']." ".$dist['district_name']; 277 $u ['province'] = isset($provinces[$u ['province']]) ? $provinces[$u ['province']] : $u ['province']; 278 279 $userinfo = $this->get_userinfo ( $u ['us_id'] ); 280 if ($userinfo) { 281 $u ['username'] = $userinfo ['username']; 282 $u['fullname'] = $userinfo['fullname']; 283 } 284 285 if (strtotime($u['expire_date']) > time() && $u['p_id'] != 5 ){ 286 $u['status'] = 'Äã ÄÄng kÜ VIP'; 287 }elseif(strtotime($u['expire_date']) > time() && $u['p_id'] == 5){ 288 $u['status'] = 'Dùng thá» 7 ngà y'; 289 }elseif(strtotime($u['expire_date']) < time() && $u['p_id'] == 5){ 290 $u['status'] = 'Dùng thá» hạn chế'; 291 }else{ 292 $u['status'] = 'Hết hạn'; 293 } 294 295 array_push ( $users, $u ); 296 } 297 298 $data ['users'] = $users; 299 $data ['paging_url'] = base_url () . "admin/nguoi_dung/trang/"; 300 $data ['num_links'] = 2; 301 $data ['paging'] = pagging ( $data ); 302 303 $this->load->library("PHPExcel"); 304 $sheet = $this->phpexcel->getActiveSheet(); 305 306 $sheet->setTitle("bao cao thue bao " . $data['month'] . " - " . $data['year']); 307 $sheet->getColumnDimension('A')->setWidth(10); 308 $sheet->getColumnDimension('B')->setWidth(25); 309 $sheet->getColumnDimension('C')->setWidth(25); 310 $sheet->getColumnDimension('D')->setWidth(15); 311 $sheet->getColumnDimension('E')->setWidth(15); 312 $sheet->getColumnDimension('F')->setWidth(15); 313 $sheet->getColumnDimension('G')->setWidth(15); 314 $sheet->getColumnDimension('H')->setWidth(25); 315 $sheet->getColumnDimension('I')->setWidth(25); 316 317 318 $sheet->setCellValue('B1', "TẬP ÄOÃN VIá»N THÃNG QUÃN Äá»I"); 319 $style = array( 320 'font' => array('bold' => true, 'size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 321 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 322 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 323 'wrap' => true ) 324 ); 325 $sheet->mergeCells('B1:I1'); 326 $sheet->getStyle('B1')->applyFromArray($style); 327 328 $sheet->setCellValue('B2', "Tá»NG CÃNG TY VIá»N THÃNG VIETTEL"); 329 $style = array( 330 'font' => array('size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 331 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 332 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 333 'wrap' => true ) 334 ); 335 $sheet->mergeCells('B2:I2'); 336 $sheet->getStyle('B2')->applyFromArray($style); 337 338 339 $sheet->setCellValue('A4', "DANH SÃCH NGƯá»I DÃNG"); 340 $style = array( 341 'font' => array('bold' => true, 'size' => 14, 'name' =>'Cambria'), 342 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 343 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 344 'wrap' => true ) 345 ); 346 $sheet->mergeCells('A4:I4'); 347 $sheet->getStyle('A4')->applyFromArray($style); 348 349 $sheet->setCellValue('A6', 'STT'); 350 $style = array( 351 'font' => array('bold' => true, 'size' => 11, 'name' =>'Cambria'), 352 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 353 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 354 'wrap' => true), 355 'borders' => array( 356 'allborders' => array( 357 'style' => \PHPExcel_Style_Border::BORDER_THIN 358 ) 359 ) 360 ); 361 $sheet->getStyle('A6')->applyFromArray($style); 362 $style = array( 363 'font' => array('bold' => true, 'size' => 11, 'name' =>'Cambria'), 364 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 365 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 366 'wrap' => true), 367 'borders' => array( 368 'allborders' => array( 369 'style' => \PHPExcel_Style_Border::BORDER_THIN 370 ) 371 ) 372 ); 373 374 $sheet->setCellValue('B6', 'Sá» Äiá»n thoại'); 375 $sheet->setCellValue('C6', "Há» tên)"); 376 $sheet->setCellValue('D6', "Tà i khoản SBG"); 377 $sheet->setCellValue('E6', "Ngà y ÄÄng kÜ"); 378 $sheet->setCellValue('F6', "Ngà y hết hạn"); 379 $sheet->setCellValue('G6', "Tá»nh/Thà nh phá»"); 380 $sheet->setCellValue('H6', "Quáºn/Huyá»n"); 381 $sheet->setCellValue('I6', "Tình trạng"); 382 $sheet->getStyle('A6:I6')->applyFromArray($style); 383 384 $styleSTT = array( 385 'font' => array('size' => 11, 'name' =>'Cambria'), 386 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 387 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER), 388 'borders' => array( 389 'allborders' => array( 390 'style' => \PHPExcel_Style_Border::BORDER_THIN 391 ) 392 ) 393 ); 394 $style = array( 395 'font' => array('size' => 11, 'name' =>'Cambria'), 396 'alignment' => array('vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER), 397 'borders' => array( 398 'allborders' => array( 399 'style' => \PHPExcel_Style_Border::BORDER_THIN 400 ) 401 ) 402 ); 403 $dem = 0; 404 foreach ($users as $index => $user): 405 $sheet->setCellValue('A' . ($dem + 7), $index + 1); 406 $sheet->setCellValueExplicit('B' . ($dem + 7), $user['username'], PHPExcel_Cell_DataType::TYPE_STRING); 407 $sheet->setCellValue('C' . ($dem + 7), $user['fullname']); 408 $sheet->setCellValue('D' . ($dem + 7), $user['acc_balanced']); 409 $sheet->setCellValue('E' . ($dem + 7), date('d/m/Y', strtotime($user['created_time']))); 410 $sheet->setCellValue('F' . ($dem + 7), isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''); 411 $sheet->setCellValue('G' . ($dem + 7), $user['province']); 412 $sheet->setCellValue('H' . ($dem + 7), $user['district_name']); 413 $sheet->setCellValue('I' . ($dem + 7), $user['status']); 414 $sheet->getStyle('A' . ($dem + 7))->applyFromArray($styleSTT); 415 $sheet->getStyle('B' . ($dem + 7).':I'.($dem + 7))->applyFromArray($style); 416 417 418 $dem++; 419 endforeach; 420 421 $writer = new PHPExcel_Writer_Excel5($this->phpexcel); 422 header('Content-Type: application/vnd.ms-excel'); 423 header('Content-Disposition: attachment; filename="danhsachnguoidung_trang_'.$data['current_page'].'.xls"'); 424 $writer->save('php://output'); 425 426 } 427 181 428 } -
pro-violet-viettel/sourcecode/application/modules/admin/models/paidlog_model.php
r818 r883 13 13 } 14 14 function getPaidlogs($data) { 15 15 16 if ($data['paid_type'] == 0){ 16 17 $sql = "SELECT SUM(amount) as total_amount FROM tblpaidlog"; … … 19 20 } 20 21 $r = $this->db->query($sql)->row_array(); 22 21 23 $total_amount = (int)$r['total_amount']; 22 24 $sql = "SELECT * FROM " . $this->table_name. " INNER JOIN tbluser ON tbluser.us_id = tblpaidlog.us_id "; … … 54 56 } 55 57 } 56 if ($data['start']){ 58 59 //if ($data['start']){ 60 57 61 $sql=$sql . " " . $order . " LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 58 } 62 //} 63 59 64 //return $this->db->query($sql)->result_array(); 60 65 $re = $this->db->query($sql)->result_array(); 66 61 67 $result['paid_logs'] = $re; 68 62 69 $result['total_amount'] = $total_amount; 63 70 return $result; -
pro-violet-viettel/sourcecode/application/modules/admin/models/reportmodel.php
r838 r883 28 28 $provinces = lang ( '_PROVINCES_' ); 29 29 // Tinh doanh thu theo tinh theo nam 30 $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >= '" . $input ['year'] . "-01-01' AND tblpaidlog.paid_time <= '" . ($input ['year'] + 1) . "-01-01' GROUP BY tbluser.province"; 30 //$sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >= '" . $input ['year'] . "-01-01' AND tblpaidlog.paid_time <= '" . ($input ['year'] + 1) . "-01-01' GROUP BY tbluser.province"; 31 $sql = "SELECT *,SUM(amount) as total FROM tblpaidlog LEFT JOIN tbluser ON tbluser.us_id=tblpaidlog.us_id WHERE tblpaidlog.paid_time >= '" . $input ['year'] . "-01-01 00:00:00' AND tblpaidlog.paid_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" .$input['to_date']. " 23:59:59' GROUP BY tbluser.province"; 31 32 $query = $this->db->query ( $sql ); 32 33 $dtns = $query->result_array (); … … 46 47 47 48 // Tinh thue bao theo tinh theo nam 48 $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >= '" . $input ['year'] . "-01-01 00:00:00' AND tbluser.created_time <= '" . ($input ['year'] + 1) . "-01-01 23:59:59' GROUP BY tbluser.province";49 $ query = $this->db->query ( $sql );50 write_file('./log/test.log', date('d-m-Y H:i:s').": ".$sql."\n", FOPEN_WRITE_CREATE);49 //$sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >= '" . $input ['year'] . "-01-01 00:00:00' AND tbluser.created_time <= '" . ($input ['year'] + 1) . "-01-01 23:59:59' GROUP BY tbluser.province"; 50 $sql = "SELECT *,count(us_id) as total FROM tbluser WHERE tbluser.created_time >= '" . $input ['year'] . "-01-01 00:00:00' AND tbluser.created_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" .$input['to_date']. " 23:59:59' GROUP BY tbluser.province"; 51 $query = $this->db->query ( $sql ); 51 52 $tbns = $query->result_array (); 52 53 … … 146 147 // tinh thue bao theo thang 147 148 //$sql = "SELECT * FROM tbluser LEFT JOIN tblservicepackage ON tbluser.p_id=tblservicepackage.p_id LEFT JOIN tblregisterpackagelog ON tbluser.cellphone = tblregisterpackagelog.username WHERE tbluser.updated_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . "' AND tbluser.updated_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . "' AND tblregisterpackagelog.created_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . "' AND tblregisterpackagelog.created_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . "' AND tblservicepackage.p_period > 0 "; 148 $sql = "SELECT * FROM tbluser LEFT JOIN tblregisterpackagelog ON tbluser.cellphone = tblregisterpackagelog.username WHERE tbluser.updated_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . " ' AND tbluser.updated_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . "' AND tblregisterpackagelog.created_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . "' AND tblregisterpackagelog.created_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . "'";149 $sql = "SELECT * FROM tbluser LEFT JOIN tblregisterpackagelog ON tbluser.cellphone = tblregisterpackagelog.username WHERE tbluser.updated_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . " 00:00:00' AND tbluser.updated_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . " 23:59:59' AND tblregisterpackagelog.created_time >= '" . $input ['year'] . "-" . $input ['month'] . "-" . $input ['date'] . " 00:00:00' AND tblregisterpackagelog.created_time <= '" . $input ['to_year'] . "-" . $input ['to_month'] . "-" . $input ['to_date'] . " 23:59:59'"; 149 150 $query = $this->db->query ( $sql ); 150 151 $users = $query->result_array (); 152 //write_file('./log/sql.log', date("d-m-Y H:i:s").": ".$sql."\n", FOPEN_WRITE_CREATE); 151 153 152 154 $sql = "SELECT * FROM tblservicepackage WHERE p_period>0"; -
pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
r818 r883 40 40 if (strlen($data['keyword'])>0){ 41 41 if ($data['status']==0){ 42 if (strlen($data['province_code'])>0){ 43 if(strlen($data['daterange_start'])>0){ 44 $sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 42 if (strlen($data['province'])>0){ 43 if (strlen($data['district'])>0){ 44 if(strlen($data['daterange_start'])>0){ 45 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 46 } 47 }else{ 48 if(strlen($data['daterange_start'])>0){ 49 $sql.=" WHERE province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 50 } 45 51 } 46 52 }else{ … … 54 60 }else 55 61 { 56 if (strlen($data['province_code'])>0){ 57 if(strlen($data['daterange_start'])>0){ 58 $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 59 }else{ 60 $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 61 } 62 if (strlen($data['province'])>0){ 63 if (strlen($data['district'])>0){ 64 if(strlen($data['daterange_start'])>0){ 65 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 66 }else{ 67 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 68 } 69 }else{ 70 if(strlen($data['daterange_start'])>0){ 71 $sql.=" AND province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 72 }else{ 73 $sql.=" AND province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 74 } 75 } 76 62 77 } 63 78 } … … 66 81 if(strlen($data['daterange_start'])>0){ 67 82 if ($data['status']==0){ 68 if (strlen($data['province_code'])>0){ 69 $sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 83 if (strlen($data['province'])>0){ 84 if (strlen($data['district'])>0){ 85 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 86 }else{ 87 $sql.=" WHERE province = '".$data['province']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 88 } 70 89 }else{ 71 90 $sql.=" WHERE (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 72 91 } 73 92 }else{ 74 if (strlen($data['province_code'])>0){ 75 $sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 93 if (strlen($data['province'])>0){ 94 if (strlen($data['district'])>0){ 95 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 96 }else{ 97 $sql.=" AND province = '".$data['province']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 98 } 76 99 }else{ 77 100 $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 78 101 } 102 79 103 } 80 104 } 81 105 else{ 82 106 if ($data['status']==0){ 83 if (strlen($data['province_code'])>0){ 84 $sql.=" WHERE province = '".$data['province_code']."'"; 85 } 86 }else{ 87 if (strlen($data['province_code'])>0){ 88 $sql.=" AND province = '".$data['province_code']."'"; 89 } 107 if (strlen($data['province'])>0){ 108 if (strlen($data['district'])>0){ 109 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."'"; 110 }else{ 111 $sql.=" WHERE province = '".$data['province']."'"; 112 } 113 } 114 }else{ 115 if (strlen($data['province'])>0){ 116 if (strlen($data['district'])>0){ 117 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."'"; 118 }else{ 119 $sql.=" AND province = '".$data['province']."'"; 120 121 } 122 } 123 90 124 } 91 125 } 92 126 } 93 127 } 128 94 129 $order = ""; 130 95 131 if ($data['sorting_order'] != "sorting") { 96 132 if($data['sorting_field'] != "status"){ … … 101 137 } 102 138 } 103 write_file('./log/test.log', date("d-m-Y: H:i:s"). ": ".$sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage'], FOPEN_WRITE_CREATE);139 //write_file('./log/sql.log', date("d-m-Y: H:i:s"). ": ".$sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage']."\n" , FOPEN_WRITE_CREATE); 104 140 return $this->db->query($sql." ".$order." LIMIT ".$data['start'].", ".$data['perpage']." ")->result_array(); 105 141 } … … 126 162 if (strlen($data['keyword'])>0){ 127 163 if ($data['status']==0){ 128 if (strlen($data['province_code'])>0){ 129 if(strlen($data['daterange_start'])>0){ 130 $sql.=" WHERE province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 131 } 164 if (strlen($data['province'])>0){ 165 if (strlen($data['district'])>0){ 166 if(strlen($data['daterange_start'])>0){ 167 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 168 } 169 }else{ 170 if(strlen($data['daterange_start'])>0){ 171 $sql.=" WHERE province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 172 } 173 } 174 132 175 }else{ 133 176 if(strlen($data['daterange_start'])>0){ … … 140 183 }else 141 184 { 142 if (strlen($data['province_code'])>0){ 143 if(strlen($data['daterange_start'])>0){ 144 $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 145 }else{ 146 $sql.=" AND province = '".$data['province_code']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 185 if (strlen($data['province'])>0){ 186 if (strlen($data['district'])>0){ 187 if(strlen($data['daterange_start'])>0){ 188 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 189 }else{ 190 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 191 } 192 }else{ 193 if(strlen($data['daterange_start'])>0){ 194 $sql.=" AND province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 195 }else{ 196 $sql.=" AND province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR district LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') "; 197 } 147 198 } 148 199 } … … 152 203 if(strlen($data['daterange_start'])>0){ 153 204 if ($data['status']==0){ 154 if (strlen($data['province_code'])>0){ 155 $sql.=" WHERE province = '".$data['province_code']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 205 if (strlen($data['province'])>0){ 206 if (strlen($data['district'])>0){ 207 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 208 }else{ 209 $sql.=" WHERE province = '".$data['province']."' AND created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."'"; 210 } 156 211 }else{ 157 212 $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 158 213 } 159 214 }else{ 160 if (strlen($data['province_code'])>0){ 161 $sql.=" AND province = '".$data['province_code']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 215 if (strlen($data['province'])>0){ 216 if (strlen($data['district'])>0){ 217 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 218 }else{ 219 $sql.=" AND province = '".$data['province']."' AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; 220 } 162 221 }else{ 163 222 $sql.=" AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')"; … … 167 226 else{ 168 227 if ($data['status']==0){ 169 if (strlen($data['province_code'])>0){ 170 $sql.=" WHERE province = '".$data['province_code']."'"; 171 } 172 }else{ 173 if (strlen($data['province_code'])>0){ 174 $sql.=" AND province = '".$data['province_code']."'"; 228 if (strlen($data['province'])>0){ 229 if (strlen($data['district'])>0){ 230 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."'"; 231 }else{ 232 $sql.=" WHERE province = '".$data['province']."'"; 233 } 234 } 235 }else{ 236 if (strlen($data['province'])>0){ 237 if (strlen($data['district'])>0){ 238 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."'"; 239 }else{ 240 $sql.=" AND province = '".$data['province']."'"; 241 } 175 242 } 176 243 } … … 191 258 } 192 259 260 public function getDistrictByProvince($provinceId){ 261 $sql = "SELECT * FROM tbldistrict WHERE province_id = ?"; 262 $query = $this->db->query ( $sql, array ( 263 $provinceId 264 ) ); 265 $results = $query->result_array(); 266 return $results; 267 } 268 269 public function getDistrictByIdAndProvince($districtId, $provinceId){ 270 $sql = "SELECT * FROM tbldistrict WHERE district_id = ? AND province_id = ?"; 271 $query = $this->db->query ( $sql,array ($districtId, $provinceId) ); 272 if ($query->num_rows () > 0) { 273 $row = $query->row_array (); 274 return $row; 275 } 276 277 } 193 278 } -
pro-violet-viettel/sourcecode/application/modules/admin/views/report/index.php
r818 r883 1 <?php1 <?php 2 2 $base_url = base_url(); 3 3 $this->load->view('layout/admin/header', array('base_url' => $base_url)); … … 157 157 <li> 158 158 <i class="icon-home home-icon"></i> 159 <a href="#">Trang ch ủ</a>159 <a href="#">Trang chá»§</a> 160 160 </li> 161 161 162 162 <li> 163 <a href="#">Qu ản lý tin nhắn</a>163 <a href="#">Quản lÜ tin nhắn</a> 164 164 </li> 165 165 … … 169 169 <form class="form-search"> 170 170 <span class="input-icon"> 171 <input type="text" autocomplete="off" id="nav-search-input" class="nav-search-input" placeholder="T ìm kiếm ...">171 <input type="text" autocomplete="off" id="nav-search-input" class="nav-search-input" placeholder="Tìm kiếm ..."> 172 172 <i class="icon-search nav-search-icon"></i> 173 173 </span> … … 183 183 <div class="page-header"> 184 184 <h1> 185 Tin nh ắn185 Tin nhắn 186 186 <small> 187 187 <i class="icon-double-angle-right"></i> 188 M ẫu tin nhắn188 Mẫu tin nhắn 189 189 </small> 190 190 </h1> -
pro-violet-viettel/sourcecode/application/modules/admin/views/report/listview.php
r818 r883 1 <div class="col-xs-12">1 <div class="col-xs-12"> 2 2 <!-- PAGE CONTENT BEGINS --> 3 3 <div style="padding-bottom:4px" class="table-header"> 4 4 Doanh thu 5 5 <div class="pull-right" style="margin:5px;"> 6 <a style="color:#fff" href="<?php echo base_url();?>admin/report/export">Xu ất ra Excel</a>6 <a style="color:#fff" href="<?php echo base_url();?>admin/report/export">Xuất ra Excel</a> 7 7 </div> 8 8 </div> … … 13 13 <div class="row"> 14 14 <div class="col-sm-6"> 15 <div id="sample-table-2_length" class="dataTables_length"><label>Hi ện thị15 <div id="sample-table-2_length" class="dataTables_length"><label>Hiá»n thá» 16 16 <select onchange="filter();" name="items" size="1" aria-controls="sample-table-2"> 17 17 <?php foreach ($itemsoptions as $option) { ?> 18 18 <option <?php if($option == $perpage) echo "selected"; ?> value="<?php echo $option;?>"><?php echo $option;?></option> 19 19 <?php } ?> 20 </select> b ản ghi</label>20 </select> bản ghi</label> 21 21 22 22 </div> … … 25 25 <div class="col-sm-6"> 26 26 <!--<div class="dataTables_filter" id="sample-table-2_filter"> 27 <label>T ìm kiếm:27 <label>Tìm kiếm: 28 28 <input type="text" name="keyword" id="keyword" value='<?php echo $keyword;?>' style="width: 162px; height: 18px;" aria-controls="sample-table-2"></label> 29 29 </div>--> 30 <div class="dataTables_filter" id="sample-table-2_filter"><label>L ọc theo:30 <div class="dataTables_filter" id="sample-table-2_filter"><label>Lá»c theo: 31 31 <select onchange="filter();" name="paid_type" size="1" style="width: 176px; height: 28px;"> 32 32 <?php foreach ($paid_types as $key => $type): ?> … … 51 51 <tr role="row"> 52 52 53 <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="S ố điện thoại: activate to sort column ascending">Số điện thoại</th>54 <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="H ọ tên: activate to sort column ascending">Họ tên</th>55 <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="S ố điện thoại: activate to sort column ascending">Số tiền</th>56 <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="S ố điện thoại: activate to sort column ascending">SMS/Card</th>57 <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ng ày đăng ký: activate to sort column ascending">Ngày</th>53 <th class="<?php if ($sorting_field == 'fullname') {echo $sorting_order;} else {echo "";}?>" id="full_name" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Sá» Äiá»n thoại</th> 54 <th class="<?php if ($sorting_field == 'cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 283px;" aria-label="Há» tên: activate to sort column ascending">Há» tên</th> 55 <th class="<?php if ($sorting_field == 'amount') {echo $sorting_order;} else {echo "sorting";}?>" id="amount" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Sá» tiá»n</th> 56 <th class="<?php if ($sorting_field == 'paid_type') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_type" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">SMS/Card</th> 57 <th class="<?php if ($sorting_field == 'paid_time') {echo $sorting_order;} else {echo "sorting";}?>" id="paid_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="Ngà y ÄÄng kÜ: activate to sort column ascending">Ngà y</th> 58 58 59 59 </thead> … … 90 90 <tr> 91 91 <td colspan=2> 92 T ổng tiền92 Tá»ng tiá»n 93 93 </td> 94 94 <td colspan=3> … … 97 97 </tr> 98 98 </tbody></table><div class="row"><div class="col-sm-6"> 99 <div class="dataTables_info" id="sample-table-2_info">Hi ển thị <?php echo ($start+1)?> đến <?php echo ($start+$perpage)?> của <?php echo $total?> bản ghi</div>99 <div class="dataTables_info" id="sample-table-2_info">Hiá»n thá» <?php echo ($start+1)?> Äến <?php echo ($start+$perpage)?> cá»§a <?php echo $total?> bản ghi</div> 100 100 101 101 </div> … … 120 120 <div class="modal-header"> 121 121 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> 122 <h4 class="modal-title">L ịch sử</h4>122 <h4 class="modal-title">Lá»ch sá»</h4> 123 123 </div> 124 124 <div class="modal-body"> … … 126 126 <li class="active" > 127 127 <a id="regis-tab" href="#regis" data-toggle="tab"> 128 Giao d ịch128 Giao dá»ch 129 129 </a> 130 130 </li> 131 131 <li> 132 132 <a id="trade-tab" href="#trade" data-toggle="tab"> 133 Th ông tin133 ThÃŽng tin 134 134 </a> 135 135 </li> … … 137 137 <div class="tab-content history-tab-content"> 138 138 <div class="tab-pane in active" id="regis"> 139 <div class="col-sm-12">140 <h5>T ài khoản SBG Online: <b><span class="blue"><span id="topup-money"><?php echo number_format($acc_balanced, 0); ?></span> VNĐ<span></b></h5>139 <div> 140 <h5>Tà i khoản SBG Online: <b><span class="blue"><span id="topup-money"><?php echo number_format($acc_balanced, 0); ?></span> VNÄ <span></b></h5> 141 141 </div> 142 142 <div class="table-responsive"> … … 145 145 <tr> 146 146 <th class="center"> 147 T ừ147 Từ 148 148 </th> 149 <th class="center"> S ố tiền (VNĐ) </th>150 <th class="center"> G ói dịch vụ</th>149 <th class="center"> Sá» tiá»n (VNÄ) </th> 150 <th class="center"> Gói dá»ch vụ </th> 151 151 <th> 152 152 <i class="icon-time bigger-110 hidden-480"></i> 153 Th ời gian153 Thá»i gian 154 154 </th> 155 155 </tr> -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportpackage/province.php
r818 r883 9 9 Báo cáo doanh thu theo tá»nh / thà nh phá» theo gói cưá»c. 10 10 <div class="pull-right" style="margin:5px;"> 11 <a style="color:#fff" href="<?php echo base_url();?>admin/reportpackage/export/<?php echo $ month;?>/<?php echo $year;?>">Xuất ra Excel</a>11 <a style="color:#fff" href="<?php echo base_url();?>admin/reportpackage/export/<?php echo $date;?>/<?php echo $month;?>/<?php echo $year;?>/-/<?php echo $to_date;?>/<?php echo $to_month;?>/<?php echo $to_year;?>">Xuất ra Excel</a> 12 12 </div> 13 13 </div> … … 17 17 <form autocomplete="off" onsubmit="return false;" id="province" > 18 18 <div class="row"> 19 <div class="col-sm-6"> 20 <div class="" style="display: inline-block"><label>Tháng 19 <div class="col-sm-1"> 20 <div class="" style="display: inline-block"><label><strong>Từ: </strong></label></div> 21 </div> 22 <div class="col-sm-6"> 23 <div class="" style="display: inline-block"><label>Ngà y</label> 24 25 <select aria-controls="sample-table-2" size="1" name="date" onchange="filter();"> 26 <?php for ($i=1;$i<=31;$i++) { ?> 27 <option value="<?php echo $i;?>" <?php if($date==$i) { ?> selected <?php }?>><?php echo $i;?></option> 28 <?php }?> 29 </select> 30 </div> 31 <div class="" style="display: inline-block"><label>Tháng</label> 21 32 22 33 <select aria-controls="sample-table-2" size="1" name="month" onchange="filter();"> … … 34 45 </select> 35 46 </div> 36 </div> 47 </div> 48 37 49 38 50 <div class="col-sm-6"> … … 40 52 </div> 41 53 </div> 54 55 <div class="row"> 56 <div class="col-sm-1"> 57 <div class="" style="display: inline-block"><label><strong>Äến: </strong></label></div> 58 </div> 59 <div class="col-sm-6"> 60 <div class="" style="display: inline-block"><label>Ngà y</label> 61 62 <select aria-controls="sample-table-2" size="1" name="to_date" onchange="filter();"> 63 <?php for ($i=1;$i<=31;$i++) { ?> 64 <option value="<?php echo $i;?>" <?php if($to_date==$i) { ?> selected <?php }?>><?php echo $i;?></option> 65 <?php }?> 66 </select> 67 </div> 68 <div class="" style="display: inline-block"><label>Tháng</label> 69 70 <select aria-controls="sample-table-2" size="1" name="to_month" onchange="filter();"> 71 <?php for ($i=1;$i<=12;$i++) { ?> 72 <option value="<?php echo $i;?>" <?php if($to_month==$i) { ?> selected <?php }?>><?php echo $i;?></option> 73 <?php }?> 74 </select> 75 </div> 76 <div class="" style="display: inline-block"><label>NÄm 77 78 <select aria-controls="sample-table-2" size="1" name="to_year" onchange="filter();"> 79 <?php for ($i=2014;$i<=date("Y");$i++) { ?> 80 <option value="<?php echo $i;?>" <?php if($to_year==$i) { ?> selected <?php }?>><?php echo $i;?></option> 81 <?php }?> 82 </select> 83 </div> 84 </div> 85 </div> 86 42 87 </form> 43 88 <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info"> -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportprovince/province.php
r838 r883 17 17 <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper"> 18 18 <form autocomplete="off" onsubmit="return false;" id="province" > 19 <div class="row">20 <div class="col-sm-1">21 <div class="" style="display: inline-block"><label><strong>Từ: </strong></label></div>22 </div>23 <div class="col-sm-6">24 <div class="" style="display: inline-block"><label>Ngà y</label>25 26 <select aria-controls="sample-table-2" size="1" name="date" onchange="filter();">27 <?php for ($i=1;$i<=31;$i++) { ?>28 <option value="<?php echo $i;?>" <?php if($date==$i) { ?> selected <?php }?>><?php echo $i;?></option>29 <?php }?>30 </select>31 </div>32 <div class="" style="display: inline-block"><label>Tháng</label>33 34 <select aria-controls="sample-table-2" size="1" name="month" onchange="filter();">35 <?php for ($i=1;$i<=12;$i++) { ?>36 <option value="<?php echo $i;?>" <?php if($month==$i) { ?> selected <?php }?>><?php echo $i;?></option>37 <?php }?>38 </select>39 </div>40 <div class="" style="display: inline-block"><label>NÄm41 42 <select aria-controls="sample-table-2" size="1" name="year" onchange="filter();">43 <?php for ($i=2014;$i<=date("Y");$i++) { ?>44 <option value="<?php echo $i;?>" <?php if($year==$i) { ?> selected <?php }?>><?php echo $i;?></option>45 <?php }?>46 </select>47 </div>48 </div>49 50 51 <div class="col-sm-6">52 53 </div>54 </div>55 56 19 <div class="row"> 57 <div class="col-sm-1">58 <div class="" style="display: inline-block"><label><strong>Äến: </strong></label></div>59 </div>60 20 <div class="col-sm-6"> 61 21 <div class="" style="display: inline-block"><label>Ngà y</label> … … 108 68 <td style="font-weight:bold;"><?php echo $totalTbth; ?></td> 109 69 <td style="font-weight:bold;"><?php echo $totalTbn; ?></td> 110 <td style="font-weight:bold;"><?php echo $totalDtng; ?></td>111 <td style="font-weight:bold;"><?php echo $totalDtth; ?></td>112 <td style="font-weight:bold;"><?php echo $totalDtn; ?></td>70 <td style="font-weight:bold;"><?php echo number_format($totalDtng, 0); ?></td> 71 <td style="font-weight:bold;"><?php echo number_format($totalDtth, 0); ?></td> 72 <td style="font-weight:bold;"><?php echo number_format($totalDtn, 0); ?></td> 113 73 114 74 </tr> … … 127 87 <td class="hidden-480 "><?php echo $province['tbt']; ?></td> 128 88 <td class=" "><?php echo $province['tbn']; ?></td> 129 <td class=" "><?php echo $province['dtng']; ?></td>130 <td class=" "><?php echo $province['dtt']; ?></td>131 <td class=" "><?php echo $province['dtn']; ?></td>89 <td class=" "><?php echo number_format($province['dtng'], 0); ?></td> 90 <td class=" "><?php echo number_format($province['dtt'], 0); ?></td> 91 <td class=" "><?php echo number_format($province['dtn'], 0); ?></td> 132 92 133 93 </tr> -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/index.php
r773 r883 90 90 $('#table_content').show(); 91 91 $("#content").html(data); 92 $("#keyword").focus();93 $("#keyword").setCursorToTextEnd();94 92 $('.daterangepicker').daterangepicker({ 95 93 format: 'DD/MM/YYYY' 96 94 }); 95 $("#keyword").focus(); 96 $("#keyword").setCursorToTextEnd(); 97 init_page(); 97 98 $('input[name="daterange"]').val(daterange); 98 init_page();99 99 }, 100 100 error: function (jqXHR, textStatus, errorThrown) … … 104 104 }); 105 105 } 106 //$(document).ready(function(){ 107 108 //}); 109 106 110 107 111 </script> -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
r818 r883 45 45 Thêm ngưá»i dùng 46 46 </button--> 47 <div class="pull-right" style="margin:5px;"> 48 49 <a style="color:#fff" href="<?php echo base_url();?>admin/user/export/<?php echo $current_page; ?>/<?php echo $perpage; ?>/<?php echo ($keyword)?$keyword:'default'; ?>/<?php echo $status; ?>/<?php echo ($province)?$povince:'default'; ?>/<?php echo ($district)?$district:'default';?>/<?php echo ($daterange)?$daterange:'default'; ?>/<?php echo $sorting_order; ?>/<?php echo $sorting_field;?>">Xuất ra Excel</a> 50 51 </div> 47 52 48 53 </div> … … 76 81 </div> 77 82 <div style="clear: both;"></div> 78 <div class="dataTables_ status" style="float: right;" id="sample-table-2_status"><label>Lá»c theo Tá»nh/TP:79 <select onchange="filter();" name="province -code" size="1" style="width: 176px; height: 28px;">83 <div class="dataTables_province" style="float: right;" id="sample-table-2_status"><label>Lá»c theo Tá»nh/TP: 84 <select onchange="filter();" name="province" class="form-field-province" size="1" style="width: 176px; height: 28px;"> 80 85 <option value=''></option> 86 81 87 <?php foreach ($provinces as $key => $pro): ?> 82 <option <?php if ($key == $province _code) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $pro; ?></option>88 <option <?php if ($key == $province) echo "selected"; ?> value="<?php echo $key; ?>"><?php echo $pro; ?></option> 83 89 <?php endforeach; ?> 90 </select> 91 </div> 92 93 <div class="dataTables_district" style="float: right;" id="sample-table-2_status"><label>Lá»c theo Quáºn/Huyá»n: 94 <select onchange="filter();" name="district" id="form-field-district" class="form-field-district" size="1" style="width: 176px; height: 28px;"> 95 <?php if ($districts):?> 96 <option value=''></option> 97 <?php foreach ($districts as $key => $dist): ?> 98 <option <?php if ($dist['district_id'] == $district) echo "selected"; ?> value="<?php echo $dist['district_id']; ?>"><?php echo $dist['district_name']; ?></option> 99 <?php endforeach; ?> 100 <?php endif;?> 84 101 </select> 85 102 </div> … … 92 109 </div> 93 110 </div> 94 111 <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order; ?>" /> 112 <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field; ?>"/> 95 113 </div> 96 114 97 <input type="hidden" name="sorting_order" id="sorting_order" value="<?php echo $sorting_order; ?>" />98 <input type="hidden" name="sorting_field" id="sorting_field" value="<?php echo $sorting_field; ?>"/>99 115 </form> 100 116 <!-- Table Content --> … … 104 120 <thead> 105 121 <tr role="row"> 106 < th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">122 <!--<th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label=""> 107 123 <label> 108 124 <input type="checkbox" class="ace"> 109 125 <span class="lbl"></span> 110 126 </label> 111 </th> 127 </th>--> 112 128 <th class="<?php 113 129 if ($sorting_field == 'cellphone') { … … 117 133 } 118 134 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Tà i khoản: activate to sort column ascending">Sá» Äiá»n thoại</th> 119 <th class="<?php 120 if ($sorting_field == 'cellphone') { 121 echo $sorting_order; 122 } else { 123 echo "sorting"; 124 } 125 ?>" id="cellphone" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;" aria-label="Sá» Äiá»n thoại: activate to sort column ascending">Há» tên</th> 135 <th style="width: 156px;">Há» tên</th> 126 136 127 137 <th class="<?php … … 152 162 Ngà y hết hạn 153 163 </th> 154 <th style="width: 140px;">Tá»nh/TP</th> 164 <th style="width: 130px;">Tá»nh/TP</th> 165 <th style="width: 150px;">Quáºn/Huyá»n</th> 155 166 <th class="sorting_disabled" id="status" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Tình trạng</th> 156 167 </tr> … … 163 174 ?> 164 175 <tr class="odd"> 176 <!-- 165 177 <td class="center sorting_1"> 166 178 <label> … … 168 180 <span class="lbl"></span> 169 181 </label> 170 </td> 182 </td>--> 171 183 <td class=" "> 172 184 <a onclick="getUserHistory(<?php echo $user['us_id']; ?>, 1);" data-toggle="modal"><?php echo $user['username']; ?></a> … … 180 192 <td class=" "><?php echo isset($user['expire_date']) && strtotime($user['expire_date']) > 0 ? date('d/m/Y', strtotime($user['expire_date'])) : ''; ?></td> 181 193 <td><?php echo $user['province']; ?></td> 194 <td><?php echo $user['district_name']; ?></td> 182 195 <td class=" "> 183 196 <?php if (strtotime($user['expire_date']) > time() && $user['p_id'] != 5 ): ?> … … 242 255 <div class="tab-content history-tab-content"> 243 256 <div class="tab-pane in active" id="regis"> 244 <div class="col-sm-12">257 <div> 245 258 <h5>Tà i khoản SBG Online: <b><span class="blue"><span id="topup-money"><?php echo number_format($acc_balanced, 0); ?></span> VNÄ <span></b></h5> 246 259 </div> -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php
r838 r883 181 181 182 182 public function test(){ 183 $provinces = lang('_PROVINCES_'); 184 $this->load->library("PHPExcel"); 185 $file = './assets/danhsachquanhuyen.xls'; 186 $objPHPExcel = PHPExcel_IOFactory::load($file); 187 $cell_collection = $objPHPExcel->getActiveSheet()->getCellCollection(); 188 foreach ($cell_collection as $cell) { 189 $column = $objPHPExcel->getActiveSheet()->getCell($cell)->getColumn(); 190 $row = $objPHPExcel->getActiveSheet()->getCell($cell)->getRow(); 191 $data_value = $objPHPExcel->getActiveSheet()->getCell($cell)->getValue(); 192 193 if ($row == 1) { 194 $header[$row][$column] = $data_value; 195 } else { 196 $arr_data[$row][$column] = $data_value; 197 } 183 $aryMatch = array(); 184 $phoneNumber = '987133325'; 185 $regex = '/^[1,9][0-9]{8,9}$/'; 186 if (preg_match('/^[1,9]([0-9]{8,9})$/', $phoneNumber, $aryMatch)){ 187 $phoneNumber = "0".$phoneNumber; 188 echo $phoneNumber; 189 }else{ 190 echo "Not match"; 198 191 } 199 200 $data['header'] = $header;201 $data['values'] = $arr_data;202 203 foreach ($data['values'] as $index => $value){204 foreach ($provinces as $provinceId => $province){205 if ($value['C'] == $province) $data['values'][$index]['C'] = $provinceId;206 if ($value['B'] >= 10){207 $data['values'][$index]['B'] = "0".$value['B'];208 }else{209 $data['values'][$index]['B'] = "00".$value['B'];210 }211 }212 213 }214 215 $dt = array();216 foreach ($data['values'] as $index => $value){217 218 $dt[$index]['district_id'] = $value['B'];219 $dt[$index]['province_id'] = $value['C'];220 $dt[$index]['district_name'] = $value['D'];221 $dt[$index]['type'] = $value['E'];222 }223 //var_dump($dt);224 //$this->load->model ( 'user_model' );225 //$result = $this->user_model->insertDistrict($dt);226 //var_dump($result);227 192 } 228 193 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r838 r883 449 449 public function regis_history() 450 450 { 451 $this->load->model('servicepackage_model'); 451 452 $this->load->helper('pagging'); 452 453 $us_id = $this->uri->segment(4); … … 466 467 $this->load->model('user_model'); 467 468 $result = $this->user_model->getPackagelog($data); 468 $data['total'] = $this->user_model->countPackagelogs($username); 469 $results = array(); 470 foreach($result as $re){ 471 if ($re['p_code']>0){ 472 $p_price = $this->servicepackage_model->getPackagePriceByCode($re['p_code']); 473 $re['amount'] = -$p_price; 474 } 475 array_push($results, $re); 476 } 477 $data['total'] = $this->user_model->countPackagelogs($username, $us_id); 469 478 $data['num_links'] = 2; 470 479 $data['paging_url'] = base_url() . "frontend/user/regis_history/".$us_id."/page/"; 471 480 $data['paging'] = pagging($data); 472 481 $packagelogs = array(); 473 foreach ($result as $packagelog):482 foreach ($results as $packagelog): 474 483 $packagelog['created_time'] = date('d/m/Y H:i:s', strtotime($packagelog['created_time'])); 475 484 array_push($packagelogs, $packagelog); … … 487 496 488 497 $user_info = $this->session->userdata('userInfo'); 489 if ($user_info) { 498 $admin_info = $this->session->userdata('adminInfo'); 499 if ($user_info || $admin_info) { 490 500 $result = array(); 491 501 $provinceId = $this->uri->segment(4); -
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r838 r883 576 576 $this->db->query ( 'UNLOCK TABLES' ); 577 577 //$sql="SELECT tblregisterpackagelog.source,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage'].""; 578 $sql="SELECT tblregisterpackagelog.source,0 as amount,tblservicepackage.p_name,tblregisterpackagelog.created_time FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,'Nạp tiền' as name,tblpaidlog.paid_time FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage']."";578 $sql="SELECT tblregisterpackagelog.source,0 as amount,tblservicepackage.p_name,tblregisterpackagelog.created_time, tblregisterpackagelog.p_code FROM tblregisterpackagelog INNER JOIN tblservicepackage ON tblservicepackage.p_code = tblregisterpackagelog.p_code where username = ? UNION SELECT tblpaidlog.source,tblpaidlog.amount,'Nạp tiền' as name,tblpaidlog.paid_time, 0 as p_code FROM tblpaidlog where us_id = ? ORDER BY created_time DESC LIMIT ".$data['start'].", ".$data['perpage'].""; 579 579 $query = $this->db->query ( $sql, array ("$username", $us_id) ); 580 580 $row = $query->result_array(); … … 582 582 } 583 583 584 public function countPackagelogs($username )584 public function countPackagelogs($username, $us_id) 585 585 { 586 586 $this->db->query ( 'UNLOCK TABLES' ); 587 587 $sql="SELECT COUNT(id) AS total FROM tblregisterpackagelog WHERE username = ?"; 588 588 589 $query = $this->db->query ( $sql, array ( 589 590 $username 590 591 ) ); 591 592 $result = $query->row_array(); 593 $total = $result['total']; 594 $sql="SELECT COUNT(paid_id) AS total FROM tblpaidlog WHERE us_id = ?"; 595 $query = $this->db->query ( $sql, array ( 596 $us_id 597 ) ); 598 $result = $query->row_array(); 599 $total = $total + $result['total']; 600 $result['total'] = $total; 601 592 602 return $result['total']; 593 603 } -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php
r838 r883 59 59 <script> 60 60 var district_id = "<?php echo $user['district']; ?>"; 61 $(".form-field-province").change(function(){ 62 changeEventProvince(); 61 var province_id = "<?php echo $user['province']; ?>"; 62 $(document).ready(function(){ 63 $(".form-field-province").change(function(){ 64 changeEventProvince(province_id); 65 }); 66 if ($(".form-field-province").val() !== 'undefined'){ 67 checkSelectedDistrict(province_id); 68 } 63 69 }); 64 if ($(".form-field-province").val() !== 'undefined'){65 checkSelecteDistrict();66 }67 70 </script> -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r838 r883 336 336 ); 337 337 338 $xml = $this->load->view(' charging', $aryParams, true);338 $xml = $this->load->view('services/charging', $aryParams, true); 339 339 $client = new nusoap_client($url); 340 340 $client->useHTTPPersistentConnection(); … … 342 342 $client->operation = $action; 343 343 $result = $client->send($xml, $action); 344 345 344 if ($client->fault) { 346 345 return _SBG_CHARGING_FAIL; … … 395 394 ); 396 395 397 $xml = $this->load->view(' mt', $aryParams, true);396 $xml = $this->load->view('services/mt', $aryParams, true); 398 397 $url = $this->config->item('mt_service_url'); 399 398 $client = new nusoap_client($url); -
pro-violet-viettel/sourcecode/assets/css/custom.css
r838 r883 311 311 #form-field-province {padding-left: 0;} 312 312 #form-field-district {padding-left: 0;} 313 314 .file-upload { 315 position: relative; 316 overflow: hidden; 317 margin: 8px; 318 border-radius: 4px; 319 } 320 .file-upload input.upload { 321 position: absolute; 322 top: 0; 323 right: 0; 324 margin: 0; 325 padding: 0; 326 font-size: 20px; 327 cursor: pointer; 328 opacity: 0; 329 filter: alpha(opacity=0); 330 } 331 #input-upload{ 332 padding: 10px 12px; 333 font-size: 14px; 334 border: 1px solid #D8D8D8; 335 336 } 337 #btn-submit{ 338 border-radius: 4px; 339 } -
pro-violet-viettel/sourcecode/assets/js/admin/user.js
r838 r883 89 89 { 90 90 $('#user-history').modal('hide'); 91 //alert("Äã cáºp nháºt");91 92 92 location.reload(); 93 93 } … … 97 97 } 98 98 99 function checkSelecteDistrict(){ 100 provinceId = $(".form-field-province").val(); 99 function checkSelectedDistrict(provinceId){ 101 100 $.ajax({ 102 101 url: '/frontend/user/getDistrict/' + provinceId, … … 120 119 } 121 120 122 function changeEventProvince( ){121 function changeEventProvince(provinceId){ 123 122 $(".form-field-district").html(""); 124 provinceId = $("#form-field-province").val();125 123 $.ajax({ 126 124 url: '/frontend/user/getDistrict/' + provinceId, … … 139 137 }); 140 138 } 139 140 $(document).ready(function(){ 141 $(".form-field-province").change(function(){ 142 //alert("OK"); 143 changeEventProvince(); 144 }); 145 if ($(".form-field-province").val() !== 'undefined'){ 146 checkSelectedDistrict(); 147 } 148 }); -
pro-violet-viettel/sourcecode/assets/js/frontend/user.js
r838 r883 45 45 46 46 if ($(".form-field-province").val() !== 'undefined'){ 47 checkSelecte District();47 checkSelectedDistrict(); 48 48 } 49 49 $(".form-field-province").change(function(){ … … 121 121 success: function (data, textStatus, jqXHR) 122 122 { 123 console.log(data);124 123 result = jQuery.parseJSON(data); 125 124 if (result.success == "1") … … 286 285 } 287 286 288 function checkSelecte District(){287 function checkSelectedDistrict(){ 289 288 provinceId = $(".form-field-province").val(); 290 289 $.ajax({ … … 309 308 } 310 309 311 if ($(".form-field-province").val() !== 'undefined'){312 checkSelecteDistrict();313 }314 315 310 function changeEventProvince(){ 316 311 $(".form-field-district").html(""); … … 332 327 }); 333 328 } 334 335 $(".form-field-province").change(function(){ 336 changeEventProvince(); 329 $(document).ready(function(){ 330 if ($(".form-field-province").val() !== 'undefined'){ 331 checkSelectedDistrict(); 332 } 333 $(".form-field-province").change(function(){ 334 changeEventProvince(); 335 }); 337 336 });
Note: See TracChangeset
for help on using the changeset viewer.