Changeset 906 for pro-violet-viettel/sourcecode/application/modules/admin
- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/admin
- Files:
-
- 11 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>
Note: See TracChangeset
for help on using the changeset viewer.