Changeset 366 for pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
- Timestamp:
- Oct 31, 2014 2:55:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
r363 r366 52 52 53 53 public function addCollaborator() { 54 54 $result['success'] = 0; 55 55 $result = array(); 56 56 $input = $this->input->post(); 57 57 $this->load->model('collabolator_model'); 58 $this->collabolator_model->insert($input); 59 $result['success'] = 1; 58 if (strlen($input['full_name'])==0) 59 { 60 $result['errors'][]="Tên cá»ng tác viên khÃŽng ÄÆ°á»£c Äá» trá»ng"; 61 } 62 if (strlen($input['login_name'])==0) 63 { 64 $result['errors'][]="Tên ÄÄng nháºp khÃŽng ÄÆ°á»£c Äá» trá»ng"; 65 } 66 else 67 { 68 if ($this->collabolator_model->isExist(array('field'=>'login_name','value'=>$input['login_name']))) 69 { 70 $result['errors'][]="Tên ÄÄng nháºp Äã ÄÆ°á»£c sá» dụng"; 71 } 72 } 73 if (strlen($input['cellphone'])==0) 74 { 75 $result['errors'][]="Sá» Äiá»n thoại khÃŽng ÄÆ°á»£c Äá» trá»ng"; 76 } 77 else 78 { 79 if ($this->collabolator_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone']))) 80 { 81 $result['errors'][]="Sá» Äiá»n thoại Äã ÄÆ°á»£c sá» dụng"; 82 } 83 } 84 if (strlen($input['passwd'])==0) 85 { 86 $result['errors'][]="Máºt khẩu khÃŽng ÄÆ°á»£c Äá» trá»ng"; 87 } 88 if ($input['passwd'] != $input['passwd2']) 89 { 90 $result['errors'][]="Máºt khẩu khÃŽng trùng nhau"; 91 } 92 if (!isset($result['errors'])) 93 { 94 unset($input['passwd2']); 95 $input['activated']=1; 96 $input['created_time']=date("Y-m-d H:i:s"); 97 $input['updated_time']=date("Y-m-d H:i:s"); 98 $this->load->model('collabolator_model'); 99 $this->collabolator_model->insert($input); 100 $result['success'] = 1; 101 } 102 103 60 104 echo json_encode($result); 61 105 }
Note: See TracChangeset
for help on using the changeset viewer.