- Timestamp:
- Nov 13, 2014 9:10:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r497 r498 108 108 else 109 109 { 110 $sms = " So dien thoai cua Qui vi chua la cong tac vien cuasoanbaigiang.smas.vn!";110 $sms = "Khong tim thay cong tac vien nao co so dien thoai [".$collaborator."] tren soanbaigiang.smas.vn!"; 111 111 $status = 0; 112 112 } … … 118 118 { 119 119 case 0: 120 $col['login_name'] = $username;121 $col['passwd'] = md5($password);122 $col['cellphone'] = $username;123 $col['created_time'] = date('Y-m-d H:i:s');124 $col['activated'] = 1;125 $this->db->insert('tblcollaborator', $col);126 120 $us_id = $id; 127 121 $user['created_time'] = date('Y-m-d H:i:s'); 128 122 $user['us_id'] = $us_id; 129 123 $user['cellphone'] = $username; 130 $user['collaborator'] = $username;131 124 $this->db->insert('tbluser', $user); 132 125 $sms = "Chuc mung Qui vi da dang ky thanh cong tai khoan Soan Bai giang Online. Hay dang nhap vao soanbaigiang.smas.vn voi ten truy nhap ".$username.", mat khau ".$password." de su dung."; … … 203 196 { 204 197 case 0: 205 if ($this->get_collaborator_by_login_name($username)){206 $col['login_name'] = $sentNumber;207 $col['cellphone'] = $sentNumber;208 $col['updated_time'] = date('Y-m-d H:i:s');209 $this->updateCollaborator($col);210 }211 198 $us_id = $id; 212 199 $user['updated_time'] = date('Y-m-d H:i:s'); … … 261 248 { 262 249 case 0: 263 if ($this->get_collaborator_by_login_name($username)){264 $col['passwd'] = $pass;265 $this->updateCollaborator($col);266 }267 250 $us_id = $id; 268 251 $user['updated_time'] = date('Y-m-d H:i:s'); … … 372 355 } 373 356 374 function get_collaborator_by_login_name($collaborator)375 {376 $this->db->select('*')->from('tblcollaborator')->where('login_name', $collaborator)->limit(1);377 $result = $this->db->get()->row_array();378 return $result;379 380 }381 382 357 function isExistcollaborator($collaborator) 383 358 { … … 391 366 $this->db->where('us_id', $us_id); 392 367 $this->db->update('tbluser', $data); 393 }394 395 function updateCollaborator($us_id, $data)396 {397 $this->db->where('id', $us_id);398 $this->db->update('tblcollaborator', $data);399 368 } 400 369
Note: See TracChangeset
for help on using the changeset viewer.