- Timestamp:
- Nov 20, 2014 11:09:07 AM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/frontend/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php
r565 r580 29 29 $username = $user_info['username']; 30 30 $first_visit=0; 31 $update_user_info=0; 32 parse_str($user_info['user'], $info); 33 $this->load->model('user_model'); 34 $user = $user_info['user']; 35 $us_id = $user_info['us_id']; 36 $u = $this->user_model->get_user_by_id($us_id); 37 if (($info['fullname']=="")&&($u['p_id']!="")) 38 { 39 $update_user_info=1; 40 } 31 41 if (!$this->session->userdata('first_visit')) 32 42 { … … 34 44 $first_visit=1; 35 45 } 36 $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams ));46 $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams,'update_user_info'=>$update_user_info,'us_id'=>$us_id)); 37 47 } else { 38 48 redirect('/frontend/home/'); -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r574 r580 27 27 $data['packages'] = $this->servicepackage_model->getAllPackages(); 28 28 $data['is_viettel'] = $user_info['is_viettel']; 29 //$paidlogs = $this->user_model->getPaidlog($us_id); 30 31 //$data['paidlogs'] = $paidlogs; 32 parse_str($user, $info); 29 33 30 $data = array_merge($data, $u); 34 31 $data = array_merge($data, $user_info); … … 58 55 $result['can_buy'] = 0; 59 56 } 57 60 58 if ($user['p_id'] < 1) { 59 $result['can_edit'] = 1; 60 } 61 if ($info['fullname']=="") 62 { 61 63 $result['can_edit'] = 1; 62 64 } … … 198 200 } 199 201 } 200 202 public function update_info() { 203 $result['success']=0; 204 $user_info = $this->session->userdata('userInfo'); 205 if ($user_info) { 206 $us_id = $user_info['us_id']; 207 $result = array(); 208 $result['success'] = 0; 209 $src = "SBG"; 210 $token = md5($us_id . self::TOKENPW); 211 $user = $this->get_data($src, $token, $us_id); 212 $input = $this->input->post(); 213 parse_str($user_info['user'], $info); 214 if ($input) { 215 if (strlen($input['fullname']) == 0) { 216 $result['errors'][] = array("content"=>"Há» tên khÃŽng ÄÆ°á»£c Äá» trá»ng!","field"=>"fullname"); 217 } 218 if (strlen($input['school']) == 0) { 219 $result['errors'][] = array("content"=>"Tên ÄÆ¡n vá» khÃŽng ÄÆ°á»£c Äá» trá»ng!","field"=>"school"); 220 } 221 222 $input['password'] = ''; 223 $input['oldpass'] = ''; 224 $input['province'] = ''; 225 $this->load->model('user_model'); 226 if (!isset($result['errors'])) { 227 $result['data'] = $this->user_model->update_user($src, $token, $input, $us_id); 228 $result['success'] = 1; 229 $info['fullname']=$input['fullname']; 230 $info['school']=$input['school']; 231 $info = urldecode(http_build_query($info)); 232 $userdata = array('username' => $user_info['username'], 'user' => $info, 'us_id' => $user_info['us_id'], 'logined_in' => TRUE, 'is_viettel' => $user_info['is_viettel']); 233 $this->session->set_userdata('userInfo', $userdata); 234 } 235 echo json_encode($result); 236 } 237 } else { 238 redirect('frontend/home'); 239 } 240 } 201 241 public function update_user() { 202 242 $us_id = $this->uri->segment(4);
Note: See TracChangeset
for help on using the changeset viewer.