- Timestamp:
- Nov 14, 2014 4:19:21 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r491 r502 74 74 $data = array('us_id'=>$us_id, 'username'=>$username, 'fullname'=>$fullname, 75 75 'gender'=>$gender, 'email'=>$email, 'phone'=>$phone, 'school'=>$school, 'province'=>$province, 76 'acc_balanced'=>$us['acc_balanced'], 'expire_date'=> $us['expire_date'], 'date_diff'=>$this->dateDiff($us['expire_date'])76 'acc_balanced'=>$us['acc_balanced'], 'expire_date'=>date('d/m/Y', strtotime($us['expire_date'])), 'date_diff'=>$this->dateDiff($us['expire_date']), 'use_package'=>$us['use_package'] 77 77 ); 78 78 return $data; … … 109 109 public function update_user() 110 110 { 111 $this->load->helper('email');112 111 $us_id=$this->uri->segment(4); 113 112 $user_info = $this->session->userdata('userInfo'); … … 122 121 if ($input){ 123 122 $input['username'] = $user['username']; 124 $input['fullname'] = $user['fullname']; 123 if (array_key_exists('fullname', $input)) 124 { 125 if (strlen($input['fullname'])==0) 126 { 127 $result['errors']['fullname_err'] = "Há» tên khÃŽng ÄÆ°á»£c Äá» trá»ng !"; 128 } 129 }else 130 { 131 $input['fullname'] = $user['fullname']; 132 } 133 /* 134 if ($strlen($input['school']) == 0) 135 { 136 $result['errors']['school_err'] = "ÄÆ¡n vá» khÃŽng ÄÆ°á»£c Äá» trá»ng !"; 137 } 138 if ($strlen($input['province']) == 0) 139 { 140 $result['errors']['province_err'] = "Tá»nh/thà nh khÃŽng ÄÆ°á»£c Äá» trá»ng !"; 141 }*/ 125 142 $input['password'] = ''; 126 143 $input['oldpass'] = ''; 127 144 $this->load->model('user_model'); 128 $result['fullname'] = $input['fullname']; 129 if (strlen($input['email'])>0){ 130 if(!valid_email($input['email'])) 131 { 132 $result['errors']['email_err'] = "Email khÃŽng Äúng Äá»nh dạng"; 133 } 134 } 145 //$result['fullname'] = $input['fullname']; 135 146 if (!isset($result['errors'])){ 136 147 $result['data'] = $this->user_model->update_user($src, $token, $input, $us_id); … … 156 167 $src = "SBG"; 157 168 $token = md5($us_id.self::TOKENPW); 169 $input = $this->input->post(); 158 170 if (strlen($input['passwd']) == 0) 159 171 { … … 173 185 if (!isset($result['errors'])) 174 186 { 175 $user = array('username'=>$user name, 'fullname'=>null,);187 $user = array('username'=>$user_info['username'], 'fullname'=>null, 'gender'=>null, 'email'=>null, 'school'=>null, 'province'=>null, 'password'=>$input['passwd_new'], 'oldpass'=>$input['passwd']); 176 188 $data = $this->user_model->update_user($src, $token, $user, $us_id); 177 189 parse_str($data);
Note: See TracChangeset
for help on using the changeset viewer.