- Timestamp:
- Nov 5, 2014 9:30:07 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/admin/controllers/smstemplate.php
r405 r409 122 122 echo json_encode($result); 123 123 } 124 public function view User()124 public function viewSms() 125 125 { 126 126 $id=$this->uri->segment(4); 127 127 $this->load->model('Smstemplate_model'); 128 128 $data=$this->Smstemplate_model->getSmstemplate($id); 129 $this->load->view('smstemplate/view User',$data);130 } 131 public function edit User()129 $this->load->view('smstemplate/viewSms',$data); 130 } 131 public function editSms() 132 132 { 133 133 $id=$this->uri->segment(4); 134 134 $this->load->model('Smstemplate_model'); 135 135 $data=$this->Smstemplate_model->getSmstemplate($id); 136 $this->load->view('smstemplate/edit User',$data);137 } 138 public function dodelete User()136 $this->load->view('smstemplate/editSms',$data); 137 } 138 public function dodeleteSms() 139 139 { 140 140 $input=$this->input->post(); 141 $id=$input[' id'];141 $id=$input['sms_id']; 142 142 $this->load->model('Smstemplate_model'); 143 143 $data=$this->Smstemplate_model->delete($id); … … 145 145 echo json_encode($result); 146 146 } 147 public function delete User()147 public function deleteSms() 148 148 { 149 149 $id=$this->uri->segment(4); 150 150 $this->load->model('Smstemplate_model'); 151 151 $data=$this->Smstemplate_model->getSmstemplate($id); 152 $this->load->view('smstemplate/deleteUser',$data); 153 } 154 public function updateUser() 155 { 156 $input['activated']=0; 157 $input= array_merge($input,$this->input->post()); 158 $this->load->model('Smstemplate_model'); 159 if (strlen($input['full_name'])==0) 160 { 161 $result['errors'][]="Tên cá»ng tác viên khÃŽng ÄÆ°á»£c Äá» trá»ng"; 162 } 163 if (strlen($input['login_name'])==0) 164 { 165 $result['errors'][]="Tên ÄÄng nháºp khÃŽng ÄÆ°á»£c Äá» trá»ng"; 166 } 167 else 168 { 152 $this->load->view('smstemplate/deleteSms',$data); 153 } 154 public function updateSms() 155 { 156 157 $input= $this->input->post(); 158 $this->load->model('Smstemplate_model'); 159 if (strlen($input['sms_content'])==0) 160 { 161 $result['errors'][]="Ná»i dung tin nhắn khÃŽng ÄÆ°á»£c Äá» trá»ng"; 162 } 163 if (strlen($input['sms_reply'])==0) 164 { 165 $result['errors'][]="Tin nhắn trả vá» khÃŽng ÄÆ°á»£c Äá» trá»ng"; 166 } 167 else 168 { 169 /* 169 170 if ($this->Smstemplate_model->isExist(array('field'=>'login_name','value'=>$input['login_name'],'id'=>$input['id']))) 170 171 { 171 172 $result['errors'][]="Tên ÄÄng nháºp Äã ÄÆ°á»£c sá» dụng"; 172 173 } 173 } 174 if (strlen($input['cellphone'])==0) 175 { 176 $result['errors'][]="Sá» Äiá»n thoại khÃŽng ÄÆ°á»£c Äá» trá»ng"; 177 } 178 else 179 { 174 * 175 */ 176 } 177 if (strlen($input['service_id'])==0) 178 { 179 $result['errors'][]="Mã dá»ch vụ khÃŽng ÄÆ°á»£c Äá» trá»ng"; 180 } 181 else 182 { 183 /* 180 184 if ($this->Smstemplate_model->isExist(array('field'=>'cellphone','value'=>$input['cellphone'],'id'=>$input['id']))) 181 185 { 182 186 $result['errors'][]="Sá» Äiá»n thoại Äã ÄÆ°á»£c sá» dụng"; 183 187 } 184 } 185 if (strlen($input['passwd'])==0) 186 { 187 //$result['errors'][]="Máºt khẩu khÃŽng ÄÆ°á»£c Äá» trá»ng"; 188 } 189 if ($input['passwd'] != $input['passwd2']) 190 { 191 $result['errors'][]="Máºt khẩu khÃŽng trùng nhau"; 192 } 188 * 189 */ 190 } 191 193 192 if (!isset($result['errors'])) 194 { 195 unset($input['passwd2']); 196 $input['passwd']=md5($input['activated']); 197 $input['updated_time']=date("Y-m-d H:i:s"); 193 { 198 194 $this->load->model('Smstemplate_model'); 199 $this->Smstemplate_model->update($input[' id'],$input);195 $this->Smstemplate_model->update($input['sms_id'],$input); 200 196 $result['success'] = 1; 201 197 }
Note: See TracChangeset
for help on using the changeset viewer.