- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/collaborator
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/collaborator/controllers/collaborator.php
r883 r906 14 14 $this->lang->load('messages', 'message'); 15 15 } 16 17 public function index() { 18 $data = array(); 19 $collaborator_info = $this->session->userdata('collaboratorInfo'); 20 if ($collaborator_info) { 21 $data['statistics'] = $this->getStatistics(); 22 $data['content'] = $this->getCollaborators(); 23 $this->load->view('collaborator/reportAsistant/index', $data); 24 } else { 25 $this->load->view('login'); 26 } 27 } 28 29 public function viewAsistant() { 30 $data = array(); 31 32 $collaborator_info = $this->session->userdata('collaboratorInfo'); 33 if ($collaborator_info) { 34 $id = $this->uri->segment(2); 35 $data['id'] = $id; 36 $data['statistics'] = $this->getStatistics($id); 37 $data['content'] = $this->getCollaboratorsUsers(array(), $id); 38 $this->load->view('collaborator/reportAsistant/indexCollaborator', $data); 39 } else { 40 $this->load->view('login'); 41 } 42 } 43 44 public function getStatistics($id = false) { 45 $data = array(); 46 47 $this_year['start'] = strtotime(date("Y") . "-01-01 00:00:00"); 48 49 $this->load->model('admin/collabolator_model'); 50 $collaborators = $this->collabolator_model->getAllCollaboratorUser($this_year['start'], $id); 51 for ($i = 1; $i <= 12; $i++) { 52 $statistics[$i] = 0; 53 } 54 $y = date("Y"); 55 foreach ($collaborators as $collaborator) { 56 for ($i = 1; $i <= 12; $i++) { 57 if ($i < 12) { 58 if (($collaborator['time'] > strtotime($y . "-" . $i . "-1 00:00:00")) && (($collaborator['time'] < strtotime($y . "-" . ($i + 1) . "-1 00:00:00")))) { 59 $statistics[$i] ++; 60 } 61 } else { 62 if (($collaborator['time'] > strtotime($y . "-" . $i . "-1 00:00:00")) && (($collaborator['time'] < strtotime(($y + 1) . "-1-1 00:00:00")))) { 63 $statistics[$i] ++; 64 } 65 } 66 } 67 } 68 69 $max = 0; 70 foreach ($statistics as $index => $total) { 71 if ($total > $max) { 72 $max = $total; 73 } 74 $chart[] = array($index, $total); 75 } 76 77 $data['max'] = $max; 78 $chard[] = array("color" => "#e67e22", "label" => "Lượng ngưá»i dùng giá»i thiá»u bá»i cá»ng tác viên theo từng tháng", "data" => $chart); 79 $data['chard'] = $chard; 80 81 return $this->load->view('collaborator/reportAsistant/statistics', $data, true); 82 } 83 84 public function getLastquarter() { 85 $current_month = date('m'); 86 $current_year = date('Y'); 87 88 if ($current_month >= 1 && $current_month <= 3) { 89 $start_date = strtotime('1-October-' . ($current_year - 1)); // timestamp or 1-October Last Year 12:00:00 AM 90 $end_date = strtotime('1-Janauary-' . $current_year); // // timestamp or 1-January 12:00:00 AM means end of 31 December Last year 91 } else if ($current_month >= 4 && $current_month <= 6) { 92 $start_date = strtotime('1-January-' . $current_year); // timestamp or 1-Janauray 12:00:00 AM 93 $end_date = strtotime('1-April-' . $current_year); // timestamp or 1-April 12:00:00 AM means end of 31 March 94 } else if ($current_month >= 7 && $current_month <= 9) { 95 $start_date = strtotime('1-April-' . $current_year); // timestamp or 1-April 12:00:00 AM 96 $end_date = strtotime('1-July-' . $current_year); // timestamp or 1-July 12:00:00 AM means end of 30 June 97 } else if ($current_month >= 10 && $current_month <= 12) { 98 $start_date = strtotime('1-July-' . $current_year); // timestamp or 1-July 12:00:00 AM 99 $end_date = strtotime('1-October-' . $current_year); // timestamp or 1-October 12:00:00 AM means end of 30 September 100 } 101 return array("start" => $start_date, "end" => $end_date); 102 } 103 104 105 public function getCollaboratorsUsers($filters = array(), $id = false) { 106 107 $this->load->helper('pagging'); 108 $this->load->model('admin/collabolator_model'); 109 $data['current_page'] = $this->uri->segment(5, 1); 110 111 $data['itemsoptions'] = array(10, 25, 50, 100); 112 $data['perpage'] = 10; 113 if (!$id) { 114 $data['id'] = $this->uri->segment(4, 1); 115 } else { 116 $data['id'] = $id; 117 } 118 119 $data['keyword'] = ""; 120 $data['sorting_order'] = "sorting_desc"; 121 $data['sorting_field'] = "id"; 122 123 if ($this->input->post('sorting_order')) { 124 if ($this->input->post('sorting_order') != "sorting") { 125 $data['sorting_order'] = $this->input->post('sorting_order'); 126 $data['sorting_field'] = $this->input->post('sorting_field'); 127 } 128 } 129 if ($this->input->post('items')) { 130 $data['perpage'] = $this->input->post('items'); 131 } 132 if ($this->input->post('keyword')) { 133 $data['search_field'] = ""; 134 $data['keyword'] = $this->input->post('keyword'); 135 136 if (preg_match("/[0-9]/", $data['keyword'])) { 137 $data['search_field'] = "cellphone"; 138 } 139 } 140 141 $data['daterange_start'] = ""; 142 $data['daterange_end'] = ""; 143 if ($this->input->post('daterange')){ 144 $daterange = explode(" - ", $this->input->post('daterange')); 145 $daterange[0] = str_replace('/', '-', $daterange[0]); 146 $daterange[1] = str_replace('/', '-', $daterange[1]); 147 $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0])); 148 $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day')); 149 } 150 151 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 152 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data); 153 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 154 foreach ($data['paidlogs'] as $index=>$paidlog) 155 { 156 $data['paidlogs'][$index]['username']=$this->get_fullname($paidlog['us_id']); 157 } 158 $data['paging_url'] = base_url() . "/cong_tac_vien/thong_ke_cong_tac_vien/trang_ctv/" . $data['id']; 159 $data['num_links'] = 2; 160 $data['paging'] = pagging($data); 161 162 if ($this->input->is_ajax_request()) { 163 return $this->load->view('collaborator/reportAsistant/listview_user', $data); 164 } 165 return $this->load->view('collaborator/reportAsistant/listview_user', $data, true); 166 } 167 168 private function get_fullname($us_id) { 169 $fullname=""; 170 $src = 'violet'; 171 $token = md5($us_id . self::TOKENPW); 172 $this->load->model('admin/user_model'); 173 $data = $this->user_model->get_user_info($src, $us_id, $token); 174 parse_str($data,$data); 175 if (isset($data['fullname'])) 176 { 177 $fullname=$data['fullname']; 178 } 179 return $fullname; 180 } 181 16 182 17 public function profile(){ 183 18 $collaborator_info = $this->session->userdata('collaboratorInfo'); 184 19 if ($collaborator_info) { 185 20 $data['collaborator_id'] = $collaborator_info['id']; 21 $data['username'] = $collaborator_info['login_name']; 22 $data['fullname'] = $collaborator_info['fullname']; 186 23 $this->load->view('collaborator/collaborator_profile', $data); 24 }else{ 25 $this->load->view('login'); 26 } 27 } 28 29 public function updateCollaborator(){ 30 $this->load->model('collaborator_model'); 31 $collaborator_info = $this->session->userdata('collaboratorInfo'); 32 $result['success'] = 0; 33 if ($collaborator_info) { 34 35 $collaborator_id = $collaborator_info['id']; 36 $login_name = $collaborator_info['login_name']; 37 $input = $this->input->post(); 38 if (strlen($input['fullname']) == 0) { 39 $result['errors'][] = array("content"=>lang('_SBG_FULLNAME_REQUIRED_MSG'),"field"=>"fullname_err"); 40 } 41 if (!isset($result['errors'])) { 42 $collaborator = array('full_name' => $input['fullname']); 43 $result['success'] = 1; 44 $result['data'] = $this->collaborator_model->updateCollaborator($collaborator_id, $collaborator); 45 $collaboratorData = array('login_name' => $login_name, 'id' => $collaborator_id, 'fullname' => $input['fullname'], 'logined_in' => TRUE); 46 $this->session->set_userdata('collaboratorInfo', $collaboratorData); 47 } 48 echo json_encode($result); 187 49 }else{ 188 50 $this->load->view('login'); … … 192 54 public function change_password(){ 193 55 $this->load->model('collaborator_model'); 194 //$collaborator_id = $this->uri->segment(4, 1);195 56 $collaborator_info = $this->session->userdata('collaboratorInfo'); 196 57 if ($collaborator_info) { -
pro-violet-viettel/sourcecode/application/modules/collaborator/controllers/home.php
r883 r906 20 20 if ($collaborator_info) { 21 21 $id = $collaborator_info['id']; 22 $data['id'] = $id;23 22 $data['statistics'] = $this->getStatistics($id); 24 $data['content'] = $this->getCollaboratorsUsers(array(), $id);23 $data['content'] = $this->getCollaboratorsUsers(); 25 24 $this->load->view('collaborator/reportAsistant/indexCollaborator', $data); 26 25 } else { … … 122 121 123 122 124 public function getCollaboratorsUsers($filters = array(), $id = false) { 125 126 $this->load->helper('pagging'); 127 $this->load->model('admin/collabolator_model'); 128 $data['current_page'] = $this->uri->segment(5, 1); 129 130 $data['itemsoptions'] = array(10, 25, 50, 100); 131 $data['perpage'] = 10; 132 if (!$id) { 133 $data['id'] = $this->uri->segment(4, 1); 134 } else { 123 public function getCollaboratorsUsers() { 124 $collaborator_info = $this->session->userdata('collaboratorInfo'); 125 if ($collaborator_info) { 126 $this->load->helper('pagging'); 127 $this->load->model('admin/collabolator_model'); 128 $data['current_page'] = $this->uri->segment(5, 1); 129 130 $data['itemsoptions'] = array(10, 25, 50, 100); 131 $data['perpage'] = 10; 132 $id = $collaborator_info['id']; 135 133 $data['id'] = $id; 136 } 137 138 $data['keyword'] = ""; 139 $data['sorting_order'] = "sorting_desc"; 140 $data['sorting_field'] = "id"; 141 142 if ($this->input->post('sorting_order')) { 143 if ($this->input->post('sorting_order') != "sorting") { 144 $data['sorting_order'] = $this->input->post('sorting_order'); 145 $data['sorting_field'] = $this->input->post('sorting_field'); 146 } 147 } 148 if ($this->input->post('items')) { 149 $data['perpage'] = $this->input->post('items'); 150 } 151 if ($this->input->post('keyword')) { 152 $data['search_field'] = ""; 153 $data['keyword'] = $this->input->post('keyword'); 154 155 if (preg_match("/[0-9]/", $data['keyword'])) { 156 $data['search_field'] = "cellphone"; 157 } 158 } 159 160 $data['daterange_start'] = ""; 161 $data['daterange_end'] = ""; 162 if ($this->input->post('daterange')){ 163 $daterange = explode(" - ", $this->input->post('daterange')); 164 $daterange[0] = str_replace('/', '-', $daterange[0]); 165 $daterange[1] = str_replace('/', '-', $daterange[1]); 166 $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0])); 167 $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day')); 134 135 $data['keyword'] = ""; 136 $data['sorting_order'] = "sorting_desc"; 137 $data['sorting_field'] = "user_created_time"; 138 139 if ($this->input->post('sorting_order')) { 140 if ($this->input->post('sorting_order') != "sorting") { 141 $data['sorting_order'] = $this->input->post('sorting_order'); 142 $data['sorting_field'] = $this->input->post('sorting_field'); 143 } 144 } 145 if ($this->input->post('items')) { 146 $data['perpage'] = $this->input->post('items'); 147 } 148 if ($this->input->post('keyword')) { 149 $data['search_field'] = ""; 150 $data['keyword'] = $this->input->post('keyword'); 151 152 if (preg_match("/[0-9]/", $data['keyword'])) { 153 $data['search_field'] = "cellphone"; 154 } 155 } 156 157 $data['daterange_start'] = ""; 158 $data['daterange_end'] = ""; 159 if ($this->input->post('daterange')){ 160 $daterange = explode(" - ", $this->input->post('daterange')); 161 $daterange[0] = str_replace('/', '-', $daterange[0]); 162 $daterange[1] = str_replace('/', '-', $daterange[1]); 163 $data['date_start'] = $daterange[0]; 164 $data['date_end'] = $daterange[1]; 165 $data['daterange_start'] = date('Y-m-d H:i:s', strtotime($daterange[0])); 166 $data['daterange_end'] = date('Y-m-d H:is:s', strtotime($daterange[1].' + 1 day')); 167 } 168 169 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 170 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data); 171 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 172 foreach ($data['paidlogs'] as $index => $paidlog) 173 { 174 $data['paidlogs'][$index]['username'] = $this->get_fullname($paidlog['us_id']); 175 } 176 $data['paging_url'] = base_url() . "collaborator/home/getCollaboratorsUsers/".$data['id']; 177 $data['num_links'] = 2; 178 $data['paging'] = pagging($data); 179 180 if ($this->input->is_ajax_request()) { 181 return $this->load->view('collaborator/reportAsistant/listview_user', $data); 182 } 183 return $this->load->view('collaborator/reportAsistant/listview_user', $data, true); 184 }else{ 185 $this->load->view('login'); 168 186 } 169 170 $data['start'] = ($data['current_page'] - 1) * $data['perpage'];171 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data);172 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data);173 174 foreach ($data['paidlogs'] as $index => $paidlog)175 {176 177 $data['paidlogs'][$index]['username'] = $this->get_fullname($paidlog['us_id']);178 }179 180 $data['paging_url'] = base_url() . "cong_tac_vien/thong_ke_nguoi_dung/trang/" ;181 $data['num_links'] = 2;182 $data['paging'] = pagging($data);183 184 if ($this->input->is_ajax_request()) {185 return $this->load->view('collaborator/reportAsistant/listview_user', $data);186 }187 return $this->load->view('collaborator/reportAsistant/listview_user', $data, true);188 187 } 189 188 … … 202 201 } 203 202 203 204 public function export(){ 205 206 $collaborator_info = $this->session->userdata('collaboratorInfo'); 207 if ($collaborator_info) { 208 $id = $collaborator_info['id']; 209 $data['id'] = $id; 210 $data['fullname'] = $collaborator_info['fullname']; 211 $this->load->model('admin/collabolator_model'); 212 //$data['perpage'] = $this->uri->segment(4, 10); 213 $data['keyword'] = $this->uri->segment(5); 214 if ($data['keyword'] == 'default') $data['keyword'] = null; 215 if (preg_match("/[0-9]/", $data['keyword'])) { 216 $data['search_field'] = "cellphone"; 217 } 218 $data['daterange_start'] = $this->uri->segment(6); 219 $data['daterange_end'] = $this->uri->segment(7); 220 if ($data['daterange_start'] == 'default') $data['daterange_start'] = null; 221 if ($data['daterange_end'] == 'default') $data['daterange_end'] = null; 222 if ($data['daterange_start']) 223 $data['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $data ['daterange_start'] ) ); 224 if ($data['daterange_end']) 225 $data['daterange_end'] = date ( 'Y-m-d H:i:s', strtotime ( $data['daterange_end'] . ' + 1 day' ) ); 226 227 $data['sorting_field'] = "user_created_time"; 228 $data['sorting_order'] = $this->uri->segment(8); 229 230 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 231 232 foreach ($data['paidlogs'] as $index => $paidlog) 233 { 234 $data['paidlogs'][$index]['username'] = $this->get_fullname($paidlog['us_id']); 235 } 236 $users = $data['paidlogs']; 237 238 ob_end_clean(); 239 $this->load->library("PHPExcel"); 240 $sheet = $this->phpexcel->getActiveSheet(); 241 242 $sheet->setTitle("bao cao cua CTV " . date('m') . " - " . date('Y')); 243 $sheet->getColumnDimension('A')->setWidth(10); 244 $sheet->getColumnDimension('B')->setWidth(25); 245 $sheet->getColumnDimension('C')->setWidth(25); 246 $sheet->getColumnDimension('D')->setWidth(25); 247 $sheet->getColumnDimension('E')->setWidth(15); 248 $sheet->getColumnDimension('F')->setWidth(15); 249 $sheet->getColumnDimension('G')->setWidth(15); 250 $sheet->getColumnDimension('H')->setWidth(25); 251 $sheet->getColumnDimension('I')->setWidth(25); 252 253 254 $sheet->setCellValue('B1', "TẬP ÄOÃN VIá»N THÃNG QUÃN Äá»I"); 255 $style = array( 256 'font' => array('bold' => true, 'size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 257 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 258 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 259 'wrap' => true ) 260 ); 261 $sheet->mergeCells('B1:E1'); 262 $sheet->getStyle('B1')->applyFromArray($style); 263 264 $sheet->setCellValue('B2', "Tá»NG CÃNG TY VIá»N THÃNG VIETTEL"); 265 $style = array( 266 'font' => array('size' => 12, 'name' =>'Cambria', 'color' => array('rgb' => '0070bf')), 267 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 268 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 269 'wrap' => true ) 270 ); 271 $sheet->mergeCells('B2:E2'); 272 $sheet->getStyle('B2')->applyFromArray($style); 273 274 275 $sheet->setCellValue('A4', "DANH SÃCH NGƯá»I DÃNG DO Cá»NG TÃC VIÃN GIá»I THIá»U"); 276 $style = array( 277 'font' => array('bold' => true, 'size' => 14, 'name' =>'Cambria'), 278 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 279 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 280 'wrap' => true ) 281 ); 282 $sheet->mergeCells('A4:E4'); 283 $sheet->getStyle('A4')->applyFromArray($style); 284 285 286 287 $style = array( 288 'font' => array('size' => 11, 'name' =>'Cambria'), 289 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 290 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 291 'wrap' => true), 292 'borders' => array( 293 'allborders' => array( 294 'style' => \PHPExcel_Style_Border::BORDER_THIN 295 ) 296 ) 297 ); 298 299 $sheet->setCellValue('B6', "Từ ngà y: ".$data['daterange_start']); 300 $sheet->setCellValue('C6', "Äến ngà y: ".$data['daterange_end']); 301 $sheet->setCellValue('B7', "Ngà y kết xuất: ".date("d")."/".date("m")."/".date("Y")); 302 $sheet->setCellValue('C7', "CTV: ".$data['fullname']); 303 304 $sheet->getStyle('B6')->applyFromArray($style); 305 $sheet->getStyle('C6')->applyFromArray($style); 306 $sheet->getStyle('B7')->applyFromArray($style); 307 $sheet->getStyle('C7')->applyFromArray($style); 308 309 $sheet->setCellValue('A9', 'STT'); 310 $sheet->setCellValue('B9', 'Tên ngưá»i dùng'); 311 $sheet->setCellValue('C9', 'Sá» thuê bao'); 312 $sheet->setCellValue('D9', 'Ngà y giá» giá»i thiá»u'); 313 $style = array( 314 'font' => array('bold' => true, 'size' => 11, 'name' =>'Cambria'), 315 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 316 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 317 'wrap' => true), 318 'borders' => array( 319 'allborders' => array( 320 'style' => \PHPExcel_Style_Border::BORDER_THIN 321 ) 322 ) 323 ); 324 $sheet->getStyle('A9:D9')->applyFromArray($style); 325 326 $style = array( 327 'font' => array('size' => 11, 'name' =>'Cambria'), 328 'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER, 329 'vertical' => \PHPExcel_Style_Alignment::VERTICAL_CENTER, 330 'wrap' => true), 331 'borders' => array( 332 'allborders' => array( 333 'style' => \PHPExcel_Style_Border::BORDER_THIN 334 ) 335 ) 336 ); 337 338 $dem = 0; 339 foreach ($users as $index => $user): 340 $sheet->setCellValue('A' . ($dem + 10), $index + 1); 341 $sheet->setCellValue('B' . ($dem + 10), $user['username']); 342 $sheet->setCellValueExplicit('C' . ($dem + 10), $user['user_cellphone'], PHPExcel_Cell_DataType::TYPE_STRING); 343 $sheet->setCellValue('D' . ($dem + 10), $user['user_created_time']); 344 $sheet->getStyle('A' . ($dem + 10).':D'.($dem + 10))->applyFromArray($style); 345 $dem++; 346 endforeach; 347 348 $writer = new PHPExcel_Writer_Excel5($this->phpexcel); 349 header('Content-Type: application/vnd.ms-excel'); 350 header('Content-Disposition: attachment; filename="danhsachnguoidung_ctv_'.date('d/m/Y').'.xls"'); 351 $writer->save('php://output'); 352 }else{ 353 $this->load->view('login'); 354 } 355 } 356 204 357 } -
pro-violet-viettel/sourcecode/application/modules/collaborator/controllers/user.php
r883 r906 22 22 $this->load->view('collaborator/user/index', $data); 23 23 }else{ 24 show_404();24 $this->load->view(login); 25 25 } 26 26 } … … 32 32 $collaborator = $collaborator_info['login_name']; 33 33 $config['upload_path'] = './upload/uploads/'; 34 $config['allowed_types'] = 'xls|xlsx'; 35 /*$config['max_size'] = '100'; 36 $config['max_width'] = '1024'; 37 $config['max_height'] = '768';*/ 38 34 $config['allowed_types'] = '*'; 39 35 $this->load->library('upload', $config); 40 36 … … 43 39 $error = array('error' => $this->upload->display_errors('', '')); 44 40 $data['success'] = 0; 45 $data[' process'] = $error;41 $data['upload_error'] = $error; 46 42 } 47 43 else … … 49 45 $data = array('upload_data' => $this->upload->data()); 50 46 $file = $data['upload_data']['full_path']; 51 //$result = $this->processData($file);52 47 $process = $this->processData($file, $collaborator); 53 48 if ($process){ 54 49 $data['process'] = $process; 55 56 50 }else{ 57 $data['process'] = null; 51 $data['process'] = null; 58 52 } 59 53 $data['success'] = 1; … … 61 55 $result = $this->load->view('collaborator/user/result', $data, true); 62 56 echo json_encode($result); 57 63 58 }else{ 64 show_404();59 $this->load->view('login'); 65 60 } 66 61 } … … 93 88 $this->load->model('collaborator_model'); 94 89 $data = $this->readExcelFile($file); 90 95 91 $result = array(); 96 92 $user = array(); … … 104 100 $user['district'] = $arrPD['district']; 105 101 $user['school'] = $value['E']; 106 $user['username'] = $this->services_model->formatPhoneNumber( $value['F'], 2);102 $user['username'] = $this->services_model->formatPhoneNumber((string)$value['F'], 2); 107 103 $user['service'] = $value['G']; 108 104 $user['amount'] = $value['H']; 109 105 $user['collboratorId'] = $value['I']; 110 106 107 111 108 if ($user['username']){ 112 109 113 110 if (!preg_match('/^([0-9]{10,11}$)$/', $user['username'])) { 114 $result[$index ]['success'] = 0;115 $result[$index ]['error'] = lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG');116 $result[$index ]['user'] = $user;111 $result[$index-1]['success'] = 0; 112 $result[$index-1]['error'] = lang('_SBG_MO_PHONENUM_WRONG_FORMAT_MSG'); 113 $result[$index-1]['user'] = $user; 117 114 }else{ 118 $result[$index] = $this->collaborator_model->processUser($user, $sentNumber); 119 120 115 $result[$index-1] = $this->collaborator_model->processUser($user, $sentNumber); 121 116 } 122 $result[$index]['date'] = date('d-m-Y H:i:s');123 117 } 124 118 125 119 endforeach; 126 120 } 127 128 121 return $result; 129 122 } -
pro-violet-viettel/sourcecode/application/modules/collaborator/models/collaborator_model.php
r883 r906 7 7 if ( ! defined('_SBG_REGISTER_VIP_FOR')) define('_SBG_REGISTER_VIP_FOR', 'VIP'); 8 8 if ( ! defined('_SBG_CHARGING_FOR')) define('_SBG_CHARGING_FOR', 'NAP'); 9 if ( ! defined('_SBG_SYNTAX_ERR')) define('_SBG_SYNTAX_ERR', 'SYNTAX_ERR');9 if ( ! defined('_SBG_SYNTAX_ERR')) define('_SBG_SYNTAX_ERR', 'SYNTAX_ERR'); 10 10 11 11 if ( ! defined('_SBG_CHARGING_SUCCESS')) define('_SBG_CHARGING_SUCCESS', 1); … … 24 24 if ( ! defined('_SBG_PAIDTYPE_CARD')) define('_SBG_PAIDTYPE_CARD', 2); 25 25 26 if ( ! defined('_SBG_MO_PROCCESS_ERR')) define('_SBG_MO_PROCCESS_ERR', 0); 27 26 28 class Collaborator_model extends CI_Model { 27 29 … … 40 42 $this->load->helper('language'); 41 43 $this->lang->load('messages', 'message'); 42 }43 44 public function isExistUser($username){45 return false;46 44 } 47 45 … … 66 64 } 67 65 66 68 67 return array('case' => $case, 'content' => $aryContent); 69 68 } 70 69 71 public function processUser($user, $sentNumber){ 70 public function isExistUser($cellphone) 71 { 72 $sql = "SELECT * FROM tbluser WHERE cellphone = ?"; 73 $this->db->query($sql, array('cellphone'=>$cellphone)); 74 if ($this->db->affected_rows() >0){ 75 return true; 76 }else{ 77 return false; 78 } 79 } 80 81 public function processUser($user, $sentNumber) 82 { 83 $this->load->model('frontend/user_model'); 84 $data = array(); 85 $data['charging'] = array(); 86 $data['register-vip'] = array(); 87 $data['register'] = array(); 88 $username = $user['username']; 89 $service = $user['service']; 90 $amount = $user['amount']; 91 $isExist = $this->isExistUser($username); 92 //$isExist = false; 93 if (!$isExist){ 94 $data['register']['data'] = $this->registerUser($user, $sentNumber); 95 $user['service'] = "ÄÄng kÜ"; 96 $user['amount'] = null; 97 $data['register']['user'] = $user; 98 $data['register']['date'] = date('d-m-Y H:i:s'); 99 }else{ 100 $data['register']['data']['success'] = 0; 101 $data['register']['data']['error'] = "Ngưá»i dùng Äã tá»n tại"; 102 $user['service'] = "ÄÄng kÜ"; 103 $user['amount'] = null; 104 $data['register']['user'] = $user; 105 $data['register']['date'] = date('d-m-Y H:i:s'); 106 } 107 108 // NAP 109 if ($amount){ 110 $user['amount'] = $amount; 111 $data['charging']['data'] = $this->chargingForUser($user, $sentNumber); 112 $user['service'] = "Nạp tiá»n"; 113 $data['charging']['user'] = $user; 114 $data['charging']['date'] = date('d-m-Y H:i:s'); 115 } 116 if ($service){ 117 // ÄK VIP 118 119 $aryMatched = explode(' ', trim($service)); 120 $p_code = $aryMatched[1]; 121 $package = $package = $this->user_model->get_package ( $p_code ); 122 $amount = $package['p_price']; 123 $user['amount'] = $amount; 124 $data['chargingvip']['data'] = $this->chargingForUser($user, $sentNumber); 125 $user['service'] = "Nạp tiá»n"; 126 $data['chargingvip']['user'] = $user; 127 $data['chargingvip']['date'] = date('d-m-Y H:i:s'); 128 129 if ($data['chargingvip']['data']['success'] == 1){ 130 131 $data['register-vip']['data'] = $this->registerVipUser($user, $p_code); 132 $user['service'] = "ÄÄng kÜ ".trim($service); 133 $user['amount'] = -$amount; 134 $data['register-vip']['user'] = $user; 135 $data['register-vip']['date'] = date('d-m-Y H:i:s'); 136 }else{ 137 $data['register-vip']['data']['success'] = 0; 138 $data['register-vip']['data']['error'] = "Tà i khoản chÃnh cá»§a thuê bao ".$sentNumber. " khÃŽng Äá»§ Äá» thá»±c hiá»n giao dá»ch nà y"; 139 $user['service'] = "ÄÄng kÜ ".trim($service); 140 $user['amount'] = -$amount; 141 $data['register-vip']['user'] = $user; 142 $data['register-vip']['date'] = date('d-m-Y H:i:s'); 143 } 144 145 } 146 /* 147 }elseif ($service){ 148 // ÄK VIP 149 $aryMatched = explode(' ', trim($service)); 150 $p_code = $aryMatched[1]; 151 $data['register-vip']['data'] = $this->registerVipUser($user, $p_code); 152 $user['service'] = "ÄÄng kÜ ".trim($service); 153 $data['register-vip']['user'] = $user; 154 $data['register-vip']['date'] = date('d-m-Y H:i:s'); 155 }else{ 156 // DK 157 $data['register']['data'] = $this->registerUser($user, $sentNumber); 158 $user['service'] = "ÄÄng kÜ"; 159 $data['register']['user'] = $user; 160 $data['register']['date'] = date('d-m-Y H:i:s'); 161 }*/ 162 return $data; 163 } 164 /* 165 public function processUser($user, $sentNumber) 166 { 72 167 $data = array(); 73 168 $serviceAnalys = $this->serviceAnalys($user['service']); 74 169 75 170 $case = $serviceAnalys['case']; 76 $aryContents = isset($serviceAnalys['content']) ? $serviceAnalys['content']: null; 171 $aryContents = isset($serviceAn 172 alys['content']) ? $serviceAnalys['content']: null; 77 173 78 174 switch($case){ 79 175 case _SBG_REGISTER_FOR: 80 $data = $this->registerUser($user );176 $data = $this->registerUser($user, $sentNumber); 81 177 break; 82 178 case _SBG_REGISTER_VIP_FOR: … … 98 194 99 195 } 100 101 public function registerUser($user){ 196 */ 197 public function registerUser($user, $sentNumber) 198 { 102 199 103 200 $data = array(); 104 $data['user'] = $user;201 //$data['user'] = $user; 105 202 $this->load->model('frontend/user_model'); 106 203 $this->load->model('services/services_model'); … … 108 205 $token = md5($user['username'] . self::TOKENPW); 109 206 $sms = ''; 110 $collborator = $user['collboratorId'];207 $collboratorId = $user['collboratorId']; 111 208 $username = $user['username']; 112 209 $password = $this->createRandomPassword(); … … 139 236 $arrUser['us_id'] = $us_id; 140 237 $arrUser['cellphone'] = $username; 141 $arrUser['coll borator'] = $collborator;238 $arrUser['collaborator'] = $sentNumber; 142 239 $arrUser['acc_balanced'] = 0; 143 240 $arrUser['p_id'] = $trialpackage['p_id']; … … 178 275 } 179 276 180 public function registerVipUser($arrUser, $p_code){ 277 public function registerVipUser($arrUser, $p_code) 278 { 181 279 $data = array(); 182 $data['user'] = $arrUser;280 //$data['user'] = $arrUser; 183 281 $this->load->model('frontend/user_model'); 184 282 $username = $arrUser['username']; … … 232 330 } 233 331 234 public function chargingForUser($user, $sentNumber){ 332 public function chargingForUser($user, $sentNumber) 333 { 235 334 236 335 $this->load->model('services/services_model'); 237 336 $this->load->model('frontend/user_model'); 238 337 $data = array(); 239 $data['user'] = $user;338 //$data['user'] = $user; 240 339 $username = $user['username']; 241 340 $amount = $user['amount']; 341 342 if (!preg_match('/^[0-9]{3,}$/', $amount)) { 343 $smsReturn = lang('_SBG_MO_AMOUNT_WRONG_FORMAT_MSG'); 344 $data['success'] = 0; 345 $data['error'] = $smsReturn; 346 } 242 347 243 348 $result =$this->services_model->chargeRootAccountProcess($sentNumber, $amount, $sentNumber.' paid for SBG'); … … 284 389 } 285 390 286 287 public function createRandomPassword(){ 391 public function getCollaboratorByPhone($sentNumber){ 392 $sql = "SELECT * from tblcollaborator where login_name = ? LIMIT 0,1"; 393 $query = $this->db->query ( $sql, array ( $sentNumber ) ); 394 $row = $query->row_array (); 395 return $row; 396 } 397 398 public function getPassword($sentNumber){ 399 $collaborator = array(); 400 $collaborator = $this->getCollaboratorByPhone($sentNumber); 401 if ($collaborator){ 402 $passwd = $this->createRandomPassword(); 403 $collaborator['passwd'] = md5($passwd); 404 $this->updateCollaborator($collaborator['id'], $collaborator); 405 $aryPatterns = array('/:password:/'); 406 $sms = preg_replace($aryPatterns, array($passwd), lang('_SBG_COLLABORATOR_PASSWORD_MSG')); 407 $status = 1; 408 409 }else{ 410 $aryPatterns = array('/:collaborator:/'); 411 $sms = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_COLLABORATOR_NOT_FOUND_MSG')); 412 $status = 0; 413 } 414 return $status . '|' . $sms; 415 } 416 417 public function createRandomPassword() 418 { 288 419 $alphabet = "0123456789"; 289 420 $pass = array (); … … 296 427 } 297 428 298 public function getProvinceAndDistict($province, $district){ 299 $result['province'] = $province; 300 $result['district'] = $district; 429 public function getProvinceAndDistict($province, $district) 430 { 431 $result['province'] = ''; 432 $p = trim(ucwords($province)); 433 $result['district'] = ''; 434 $d = trim(ucwords($district)); 301 435 $provinces = lang('_PROVINCES_'); 302 436 303 437 foreach ($provinces as $key => $pro): 304 if($p rovince== $pro){438 if($p == $pro){ 305 439 $result['province'] = $key; 306 440 break; 307 441 } 308 442 endforeach; 309 $sql = "SELECT * FROM tbldistrict where province_id = ? AND district_name = ?"; 310 311 $query = $this->db->query ( $sql, array ($result['province'], $result['district']) ); 443 //$sql = "SELECT * FROM tbldistrict where province_id = ? AND district_name LIKE '%".$d."%'"; 444 $sql = "SELECT * FROM tbldistrict where province_id = ? AND INSTR(?, district_name)>0"; 445 //write_file('./log/sql.log', date('d-m-Y H:i:s') . ": " . $sql . "\n", FOPEN_WRITE_CREATE); 446 $query = $this->db->query ( $sql, array ($result['province'], $d) ); 312 447 if ($query->num_rows () > 0) { 313 448 $row = $query->row_array (); … … 317 452 } 318 453 319 public function updateCollaborator($id, $collaborator){ 454 public function updateCollaborator($id, $collaborator) 455 { 320 456 $this->db->where ( 'id', $id ); 321 457 return $this->db->update ( 'tblcollaborator', $collaborator ); 322 458 } 323 459 324 public function checkPassCollaborator($id, $passwd){ 460 public function checkPassCollaborator($id, $passwd) 461 { 325 462 $passwd = md5($passwd);; 326 463 $sql = "SELECT * FROM tblcollaborator WHERE id = ? AND passwd = ?"; … … 332 469 } 333 470 } 471 472 public function insertUser($user) 473 { 474 $this->db->insert ( 'tbluser', $user ); 475 //var_dump($user); 476 if ($this->db->affected_rows()>0){ 477 return true; 478 }else{ 479 return false; 480 } 481 } 334 482 } -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/collaborator_profile.php
r883 r906 18 18 <div class="collaborator-profile row" id="collaborator-profile-3"> 19 19 <div class="col-sm-offset-1 col-sm-10"> 20 21 20 <div class="tabbable"> 22 21 <ul class="nav nav-tabs padding-16"> 23 24 <li class="active"> 25 <a id="edit-password-tab" href="" data-toggle="tab"> 22 <li class="active"> 23 <a id="edit-basic-tab" href="#edit-basic" data-toggle="tab"> 24 <i class="blue icon-key bigger-125"></i> 25 ThÃŽng tin cá nhân 26 </a> 27 </li> 28 <li> 29 <a id="edit-password-tab" href="#edit-password" data-toggle="tab"> 26 30 <i class="blue icon-key bigger-125"></i> 27 31 Thay Äá»i máºt khẩu 28 32 </a> 29 33 </li> 30 31 34 </ul> 32 35 33 36 <div class="tab-content profile-edit-tab-content"> 34 <div class="tab-pane active" id="edit-password"> 35 <!--<form id="frm-change-password" class="form-horizontal" role="form" action="<?php echo $base_url; ?>collaborator/collaborator/change_password" method="POST">--> 37 <div class="tab-pane active" id="edit-basic"> 38 <form id="frm-update-info" class="form-horizontal" role="form"> 39 <h4 class="header blue bolder smaller">ThÃŽng tin cá nhân</h4> 40 <div class="row"> 41 <div class="col-sm-9"> 42 <div class="form-group"> 43 <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Sá» Äiá»n thoại</label> 44 <div class="col-sm-8"> 45 <input type="text" name="username" value="<?php echo $username; ?>" placeholder="Sá» Äiá»n thoại" id="form-field-username" class="col-xs-12 col-sm-10" disabled> 46 </div> 47 </div> 48 <div class="form-group"> 49 <label for="form-field-first" class="col-sm-4 control-label no-padding-right">Há» và tên</label> 50 <label class="block clearfix has-error"> 51 <div class="col-sm-8"> 52 <input type="text" name="fullname" value="<?php echo $fullname; ?>" placeholder="Há» và tên" id="form-field-first" class="col-xs-12 col-sm-10"> 53 </div> 54 <small><div class="col-sm-8 help-block" id="fullname_err"> </div></small> 55 </label> 56 </div> 57 </div> 58 </div> 59 <div class="clearfix form-actions"> 60 <div class="col-md-offset-3 col-md-9"> 61 <button type="button" onclick="return updateInfo();" class="btn btn-info"> 62 <i class="icon-ok bigger-110"></i> 63 Cáºp nháºt 64 </button> 65 </div> 66 </div> 67 </form> 68 </div> 69 70 <div class="tab-pane" id="edit-password"> 71 36 72 <form id="frm-change-password" class="form-horizontal" role="form"> 37 73 <h4 class="header blue bolder smaller">Thay Äá»i máºt khẩu</h4> … … 81 117 <div class="col-md-offset-3 col-md-9"> 82 118 <button type="button" onclick="return changePassword(<?php echo $collaborator_id; ?>);" class="btn btn-info"> 83 <!--<button type="submit" class="btn btn-info">-->84 119 <i class="icon-ok bigger-110"></i> 85 120 Thay Äá»i … … 90 125 </form> 91 126 </div> 127 92 128 93 129 </div> … … 103 139 </div><!-- /.main-container-inner --> 104 140 </div><!-- /.main-container --> 141 142 <div class="modal fade" id="updateInfoSuccess" tabindex="-1" role="dialog"aria-hidden="true"> 143 <div class="modal-dialog"> 144 <div class="modal-content"> 145 <div class="modal-header"> 146 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> 147 <h4 class="modal-title">Cáºp nháºt thÃŽng tin</h4> 148 </div> 149 <div class="modal-body"> 150 <div class="alert alert-block alert-success"><center><?php echo lang('_SBG_USER_UPDATE_INFO_SUCCESS_MSG'); ?><center></div> 151 <center><button id="close" class="btn btn-primary" data-dismiss="modal">Äóng</button></center> 152 </div> 153 154 </div> 155 </div> 156 </div> 105 157 106 158 <div class="modal fade" id="changePassSuccess" tabindex="-1" role="dialog"aria-hidden="true"> -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/login.php
r883 r906 80 80 <div class="help-block"> </div> 81 81 </label> 82 83 <label class="block clearfix alert-success"> 84 Nếu chưa có hoặc quên máºt khẩu, soạn tin nhắn theo cú pháp: <strong>SBG CTV</strong> gá»i <strong>8062</strong> 85 </label> 86 87 82 88 83 89 <div class="space"></div> -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/reportAsistant/indexCollaborator.php
r883 r906 16 16 { 17 17 // $result = jQuery.parseJSON(data); 18 console.log(data); 18 19 $("#content").html(data); 19 20 init_page(); … … 122 123 daterange = $('input[name="daterange"]').val(); 123 124 $.ajax({ 124 url: '<?php echo base_url();?>co ng_tac_vien/thong_ke_cong_tac_vien/trang_ctv/<?php echo $id;?>/1',125 url: '<?php echo base_url();?>collaborator/home/getCollaboratorsUsers/<?php echo $id;?>/1', 125 126 type: "POST", 126 127 data: $("#collaborator").serialize(), … … 219 220 </div><!-- /.modal-dialog --> 220 221 <?php 221 $this->load->view('layout/ admin/footer', array('base_url' => $base_url,'adminjs' => array('assets/js/admin/collaborator.js')));222 $this->load->view('layout/collaborator/footer', array('base_url' => $base_url,'collaboratorjs' => array('assets/js/collaborator/collaborator.js'))); 222 223 ?> -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/reportAsistant/listview_user.php
r883 r906 3 3 <!-- PAGE CONTENT BEGINS --> 4 4 <div style="padding-bottom:4px" class="table-header"> 5 5 6 Äã giá»i thiá»u 7 <div class="pull-right" style="margin:5px;"> 8 <a style="color:#fff" href="<?php echo base_url();?>collaborator/home/export/<?php echo $perpage?>/<?php echo ($keyword)?$keyword:'default'; ?>/<?php echo ($date_start)?$date_start:'default'; ?>/<?php echo ($date_end)?$date_end:'default'; ?>/<?php echo $sorting_order; ?>">Xuất ra Excel</a> 9 </div> 6 10 </div> 7 11 … … 43 47 <th class="<?php if ($sorting_field == 'full_name') {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">Tên ngưá»i dùng</th> 44 48 <th class="<?php if ($sorting_field == 'collaborator_cellphone') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_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">Sá» thuê bao</th> 45 <th class="<?php if ($sorting_field == ' total_user') {echo $sorting_order;} else {echo "sorting";}?>" id="total_user" 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">Ngà y giá»i thiá»u</th>49 <th class="<?php if ($sorting_field == 'user_created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="user_created_time" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Ngà y giá»i thiá»u: activate to sort column ascending">Ngà y giá»i thiá»u</th> 46 50 <!--<th class="<?php if ($sorting_field == 'collaborator_created_time') {echo $sorting_order;} else {echo "sorting";}?>" id="collaborator_created_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 ÄÄng kÜ</th>--> 47 51 … … 52 56 53 57 <?php 58 //var_dump($paidlogs); 54 59 foreach ($paidlogs as $paidlog) { 55 60 ?> -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/user/index.php
r883 r906 29 29 <div class="row" id="content"> 30 30 <div class="col-xs-12"> 31 <div class="row"> 32 <div class="col-sm-offset-1 col-sm-10"> 33 <form method="POST" id="frm-upload" action="" enctype="multipart/form-data" class="form-horizontal"> 34 <h4 class="header blue bolder smaller">Chá»n và tải file từ máy tÃnh</h4> 35 <div class="row"> 36 <div class="col-sm-9"> 37 <div class="form-group"> 38 <div class="col-sm-8" > 31 <div class="col-sm-offset-0 col-sm-12"> 32 <div class="row"> 33 <h4 class="header blue bolder smaller"> Bưá»c 1: Tải file ÄÄng kÜ <a href="<?php echo $base_url ?>assets/Mau dang ky cua CTV.xls"><span style="color: red;">Tại Äây</span></a></h4> 34 </div> 35 <div class="row"> 36 <h4 class="header blue bolder smaller">Bưá»c 2: Äiá»n thÃŽng tin và o file ÄÄng kÜ</h4> 37 <h5> 38 <ul class="nav"> 39 <li> <b>Tên khách hà ng</b>: KhÃŽng bắt buá»c</li> 40 <li> <b>Tá»nh</b>: KhÃŽng bắt buá»c</li> 41 <li> <b>Quáºn/Huyá»n</b>: KhÃŽng bắt buá»c</li> 42 <li> <b>ÄÆ¡n vá»</b>: KhÃŽng bắt buá»c</li> 43 <li> <b>Sá» Äiá»n thoại khách hà ng</b>: Bắt buá»c (có thá» có sá» 0 Äứng Äầu hoặc khÃŽng có; phải là sá» Äiá»n thoại Äi Äá»ng, chá» há» trợ Viettel, Vinaphone và Mobifone)</li> 44 <li> <b>ÄÄng kÜ gói dá»ch vụ</b>: KhÃŽng bắt buá»c (Chá»n VIP 1 hoặc VIP 3 hoặc Äá» trá»ng)</li> 45 <li> <b>Sá» tiá»n nạp và o TK SBG cá»§a khách hà ng</b>: KhÃŽng bắt buá»c (Nếu chá»n thì chá»n các giá trá» có sẵn hoặc Äá» trá»ng)</li> 46 <li> <b>Mã CTV</b>: KhÃŽng bắt buá»c</li> 47 </ul> 48 </h5> 49 </div> 50 <div class="row"> 51 <h4 class="header blue bolder smaller">Lưu Ü:</h4> 52 <h5><ul> 53 <li> File ÄÄng kÜ mẫu phải giữ nguyên Äá»nh dạng XLS. KhÃŽng sá»a Äá»nh dạng cá»§a file mẫu, má»i sá»± thay Äá»i khÃŽng Äúng sẜ có thá» dẫn Äến viá»c trừ tiá»n từ tà i khoản cá»§a CTV khÃŽng Äúng.</li> 54 <li> Các giao dá»ch trên file, nếu có tÃnh phà thì phà sẜ ÄÆ°á»£c trừ trá»±c tiếp từ tà i khoản chÃnh cá»§a sá» Äiá»n thoại CTV (chÃnh là sá» ÄT dùng Äá» ÄÄng nháºp).</li> 55 </ul></h5> 56 </div> 57 58 <div class="row"> 59 <h4 class="header blue bolder smaller">Buá»c 3: Upload file ÄÄng kÜ</h4> 60 <div class="col-sm-offset-1 col-sm-10"> 61 <!--<h4 class="header blue bolder smaller">Chá»n và tải file từ máy tÃnh</h4>--> 62 <form method="POST" id="frm-upload" action="" enctype="multipart/form-data" class="form-horizontal"> 63 64 <div class="row"> 65 <div class="col-sm-9"> 66 <div class="form-group"> 67 <div class="col-sm-8" > 68 69 <input type="text" id="input-upload" class="form-control"/> 70 <div class="file-upload btn btn-success"> 71 <span>Chá»n file ...</span> 72 73 <input id="userfile" type="file" class="upload" name="userfile" /> 74 </div> 75 <input type="submit" id="btn-submit" class="btn btn-primary" value="Tải lên" /> 76 </div> 39 77 40 <input type="text" id="input-upload" class="form-control"/>41 <div class="file-upload btn btn-success">42 <span>Chá»n file ...</span>43 44 <input id="userfile" type="file" class="upload" name="userfile" />45 </div>46 <input type="submit" id="btn-submit" class="btn btn-primary" value="Tải lên" />47 78 </div> 48 49 79 </div> 50 80 </div> 51 </div> 52 <h4 class="header blue bolder smaller"></h4> 53 81 <h4 class="header blue bolder smaller"></h4> 82 54 83 55 </form> 84 </form> 85 </div> 56 86 </div> 57 87 </div> … … 61 91 <center><label id="charging" style="display: none;"><h4><span class="icon-refresh icon-refresh-animate"></span> Äang xá» lÜ. Xin vui lòng chá»...</h4></label></center> 62 92 <div id="result"> 63 </div> 93 </div> 94 95 64 96 </div><!-- /.main-content --> 65 97 </div><!-- /.main-container-inner --> -
pro-violet-viettel/sourcecode/application/modules/collaborator/views/user/result.php
r883 r906 1 <?php if ($success==0){ ?>1 <?php if ($success == 0){ ?> 2 2 <div id="error-upload" class="alert alert-danger" role="alert"> 3 3 <span class="icon-exclamation-sign" aria-hidden="true"></span> 4 <span class="sr-only">Error:</span> <?php echo " ".$ process['error']; ?>4 <span class="sr-only">Error:</span> <?php echo " ".$upload_error['error']; ?> 5 5 </div> 6 <?php }else if($success == 1){ ?>7 <?php if ($process){?>6 <?php }else { ?> 7 <?php if($process){ ?> 8 8 <div class="row"> 9 9 <div class="col-xs-12"> 10 <!-- PAGE CONTENT BEGINS -->11 10 <div style="padding-bottom:4px" class="table-header"> 12 11 Kết quả 13 12 </div> 14 <?php //if ($success == 0){ ?>15 16 <?php //}elseif($success == 1){ ?>17 13 <div class="table-responsive"> 18 14 <div role="grid" class="dataTables_wrapper" id="sample-table-2_wrapper"> … … 21 17 <thead> 22 18 <tr role="row"> 23 <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">24 <label>25 <input type="checkbox" class="ace">26 <span class="lbl"></span>27 </label>28 19 </th> 29 20 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Sá» Äiá»n thoại</th> 30 21 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Há» và tên</th> 31 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;"> Góidá»ch vụ</th>32 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Sá» tiá»n nạp và o</th>22 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Tên dá»ch vụ</th> 23 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Sá» tiá»n</th> 33 24 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Ngà y giá» thá»±c hiá»n</th> 34 25 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">Kết quả</th> 35 26 <th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 156px;">LÜ do</th> 36 27 </tr> 37 <tbody role="alert" aria-live="polite" aria-relevant="all"> 38 39 <?php 40 foreach ($process as $user): ?> 41 <tr class="odd"> 42 <td class="center sorting_1"> 43 <label> 44 <input type="checkbox" class="ace"> 45 <span class="lbl"></span> 46 </label> 47 </td> 48 <td class=" "><?php echo $user['user']['username']; ?></td> 49 <td class=" "><?php echo $user['user']['fullname']; ?></td> 50 <td class=" "><?php echo $user['user']['service']; ?></td> 51 <td class=" "><?php echo $user['user']['amount']; ?></td> 52 <td class=" "><?php echo $user['date']; ?></td> 53 <td class=" "><?php echo ($user['success'] == 1? "Thà nh cÃŽng": "KhÃŽng thà nh cÃŽng"); ?></td> 54 <td class=" "><?php echo $user['error']; ?></td> 55 </tr> 56 <?php endforeach; ?> 28 <tbody role="alert" aria-live="polite" aria-relevant="all"> 29 <?php foreach ($process as $result ){ ?> 30 31 <?php if ($result['register']){ ?> 32 <tr> 33 <td class=" "><?php echo $result['register']['user']['username']; ?></td> 34 <td class=" "><?php echo $result['register']['user']['fullname']; ?></td> 35 <td class=" "><?php echo $result['register']['user']['service']; ?></td> 36 <td class=" "><?php echo $result['register']['user']['amount']; ?></td> 37 <td class=" "><?php echo $result['register']['date']; ?></td> 38 <td class=" "><?php echo ($result['register']['data']['success'] == 1? "Thà nh cÃŽng": "KhÃŽng thà nh cÃŽng"); ?></td> 39 <td class=" "><?php echo $result['register']['data']['error']; ?></td> 40 </tr> 41 <?php } ?> 42 43 <?php if ($result['charging']){ ?> 44 <tr> 45 <td class=" "><?php echo $result['charging']['user']['username']; ?></td> 46 <td class=" "><?php echo $result['charging']['user']['fullname']; ?></td> 47 <td class=" "><?php echo $result['charging']['user']['service']; ?></td> 48 <td class=" "><?php echo number_format($result['charging']['user']['amount'], 0); ?></td> 49 <td class=" "><?php echo $result['charging']['date']; ?></td> 50 <td class=" "><?php echo ($result['charging']['data']['success'] == 1? "Thà nh cÃŽng": "KhÃŽng thà nh cÃŽng"); ?></td> 51 <td class=" "><?php echo $result['charging']['data']['error']; ?></td> 52 </tr> 53 <?php } ?> 54 55 <?php if ($result['chargingvip']){ ?> 56 <tr> 57 <td class=" "><?php echo $result['chargingvip']['user']['username']; ?></td> 58 <td class=" "><?php echo $result['chargingvip']['user']['fullname']; ?></td> 59 <td class=" "><?php echo $result['chargingvip']['user']['service']; ?></td> 60 <td class=" "><?php echo number_format($result['chargingvip']['user']['amount'], 0); ?></td> 61 <td class=" "><?php echo $result['chargingvip']['date']; ?></td> 62 <td class=" "><?php echo ($result['chargingvip']['data']['success'] == 1? "Thà nh cÃŽng": "KhÃŽng thà nh cÃŽng"); ?></td> 63 <td class=" "><?php echo $result['chargingvip']['data']['error']; ?></td> 64 </tr> 65 <?php } ?> 66 67 <?php if ($result['register-vip']){ ?> 68 <tr> 69 <td class=" "><?php echo $result['register-vip']['user']['username']; ?></td> 70 <td class=" "><?php echo $result['register-vip']['user']['fullname']; ?></td> 71 <td class=" "><?php echo $result['register-vip']['user']['service']; ?></td> 72 <td class=" "><?php echo number_format($result['register-vip']['user']['amount'], 0); ?></td> 73 <td class=" "><?php echo $result['register-vip']['date']; ?></td> 74 <td class=" "><?php echo ($result['register-vip']['data']['success'] == 1? "Thà nh cÃŽng": "KhÃŽng thà nh cÃŽng"); ?></td> 75 <td class=" "><?php echo $result['register-vip']['data']['error']; ?></td> 76 </tr> 77 <?php } ?> 78 79 80 <?php } ?> 81 57 82 </tbody> 58 83 </thead> 59 84 </table> 60 85 </div> 61 86 </div> 62 87 </div> 63 88 </div> 64 </div> 65 <?php }else{ ?> 66 <div id="error-upload" class="alert alert-danger" role="alert"> 67 <span class="icon-exclamation-sign" aria-hidden="true"></span> 68 <span class="sr-only">Error:</span> KhÃŽng Äá»c ÄÆ°á»£c file</div> 89 </div> 69 90 <?php } ?> 70 91 <?php } ?>
Note: See TracChangeset
for help on using the changeset viewer.