Changeset 906 for pro-violet-viettel/sourcecode/application/modules
- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
r838 r906 17 17 $admin_info = $this->session->userdata('adminInfo'); 18 18 if ($admin_info) { 19 $data['content'] = $this->getCollaborators(); 19 $roles=array(); 20 foreach ($admin_info['roles'] as $role) 21 { 22 $roles[]=$role['role_name']; 23 } 24 //$data['roles']=$roles; 25 $data['content'] = $this->getCollaborators(array(), $roles); 20 26 $this->load->view('collaborator/index', $data); 21 27 } else { … … 24 30 } 25 31 26 public function getCollaborators($filters = array() ) {32 public function getCollaborators($filters = array(), $roles) { 27 33 $this->load->helper('pagging'); 28 34 $this->load->model('collabolator_model'); … … 76 82 $data['num_links'] = 2; 77 83 $data['paging'] = pagging($data); 78 84 $data['roles'] = $roles; 85 79 86 if ($this->input->is_ajax_request()) { 80 87 return $this->load->view('collaborator/listview', $data); … … 88 95 $input = $this->input->post(); 89 96 $this->load->model('collabolator_model'); 90 if (strlen($input['full_name'])==0) 91 { 92 $result['errors'][]=array("content"=>"Tên cá»ng tác viên khÃŽng ÄÆ°á»£c Äá» trá»ng","field"=>"full_name"); 93 } 94 if (strlen($input['login_name'])==0) 95 { 96 $result['errors'][]=array("content"=>"Tên ÄÄng nháºp khÃŽng ÄÆ°á»£c Äá» trá»ng","field"=>"login_name"); 97 98 if (strlen($input['cellphone'])==0) 99 { 100 $result['errors'][] = array("content"=>lang('_SBG_PHONE_REQUIRED_MSG'),"field"=>"cellphone"); 97 101 } 98 102 else 99 103 { 100 if ($this->collabolator_model->isExist(array('field'=>'login_name','value'=>$input['login_name']))) 101 { 102 $result['errors'][]=array("content"=>"Tên ÄÄng nháºp Äã ÄÆ°á»£c sá» dụng","field"=>"login_name"); 103 } 104 } 105 if (strlen($input['cellphone'])==0) 106 { 107 $result['errors'][]=array("content"=>"Sá» Äiá»n thoại khÃŽng ÄÆ°á»£c Äá» trá»ng","field"=>"cellphone"); 108 } 109 else 110 { 104 if (!preg_match('/^([0-9]{10,11}$)$/', $input['cellphone'])) { 105 $result['errors'][] = array("content"=>lang('_SBG_PHONE_FORMAT_ERROR_MSG'), "field"=>"cellphone"); 106 } 107 111 108 if ($this->collabolator_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone']))) 112 109 { 113 $result['errors'][]=array("content"=>"Sá» Äiá»n thoại Äã ÄÆ°á»£c sá» dụng","field"=>"cellphone"); 114 } 115 } 116 if (strlen($input['passwd'])==0) 117 { 118 $result['errors'][]=array("content"=>"Máºt khẩu khÃŽng ÄÆ°á»£c Äá» trá»ng","field"=>"passwd"); 119 } 120 else 121 { 122 if ($input['passwd'] != $input['passwd2']) 123 { 124 $result['errors'][]=array("content"=>"Máºt khẩu phải trùng nhau","field"=>"passwd"); 125 } 126 } 110 $result['errors'][] = array("content"=>lang("_SBG_PHONE_DUPLICATE_MSG"),"field"=>"cellphone"); 111 } 112 } 113 127 114 if (!isset($result['errors'])) 128 115 { 129 unset($input['passwd2']); 130 $input['passwd']=md5($input['activated']); 131 $input['activated']=1; 132 $input['created_time']=date("Y-m-d H:i:s"); 133 $input['updated_time']=date("Y-m-d H:i:s"); 116 117 $passwd = $this->collabolator_model->createRandomPassword(); 118 $input['passwd'] = md5($input['activated']); 119 $input['login_name'] = $input['cellphone']; 120 $input['author'] = 1; 121 $input['activated'] = 1; 122 $input['created_time'] = date("Y-m-d H:i:s"); 123 $input['updated_time'] = date("Y-m-d H:i:s"); 134 124 $this->load->model('collabolator_model'); 125 135 126 $this->collabolator_model->insert($input); 136 127 $result['success'] = 1; -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportAsistant.php
r838 r906 24 24 } 25 25 } 26 26 27 27 public function viewAsistant() { 28 28 $data = array(); … … 159 159 $data['keyword'] = ""; 160 160 $data['sorting_order'] = "sorting_desc"; 161 $data['sorting_field'] = " id";161 $data['sorting_field'] = "user_created_time"; 162 162 163 163 if ($this->input->post('sorting_order')) { … … 181 181 $data['daterange_start'] = ""; 182 182 $data['daterange_end'] = ""; 183 183 184 if ($this->input->post('daterange')){ 184 185 $daterange = explode(" - ", $this->input->post('daterange')); … … 190 191 191 192 $data['start'] = ($data['current_page'] - 1) * $data['perpage']; 193 //write_file('./log/sql.log', date('d-m-Y H:i:s').": Start query \n", FOPEN_WRITE_CREATE); 192 194 $data['total'] = $this->collabolator_model->countCountCollaboratorUsers($data); 195 write_file('./log/sql.log', date('d-m-Y H:i:s').": Start query \n", FOPEN_WRITE_CREATE); 193 196 $data['paidlogs'] = $this->collabolator_model->getCountCollaboratorUsers($data); 197 194 198 foreach ($data['paidlogs'] as $index=>$paidlog) 195 199 { 196 200 $data['paidlogs'][$index]['username']=$this->get_fullname($paidlog['us_id']); 197 201 } 202 write_file('./log/sql.log', date('d-m-Y H:i:s').": Finished query \n", FOPEN_WRITE_CREATE); 198 203 $data['paging_url'] = base_url() . "/admin/thong_ke_cong_tac_vien/trang_ctv/" . $data['id']; 199 204 $data['num_links'] = 2; … … 203 208 return $this->load->view('reportAsistant/listview_user', $data); 204 209 } 210 205 211 return $this->load->view('reportAsistant/listview_user', $data, true); 206 212 } -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/reportprovince.php
r883 r906 132 132 $this->load->model('reportmodel'); 133 133 $data['date'] = 1; 134 $data['month'] = $this->uri->segment( 4);135 $data['year'] = $this->uri->segment( 5);136 $data['to_date'] = date("d");134 $data['month'] = $this->uri->segment(5); 135 $data['year'] = $this->uri->segment(6); 136 $data['to_date'] = $this->uri->segment(4); 137 137 $data['to_month'] = date("m"); 138 138 $data['to_year'] = date("Y"); 139 /* 139 140 if ($this->input->post()) { 140 141 //$data['date'] = $this->input->post('date'); … … 144 145 $data['to_month'] = $this->input->post('to_month'); 145 146 $data['to_year'] = $this->input->post('to_year'); 146 } 147 }*/ 147 148 148 149 $result = $this->reportmodel->getProvinces($data); -
pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
r883 r906 81 81 $daterange [0] = str_replace ( '/', '-', $daterange [0] ); 82 82 $daterange [1] = str_replace ( '/', '-', $daterange [1] ); 83 $data['date_start'] = $daterange [0]; 84 $data['date_end'] = $daterange [1]; 83 85 $data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) ); 84 86 $data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) ); … … 208 210 ); 209 211 $data ['status'] = $this->uri->segment (7, 0); 210 /* 211 if ($this->input->post ( 'status' )) { 212 $data ['status'] = ( int ) $this->input->post ( 'status' ); 213 } 214 */ 212 215 213 $data['provinces'] = $provinces; 216 214 $data['province'] = $this->uri->segment (8); 215 217 216 if ($data['province'] == 'default') $data['province'] = null; 218 if ($this->input->post ( 'province' )) {219 $data ['province'] = $this->input->post ( 'province' );220 }221 217 if ($data['province']) 222 218 $data['districts'] = $this->user_model->getDistrictByProvince($data ['province']); 223 if ($this->input->post ( 'district' )) { 224 $data['district'] = $this->input->post ( 'district' ); 225 } 226 219 227 220 $data['district'] = $this->uri->segment (9); 228 221 if ($data['district'] == 'default') $data['district'] = null; 229 222 $data ['keyword'] = $this->uri->segment (6); 230 223 if ($data['keyword'] == 'default') $data['keyword'] = null; 224 231 225 $data ['sorting_order'] = "sorting_desc"; 232 226 $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 } 227 $data ['sorting_order'] = $this->uri->segment (12); 228 $data ['sorting_field'] = $this->uri->segment (13); 229 230 $data ['daterange_start'] = $this->uri->segment (10); 231 $data ['daterange_end'] = $this->uri->segment (11); 232 if ($data['daterange_start'] == 'default') $data['daterange_start'] = null; 233 if ($data['daterange_end'] == 'default') $data['daterange_end'] = null; 234 if ($data['daterange_start']) 235 $data['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $data ['daterange_start'] ) ); 236 if ($data['daterange_end']) 237 $data['daterange_end'] = date ( 'Y-m-d H:i:s', strtotime ( $data['daterange_end'] . ' + 1 day' ) ); 238 269 239 $data ['start'] = ($data ['current_page'] - 1) * $data ['perpage']; 240 //echo json_encode($data); 270 241 $data ['total'] = $this->user_model->get_total_users ( $data ); 271 242 $us = $this->user_model->get_list_users ( $data ); 272 243 $users = array (); 244 273 245 274 246 foreach ( $us as $u ) { … … 295 267 array_push ( $users, $u ); 296 268 } 297 269 298 270 $data ['users'] = $users; 299 271 $data ['paging_url'] = base_url () . "admin/nguoi_dung/trang/"; -
pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
r838 r906 49 49 function getAllCollaboratorUser($from,$id=false) 50 50 { 51 $from = date("Y-m-d 00:00:00",$from); 51 $from = date("Y-m-d 00:00:00",$from); 52 $order = ""; 53 if ($data['sorting_order'] != "sorting") { 54 55 $sort = "DESC"; 56 if ($data['sorting_order'] == "sorting_asc") 57 $sort = "ASC"; 58 $order = "ORDER BY " . $data['sorting_field'] . " " . $sort; 59 60 } 52 61 $where=""; 53 62 if ($id) 54 63 { 55 $where = " AND tbluser.collaborator = $id "; 64 //$where = " AND tbluser.collaborator = $id "; 65 $where = " AND tblcollaborator.id = $id "; 56 66 } 57 67 //$sql="SELECT *,tblcollaborator.created_time as collaborator_created_time, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id WHERE tbluser.created_time > '".$from."'".$where.""; 58 68 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone WHERE tbluser.created_time > '".$from."'".$where.""; 59 69 60 70 $result = $this->db->query($sql)->result_array(); 61 71 foreach ($result as $index=>$paidlog) … … 120 130 121 131 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time, COUNT(tbluser.collaborator) as total_user FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." GROUP BY tblcollaborator.id ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 122 132 123 133 $result = $this->db->query($sql)->result_array(); 124 134 foreach ($result as $index=>$paidlog) … … 153 163 }else{ 154 164 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order.""; 155 } 165 } 166 //write_file('./log/sql.log', date('d-m-Y H:i:s').": ".$sql."\n", FOPEN_WRITE_CREATE); 156 167 $result = $this->db->query($sql)->result_array(); 168 157 169 foreach ($result as $index=>$paidlog) 158 170 { 159 171 $result[$index]['time']= strtotime($paidlog['user_created_time']); 160 172 } 161 173 162 174 return count($result); 163 175 } 164 function getCountCollaboratorUsers($data) 176 177 function getCountCollaboratorUsers($data) 165 178 { 166 179 $order = ""; 167 if ($data['sorting_order'] != "sorting") { 168 180 if ($data['sorting_order'] != "sorting") { 169 181 $sort = "DESC"; 170 182 if ($data['sorting_order'] == "sorting_asc") … … 174 186 } 175 187 $where=""; 188 176 189 if ($data['keyword']) { 177 190 if ($data['search_field'] == "cellphone") { … … 179 192 } 180 193 } 194 181 195 // $from = date("Y-m-d 00:00:00",$from); 182 196 // $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.id ".$where." AND tbluser.collaborator = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 183 if(strlen($data['daterange_start'])>0){ 184 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 197 198 if($data['daterange_start']){ 199 200 if ($data['perpage']){ 201 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 202 }else{ 203 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND (tbluser.created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."') AND tblcollaborator.id = ".$data['id']." ".$order; 204 } 185 205 }else{ 186 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 206 if ($data['perpage']){ 207 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order." LIMIT " . $data['start'] . ", " . $data['perpage'] . " "; 208 }else{ 209 $sql="SELECT *,tblcollaborator.created_time as collaborator_created_time,tbluser.cellphone as user_cellphone,tblcollaborator.cellphone as collaborator_cellphone, tbluser.created_time as user_created_time FROM ".$this->table_name." INNER JOIN tbluser ON tbluser.collaborator = tblcollaborator.cellphone ".$where." AND tblcollaborator.id = ".$data['id']." ".$order; 210 } 187 211 } 188 212 $result = $this->db->query($sql)->result_array(); … … 454 478 } 455 479 480 public function createRandomPassword() 481 { 482 $alphabet = "0123456789"; 483 $pass = array (); 484 $alphaLength = strlen ( $alphabet ) - 1; 485 for($i = 0; $i < 6; $i ++) { 486 $n = rand ( 0, $alphaLength ); 487 $pass [] = $alphabet [$n]; 488 } 489 return implode ( $pass ); 490 } 456 491 } -
pro-violet-viettel/sourcecode/application/modules/admin/models/user_model.php
r883 r906 23 23 function get_list_users($data) 24 24 { 25 25 26 $sql="SELECT * FROM ".$this->table_name; 26 27 if ($data['status'] == 1){ … … 36 37 $sql.=" WHERE expire_date < NOW() AND p_id <> 5"; 37 38 } 38 if (isset($data['keyword']))39 {39 //if (isset($data['keyword'])) 40 //{ 40 41 if (strlen($data['keyword'])>0){ 41 42 if ($data['status']==0){ … … 43 44 if (strlen($data['district'])>0){ 44 45 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']."')"; 46 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone 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']."')"; 47 }else{ 48 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 49 } 50 }else{ 51 if(strlen($data['daterange_start'])>0){ 52 $sql.=" WHERE province = '".$data['province']."' AND (cellphone 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']."')"; 53 }else{ 54 $sql.=" WHERE province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 50 55 } 51 56 } 52 57 }else{ 53 58 if(strlen($data['daterange_start'])>0){ 54 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' ORacc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";59 $sql.=" WHERE (cellphone 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']."')"; 55 60 }else 56 61 { 57 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' ORacc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";62 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 58 63 } 59 64 } … … 63 68 if (strlen($data['district'])>0){ 64 69 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']."%' ORacc_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']."%' ORacc_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']."%' ORacc_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']."%' ORacc_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']."%') ";70 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone 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']."')"; 71 }else{ 72 $sql.=" AND province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone 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']."%') "; 73 } 74 }else{ 75 if(strlen($data['daterange_start'])>0){ 76 $sql.=" AND province = '".$data['province']."' AND (cellphone 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']."')"; 77 }else{ 78 $sql.=" AND province = '".$data['province']."' AND (cellphone 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 79 } 75 80 } … … 80 85 { 81 86 if(strlen($data['daterange_start'])>0){ 87 82 88 if ($data['status']==0){ 83 89 if (strlen($data['province'])>0){ … … 105 111 else{ 106 112 if ($data['status']==0){ 113 107 114 if (strlen($data['province'])>0){ 108 115 if (strlen($data['district'])>0){ … … 111 118 $sql.=" WHERE province = '".$data['province']."'"; 112 119 } 113 } 114 }else{ 120 121 } 122 }else{ 123 write_file('./log/test.log', date("d-m-Y: H:i:s"). ": ".$sql."\n" , FOPEN_WRITE_CREATE); 115 124 if (strlen($data['province'])>0){ 116 125 if (strlen($data['district'])>0){ … … 125 134 } 126 135 } 127 }136 //} 128 137 129 138 $order = ""; … … 158 167 } 159 168 160 if (isset($data['keyword']))161 {169 //if (isset($data['keyword'])) 170 //{ 162 171 if (strlen($data['keyword'])>0){ 163 172 if ($data['status']==0){ … … 165 174 if (strlen($data['district'])>0){ 166 175 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 } 176 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone 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']."')"; 177 }else{ 178 $sql.=" WHERE province = '".$data['province']."' AND district = '".$data['district']."' AND (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 179 } 180 181 }else{ 182 if(strlen($data['daterange_start'])>0){ 183 $sql.=" WHERE province = '".$data['province']."' AND (cellphone 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']."')"; 184 }else{ 185 $sql.=" WHERE province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 186 } 187 173 188 } 174 189 175 190 }else{ 176 191 if(strlen($data['daterange_start'])>0){ 177 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' ORacc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%') AND (created_time BETWEEN '".$data['daterange_start']."' AND '".$data['daterange_end']."')";192 $sql.=" WHERE (cellphone 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']."')"; 178 193 }else 179 194 { 180 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' ORacc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')";195 $sql.=" WHERE (cellphone LIKE '%".$data['keyword']."%' OR acc_balanced LIKE '%".$data['keyword']."%' OR province LIKE '%".$data['keyword']."%')"; 181 196 } 182 197 } … … 192 207 }else{ 193 208 if(strlen($data['daterange_start'])>0){ 194 $sql.=" AND province = '".$data['province']."' AND (cellphone LIKE '%".$data['keyword']."%' OR collaborator LIKE '%".$data['keyword']."%' ORacc_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']."%' ORacc_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']."%') ";209 $sql.=" AND province = '".$data['province']."' AND (cellphone 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']."')"; 210 }else{ 211 $sql.=" AND province = '".$data['province']."' AND (cellphone 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 212 } 198 213 } … … 244 259 } 245 260 } 246 }247 261 //} 262 //write_file('./log/sql.log', date("d-m-Y: H:i:s"). ": ".$sql."\n" , FOPEN_WRITE_CREATE); 248 263 $query = $this->db->query($sql); 249 264 $row = $query->row_array(); -
pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/index.php
r690 r906 134 134 <div class="modal-body"> 135 135 <form id="add_user" onsubmit="return false;" class="form-horizontal" role="form"> 136 <div class="form-group">137 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Tên Äầy Äá»§ </label>138 139 <div class="col-sm-9">140 <label class="block clearfix has-error"> 141 <span class="input-icon">142 <input name="full_name" type="text" id="form-field-1" placeholder="Tên cá»ng tác viên">143 <i class="icon-user blue"></i>144 </span> 145 <div id="full_name" class="help-block error"></div>146 147 148 <div class="help-block"></div>136 <div class="row"> 137 <div class="col-sm-9"> 138 <div class="form-group"> 139 <label for="cellphone" class="col-sm-4 control-label no-padding-right">Sá» Äiá»n thoại</label> 140 141 <div class="col-sm-8"> 142 <input type="text" name="cellphone" placeholder="Sá» Äiá»n thoại" id="cellphone" class="col-xs-12 col-sm-10"> 143 </div> 144 <label class="block clearfix has-error"> 145 <small><div class="col-sm-8 help-block error" id="cellphone"> </div></small> 146 </label> 147 </div> 148 </div> 149 149 </div> 150 <div class="form-group"> 151 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Tên ÄÄng nháºp </label> 152 153 <div class="col-sm-9"> 154 <label class="block clearfix has-error"> 155 <span class="input-icon"> 156 <input name="login_name" type="text" id="form-field-1" placeholder="Tà i khoản"> 157 <i class="icon-user blue"></i> 158 </span> 159 <div id="login_name" class="help-block error"></div> 160 </label> 161 </div> 162 <div class="help-block"> </div> 163 </div> 164 <div class="form-group"> 165 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> Sá» Äiá»n thoại</label> 166 167 <div class="col-sm-9"> 168 <label class="block clearfix has-error"> 169 <span class="input-icon"> 170 <input name="cellphone" type="text" id="form-field-1" placeholder="Sá» Äiá»n thoại"> 171 <i class="icon-user blue"></i> 172 </span> 173 <div id="cellphone" class="help-block error"></div> 174 </label> 175 </div> 176 <div class="help-block"> </div> 177 </div> 178 <div class="space-4"></div> 179 180 <div class="form-group"> 181 <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> Máºt khẩu </label> 182 183 <div class="col-sm-9"> 184 <label class="block clearfix has-error"> 185 <span class="input-icon"> 186 <input type="password" name="passwd" id="form-field-2" placeholder="Máºt khẩu"> 187 <i class="icon-lock blue"></i> 188 </span> 189 <div id="passwd" class="help-block error"></div> 190 </label> 191 </div> 192 <div class="help-block"> </div> 193 </div> 194 <div class="form-group"> 195 <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> Máºt khẩu </label> 196 197 <div class="col-sm-9"> 198 <span class="input-icon"> 199 <input type="password" name="passwd2" id="form-field-2" placeholder="Nháºp lại máºt khẩu"> 200 <i class="icon-lock blue"></i> 201 </span> 202 </div> 203 <div class="help-block"> </div> 204 </div> 205 <div class="form-group"> 206 <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> KÃch hoạt</label> 207 208 <div class="col-sm-9"> 209 <span class="input-icon"> 210 <input type='checkbox' name="activated" checked="checked" value="1" /> 211 </span> 212 </div> 213 <div class="help-block"> </div> 214 </div> 215 216 <div class="space-4"></div> 217 <div class="form-group errors" id="add_user"></div> 218 219 </div> 150 220 151 <div class="clearfix form-actions"> 221 152 <div class="col-md-offset-3 col-md-9"> -
pro-violet-viettel/sourcecode/application/modules/admin/views/collaborator/listview.php
r838 r906 1 1 <?php 2 $admin_info = $this->session->userdata('adminInfo');3 $role_id = $admin_info['role_id'];2 //$admin_info = $this->session->userdata('adminInfo'); 3 //$role_id = $admin_info['role_id']; 4 4 ?> 5 5 <div id="breadcrumbs" class="breadcrumbs"> … … 45 45 <div style="padding-bottom:4px" class="table-header"> 46 46 Thá»ng kê tà i khoản 47 <?php if ($role_id == 1): ?> 48 <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right"> 49 <i class="icon-plus"></i> 50 Thêm cá»ng tác viên 51 </button> 52 <?php endif; ?> 53 47 <?php if (in_array("editUserInfo", $roles)) { ?> 48 <div class="col-xs-12 pull-right" style="margin:5px;"> 49 <div class="form-group"> 50 <!--<input class="btn btn-primary pull-right " type="button" value="Thêm cá»ng tác viên" onclick="admin_update_user();"/>--> 51 <button href="#addUser" data-toggle="modal" class="btn btn-success pull-right"> 52 <i class="icon-plus"></i> 53 Thêm cá»ng tác viên 54 </button> 55 </div> 56 </div> 57 <?php } ?> 54 58 </div> 55 59 -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportAsistant/listview_user.php
r743 r906 44 44 <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> 45 45 <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> 46 <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>46 <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> 47 47 <!--<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>--> 48 48 -
pro-violet-viettel/sourcecode/application/modules/admin/views/reportprovince/province.php
r883 r906 10 10 <div class="pull-right" style="margin:5px;"> 11 11 <!--<a style="color:#fff" href="<?php echo base_url();?>admin/reportprovince/export/<?php echo $month;?>/<?php echo $year;?>">Xuất ra Excel</a>--> 12 <a style="color:#fff" href="<?php echo base_url();?>admin/reportprovince/exportProvince/<?php echo $ month;?>/<?php echo $year;?>">Xuất ra Excel</a>12 <a style="color:#fff" href="<?php echo base_url();?>admin/reportprovince/exportProvince/<?php echo $to_date; ?>/<?php echo $month;?>/<?php echo $year;?>">Xuất ra Excel</a> 13 13 </div> 14 14 </div> -
pro-violet-viettel/sourcecode/application/modules/admin/views/user/listview.php
r883 r906 47 47 <div class="pull-right" style="margin:5px;"> 48 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)?$p ovince:'default'; ?>/<?php echo ($district)?$district:'default';?>/<?php echo ($daterange)?$daterange:'default'; ?>/<?php echo $sorting_order; ?>/<?php echo $sorting_field;?>">Xuất ra Excel</a>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)?$province:'default'; ?>/<?php echo ($district)?$district:'default';?>/<?php echo ($date_start)?$date_start:'default'; ?>/<?php echo ($date_end)?$date_end:'default'; ?>/<?php echo $sorting_order; ?>/<?php echo $sorting_field;?>">Xuất ra Excel</a> 50 50 51 51 </div> … … 83 83 <div class="dataTables_province" style="float: right;" id="sample-table-2_status"><label>Lá»c theo Tá»nh/TP: 84 84 <select onchange="filter();" name="province" class="form-field-province" size="1" style="width: 176px; height: 28px;"> 85 <option value=''> </option>85 <option value=''>Tất cả</option> 86 86 87 87 <?php foreach ($provinces as $key => $pro): ?> … … 94 94 <select onchange="filter();" name="district" id="form-field-district" class="form-field-district" size="1" style="width: 176px; height: 28px;"> 95 95 <?php if ($districts):?> 96 <option value=''> </option>96 <option value=''>Tất cả</option> 97 97 <?php foreach ($districts as $key => $dist): ?> 98 98 <option <?php if ($dist['district_id'] == $district) echo "selected"; ?> value="<?php echo $dist['district_id']; ?>"><?php echo $dist['district_name']; ?></option> -
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 } ?> -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php
r884 r906 136 136 137 137 public function test(){ 138 $aryMatch = array(); 139 $phoneNumber = '987133325'; 140 $regex = '/^[1,9][0-9]{8,9}$/'; 141 if (preg_match('/^[1,9]([0-9]{8,9})$/', $phoneNumber, $aryMatch)){ 142 $phoneNumber = "0".$phoneNumber; 143 echo $phoneNumber; 144 }else{ 145 echo "Not match"; 146 } 138 $this->load->model('collaborator/collaborator_model'); 139 $province = ' Hà nội'; 140 //$str = trim(ucwords($str)); 141 $district = 'Quận Hai bà trưng'; 142 $str = $this->collaborator_model->getProvinceAndDistict($province, $district); 143 var_dump($str); 144 //echo "Result: ".$str; 147 145 } 148 146 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php
r884 r906 53 53 } 54 54 55 if ( $u['province'] == ''&& $u['p_id'] != ''){55 if ((!$u['province'] || !$u['district']) && $u['p_id'] != ''){ 56 56 $update_user_info=1; 57 57 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r884 r906 286 286 if (strlen($input['province']) == 0) { 287 287 $result['errors'][] = array("content"=>lang('_SBG_PROVINCE_REQUIRED_MSG'),"field"=>"province"); 288 } 289 if (strlen($input['district']) == 0) { 290 $result['errors'][] = array("content"=>lang('_SBG_DISTRICT_REQUIRED_MSG'),"field"=>"district"); 288 291 } 289 292 $input['password'] = ''; -
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r883 r906 100 100 $this->db->insert ( 'tbluser', $user ); 101 101 //write_file('./log/test.log', date("H:i:s m-d-Y").": ". var_export($user, TRUE)."\n" , FOPEN_WRITE_CREATE); 102 $aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/'); 102 //$aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/'); 103 $aryPatterns = array ('/:username:/', '/:password:/'); 103 104 $trialdays = $this->config->item('trial_period'); 104 105 $trialdays = strlen($trialdays) < 2 ? '0'. $trialdays : $trialdays; 105 106 if ($this->isViettel($username)){ 106 $sms = preg_replace($aryPatterns, array($ trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_VIETTEL_REGISTER_SUCCESS_MSG'));107 $sms = preg_replace($aryPatterns, array($username, $password), lang('_SBG_MO_USER_VIETTEL_REGISTER_SUCCESS_MSG')); 107 108 }else{ 108 $aryPatterns = array ('/:username:/', '/:password:/');109 //$aryPatterns = array ('/:username:/', '/:password:/'); 109 110 $sms = preg_replace($aryPatterns, array($username, $password), lang('_SBG_MO_USER_NOT_VIETTEL_REGISTER_SUCCESS_MSG')); 110 111 } -
pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php
r838 r906 93 93 </div> 94 94 <div class="form-group"> 95 <label for="form-field- username" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label>95 <label for="form-field-district" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label> 96 96 <div class="col-sm-8"> 97 97 <select name="district" id="form-field-district" class="input-large"></select> 98 <label class="block clearfix has-error"> 99 <div id="district" class="help-block error"></div> 100 </label> 98 101 </div> 102 99 103 </div> 100 104 -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php
r883 r906 26 26 <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Tá»nh / Thà nh phá»</label> 27 27 <div class="col-sm-8"> 28 <select name="province" id="form-field-province" class="form-field-province col-xs-12 col-sm-10"> 28 <select name="province" id="form-field-province" class="form-field-province-user col-xs-12 col-sm-10"> 29 <option></option> 29 30 <?php foreach ($provinces as $key => $pro): ?> 30 31 <option value="<?php echo $key; ?>" <?php if ($user['province'] == $key) echo "selected"; ?>><?php echo $pro; ?></option> … … 38 39 <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label> 39 40 <div class="col-sm-8"> 40 <select name="district" id="form-field-district" class="form-field-district col-xs-12 col-sm-10">41 <select name="district" id="form-field-district" class="form-field-district-user col-xs-12 col-sm-10"> 41 42 42 43 </select> … … 60 61 var district_id = "<?php echo $user['district']; ?>"; 61 62 var province_id = "<?php echo $user['province']; ?>"; 63 62 64 $(document).ready(function(){ 63 $(".form-field-province ").change(function(){65 $(".form-field-province-user").change(function(){ 64 66 changeEventProvince(province_id); 65 67 }); 66 if ($(".form-field-province ").val() !== 'undefined'){68 if ($(".form-field-province-user").val() !== 'undefined'){ 67 69 checkSelectedDistrict(province_id); 68 70 } 69 71 }); 72 73 function changeEventProvince(provinceId){ 74 $(".form-field-district-user").html(""); 75 $.ajax({ 76 url: '/frontend/user/getDistrict/' + provinceId, 77 type: 'POST', 78 success: function (data, textStatus, jqXHR) 79 { 80 result = jQuery.parseJSON(data); 81 content = "<option></option>"; 82 if (result != null){ 83 for (var i in result){ 84 content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " " + result[i].district_name + '</option>' 85 } 86 } 87 $(".form-field-district-user").html(content); 88 } 89 }); 90 } 91 92 function checkSelectedDistrict(provinceId){ 93 $.ajax({ 94 url: '/frontend/user/getDistrict/' + provinceId, 95 type: 'POST', 96 success: function (data, textStatus, jqXHR) 97 { 98 result = jQuery.parseJSON(data); 99 content = "<option></option>"; 100 if (result != null){ 101 for (var i in result){ 102 if (result[i].district_id === district_id){ 103 content = content + '<option value="' + result[i].district_id + '" selected >' + result[i].type + " " + result[i].district_name + '</option>'; 104 }else{ 105 content = content + '<option value="' + result[i].district_id + '">' + result[i].type + " " + result[i].district_name + '</option>'; 106 } 107 } 108 109 } 110 $(".form-field-district-user").html(content); 111 } 112 }); 113 } 70 114 </script> -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
r838 r906 302 302 <div class="alert alert-block alert-success"> 303 303 <p> 304 QuÜ vá» cÅ©ng có thá» sá» dụng sá» Äiá»n thoại <strong><?php echo $username;?></strong> và soạn tin theo cú pháp: <strong>SBG VIP 1</strong> (hay VIP 3 , VIP 6, VIP 12) <strong>gá»i tá»i 8062</strong> (Há» thá»ng sẜ trừ tiá»n trên tà i khoản chÃnh cá»§a sá» Äiá»n thoại <strong><?php echo $username;?></strong>)304 QuÜ vá» cÅ©ng có thá» sá» dụng sá» Äiá»n thoại <strong><?php echo $username;?></strong> và soạn tin theo cú pháp: <strong>SBG VIP 1</strong> (hay VIP 3) <strong>gá»i tá»i 8062</strong> (Há» thá»ng sẜ trừ tiá»n trên tà i khoản chÃnh cá»§a sá» Äiá»n thoại <strong><?php echo $username;?></strong>) 305 305 </p> 306 306 </div> -
pro-violet-viettel/sourcecode/application/modules/services/controllers/sync.php
r838 r906 47 47 'id'=>(int)$item['id'], 48 48 'full_name'=>(string)$item['name'], 49 'passwd' => md5($phoneNumber), 49 'passwd'=>md5($phoneNumber), 50 'login_name'=>$phoneNumber, 50 51 'cellphone'=>$phoneNumber, 51 52 'precinct'=>(string)$item['precinct'], -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r884 r906 1 1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 2 2 3 if ( ! defined('_SBG_MO_REGISTER')) define('_SBG_MO_REGISTER', 'SUBSCR'); 4 if ( ! defined('_SBG_MO_REGISTER_FOR')) define('_SBG_MO_REGISTER_FOR', 'SUBSCR_FOR'); 5 if ( ! defined('_SBG_MO_PHONENUM_CHANGE')) define('_SBG_MO_PHONENUM_CHANGE', 'PHONE_CHANGE'); 6 if ( ! defined('_SBG_MO_PASSWORD_RECOVERY')) define('_SBG_MO_PASSWORD_RECOVERY', 'PWD_RECOVER'); 7 if ( ! defined('_SBG_MO_VIP_REGISTER')) define('_SBG_MO_VIP_REGISTER', 'REG_VIP'); 8 if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT')) define('_SBG_MO_PAY_TO_ACCOUNT', 'PAY'); 9 if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT_FOR')) define('_SBG_MO_PAY_TO_ACCOUNT_FOR', 'PAY_FOR'); 10 if ( ! defined('_SBG_MO_UNSUBSCRIBE_SERVICE')) define('_SBG_MO_UNSUBSCRIBE_SERVICE', 'UNSUBSCR'); 11 if ( ! defined('_SBG_MO_SUPPOR_SERVICE')) define('_SBG_MO_SUPPOR_SERVICE', 'SUPPORT'); 12 if ( ! defined('_SBG_MO_SYNTAX_ERR')) define('_SBG_MO_SYNTAX_ERR', 'SYNTAX_ERR'); 13 14 if ( ! defined('_SBG_CARD_PAY_FAIL')) define('_SBG_CARD_PAY_FAIL', -1); 15 if ( ! defined('_SBG_CARD_PAY_SUCCESS')) define('_SBG_CARD_PAY_SUCCESS', 1); 16 17 if ( ! defined('_SBG_CHARGING_FAIL')) define('_SBG_CHARGING_FAIL', -1); 18 if ( ! defined('_SBG_CHARGING_SUCCESS')) define('_SBG_CHARGING_SUCCESS', 1); 19 if ( ! defined('_SBG_CHARGING_FAIL_NOT_ENOUGH')) define('_SBG_CHARGING_FAIL_NOT_ENOUGH', 401); 20 if ( ! defined('_SBG_CHARGING_FAIL_NOT_VIETTEL')) define('_SBG_CHARGING_FAIL_NOT_VIETTEL', 402); 21 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_EXISTED')) define('_SBG_CHARGING_NUMBER_NOT_EXISTED', 403); 22 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_AVAILABLE')) define('_SBG_CHARGING_NUMBER_NOT_AVAILABLE', 404); 23 if ( ! defined('_SBG_CHARGING_NUMBER_CHANGED_OWNER')) define('_SBG_CHARGING_NUMBER_CHANGED_OWNER', 405); 24 if ( ! defined('_SBG_CHARGING_FAIL_MORETHAN_LIMIT')) define('_SBG_CHARGING_FAIL_MORETHAN_LIMIT', 406); 25 if ( ! defined('_SBG_CHARGING_GENERAL_ERROR')) define('_SBG_CHARGING_GENERAL_ERROR', 440); 26 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_REGISTED')) define('_SBG_CHARGING_NUMBER_NOT_REGISTED', 501); 27 if ( ! defined('_SBG_CHARGING_MAX_VALUE')) define('_SBG_CHARGING_MAX_VALUE', 50000); 28 if ( ! defined('_SBG_CHARGING_MIN_VALUE')) define('_SBG_CHARGING_MIN_VALUE', 5000); 29 30 31 if ( ! defined('_SBG_SEND_MT_FAIL')) define('_SBG_SEND_MT_FAIL', -1); 32 if ( ! defined('_SBG_SEND_MT_SUCCESS')) define('_SBG_SEND_MT_SUCCESS', 1); 33 if ( ! defined('_SBG_MT_SEND_NUMBER')) define('_SBG_MT_SEND_NUMBER', '841662860000'); 34 if ( ! defined('_SBG_MT_CP_CODE')) define('_SBG_MT_CP_CODE', '601'); 35 36 if ( ! defined('_SBG_SERVICE_COMMAND_CODE')) define('_SBG_SERVICE_COMMAND_CODE', 'SBG'); 37 if ( ! defined('_SBG_SERVICE_SERVICEID')) define('_SBG_SERVICE_SERVICEID', '8062'); 38 39 if ( ! defined('_SBG_MO_PROCCESS_ERR')) define('_SBG_MO_PROCCESS_ERR', 0); 40 41 if ( ! defined('_SBG_GET_COLLABORATOR_FAIL')) define('_SBG_GET_COLLABORATOR_FAIL', -1); 3 if ( ! defined('_SBG_MO_REGISTER')) define('_SBG_MO_REGISTER', 'SUBSCR'); 4 if ( ! defined('_SBG_MO_REGISTER_FOR')) define('_SBG_MO_REGISTER_FOR', 'SUBSCR_FOR'); 5 if ( ! defined('_SBG_MO_PHONENUM_CHANGE')) define('_SBG_MO_PHONENUM_CHANGE', 'PHONE_CHANGE'); 6 if ( ! defined('_SBG_MO_PASSWORD_RECOVERY')) define('_SBG_MO_PASSWORD_RECOVERY', 'PWD_RECOVER'); 7 if ( ! defined('_SBG_MO_VIP_REGISTER')) define('_SBG_MO_VIP_REGISTER', 'REG_VIP'); 8 if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT')) define('_SBG_MO_PAY_TO_ACCOUNT', 'PAY'); 9 if ( ! defined('_SBG_MO_PAY_TO_ACCOUNT_FOR')) define('_SBG_MO_PAY_TO_ACCOUNT_FOR', 'PAY_FOR'); 10 if ( ! defined('_SBG_MO_UNSUBSCRIBE_SERVICE')) define('_SBG_MO_UNSUBSCRIBE_SERVICE', 'UNSUBSCR'); 11 if ( ! defined('_SBG_MO_SUPPOR_SERVICE')) define('_SBG_MO_SUPPOR_SERVICE', 'SUPPORT'); 12 if ( ! defined('_SBG_MO_SYNTAX_ERR')) define('_SBG_MO_SYNTAX_ERR', 'SYNTAX_ERR'); 13 if ( ! defined('_SBG_MO_PASSWORD_COLLABORATOR_SERVICE')) define('_SBG_MO_PASSWORD_COLLABORATOR_SERVICE', 'PWD_COLLABORATOR'); 14 15 if ( ! defined('_SBG_CARD_PAY_FAIL')) define('_SBG_CARD_PAY_FAIL', -1); 16 if ( ! defined('_SBG_CARD_PAY_SUCCESS')) define('_SBG_CARD_PAY_SUCCESS', 1); 17 18 if ( ! defined('_SBG_CHARGING_FAIL')) define('_SBG_CHARGING_FAIL', -1); 19 if ( ! defined('_SBG_CHARGING_SUCCESS')) define('_SBG_CHARGING_SUCCESS', 1); 20 if ( ! defined('_SBG_CHARGING_FAIL_NOT_ENOUGH')) define('_SBG_CHARGING_FAIL_NOT_ENOUGH', 401); 21 if ( ! defined('_SBG_CHARGING_FAIL_NOT_VIETTEL')) define('_SBG_CHARGING_FAIL_NOT_VIETTEL', 402); 22 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_EXISTED')) define('_SBG_CHARGING_NUMBER_NOT_EXISTED', 403); 23 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_AVAILABLE')) define('_SBG_CHARGING_NUMBER_NOT_AVAILABLE', 404); 24 if ( ! defined('_SBG_CHARGING_NUMBER_CHANGED_OWNER')) define('_SBG_CHARGING_NUMBER_CHANGED_OWNER', 405); 25 if ( ! defined('_SBG_CHARGING_FAIL_MORETHAN_LIMIT')) define('_SBG_CHARGING_FAIL_MORETHAN_LIMIT', 406); 26 if ( ! defined('_SBG_CHARGING_GENERAL_ERROR')) define('_SBG_CHARGING_GENERAL_ERROR', 440); 27 if ( ! defined('_SBG_CHARGING_NUMBER_NOT_REGISTED')) define('_SBG_CHARGING_NUMBER_NOT_REGISTED', 501); 28 if ( ! defined('_SBG_CHARGING_MAX_VALUE')) define('_SBG_CHARGING_MAX_VALUE', 50000); 29 if ( ! defined('_SBG_CHARGING_MIN_VALUE')) define('_SBG_CHARGING_MIN_VALUE', 5000); 30 31 32 if ( ! defined('_SBG_SEND_MT_FAIL')) define('_SBG_SEND_MT_FAIL', -1); 33 if ( ! defined('_SBG_SEND_MT_SUCCESS')) define('_SBG_SEND_MT_SUCCESS', 1); 34 if ( ! defined('_SBG_MT_SEND_NUMBER')) define('_SBG_MT_SEND_NUMBER', '841662860000'); 35 if ( ! defined('_SBG_MT_CP_CODE')) define('_SBG_MT_CP_CODE', '601'); 36 37 if ( ! defined('_SBG_SERVICE_COMMAND_CODE')) define('_SBG_SERVICE_COMMAND_CODE', 'SBG'); 38 if ( ! defined('_SBG_SERVICE_SERVICEID')) define('_SBG_SERVICE_SERVICEID', '8062'); 39 40 if ( ! defined('_SBG_MO_PROCCESS_ERR')) define('_SBG_MO_PROCCESS_ERR', 0); 41 42 if ( ! defined('_SBG_GET_COLLABORATOR_FAIL')) define('_SBG_GET_COLLABORATOR_FAIL', -1); 42 43 43 44 Class Services_model extends CI_Model 44 45 { 45 46 private $_arySmsMO = array( 46 _SBG_MO_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(DK)$/'), 47 _SBG_MO_REGISTER_FOR => array('pattern' => '/^(SBG)([[:blank:]])(DK)([[:blank:]])([0-9]{10,11})$/'), 48 //_SBG_MO_PHONENUM_CHANGE => array('pattern' => '/^(SBG)([[:blank:]])(DDT)([[:blank:]])([0-9]{10,11})([[:blank:]])([a-zA-Z0-9]{1,})$/'), 49 _SBG_MO_PASSWORD_RECOVERY => array('pattern' => '/^(SBG)([[:blank:]])(MK)$/'), 50 _SBG_MO_VIP_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(VIP)([[:blank:]])([a-zA-Z0-9]{1,})$/'), 51 _SBG_MO_PAY_TO_ACCOUNT => array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})$/'), 52 _SBG_MO_PAY_TO_ACCOUNT_FOR => array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})([[:blank:]])([0-9]{10,11})$/'), 53 _SBG_MO_SUPPOR_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HD)$/'), 54 _SBG_MO_UNSUBSCRIBE_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HUY)$/') 47 _SBG_MO_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(DK)$/'), 48 _SBG_MO_REGISTER_FOR => array('pattern' => '/^(SBG)([[:blank:]])(DK)([[:blank:]])([0-9]{10,11})$/'), 49 //_SBG_MO_PHONENUM_CHANGE => array('pattern' => '/^(SBG)([[:blank:]])(DDT)([[:blank:]])([0-9]{10,11})([[:blank:]])([a-zA-Z0-9]{1,})$/'), 50 _SBG_MO_PASSWORD_RECOVERY => array('pattern' => '/^(SBG)([[:blank:]])(MK)$/'), 51 _SBG_MO_VIP_REGISTER => array('pattern' => '/^(SBG)([[:blank:]])(VIP)([[:blank:]])([a-zA-Z0-9]{1,})$/'), 52 _SBG_MO_PAY_TO_ACCOUNT => array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})$/'), 53 _SBG_MO_PAY_TO_ACCOUNT_FOR => array('pattern' => '/^(SBG)([[:blank:]])(NAP)([[:blank:]])([0-9]{3,})([[:blank:]])([0-9]{10,11})$/'), 54 _SBG_MO_SUPPOR_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HD)$/'), 55 _SBG_MO_UNSUBSCRIBE_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(HUY)$/'), 56 _SBG_MO_PASSWORD_COLLABORATOR_SERVICE => array('pattern' => '/^(SBG)([[:blank:]])(CTV)$/') 55 57 ); 56 58 … … 113 115 $aryContents = isset($aryMOAnalys['content']) ? $aryMOAnalys['content']: null; 114 116 $this->load->model('frontend/user_model', 'objUserModel'); 117 $this->load->model('collaborator/collaborator_model', 'objCollaboratorModel'); 115 118 $debugMsg .= $case; 116 119 … … 262 265 } 263 266 break; 264 267 268 case _SBG_MO_PASSWORD_COLLABORATOR_SERVICE: 269 $smsReturn = $this->objCollaboratorModel->getPassword($sentNumber); 270 break; 271 265 272 case _SBG_MO_UNSUBSCRIBE_SERVICE: 266 273 case _SBG_MO_SYNTAX_ERR: … … 508 515 509 516 public function deleteCollaborator($id){ 510 $sql = "DELETE FROM tblcollaborator WHERE id = ". $id ;517 $sql = "DELETE FROM tblcollaborator WHERE id = ". $id. " AND author is null"; 511 518 $this->db->query($sql); 512 519 if ($this->db->affected_rows()){
Note: See TracChangeset
for help on using the changeset viewer.