public function change_password($uid = 0) { if ($uid > 0) { $Model_user = new Model_user(); $this->validateChangePassword(); $userkey = $this->superKey(); if (!$this->form_validation->run()) { $this->load->view('header'); $this->load->view('nav'); $this->load->view('sidebar'); $this->load->view('change_password', array('passworddetails' => $Model_user->getuserpass($uid))); $this->load->view('footer'); } else { $id = $this->input->post('id'); $password = $this->input->post('password'); $newkey = $this->encrypt->sha1($userkey . $password); $updateResult = $Model_user->changePassword($id, $newkey); if ($updateResult) { $form_message = '<div class="kode-alert kode-alert kode-alert-icon kode-alert-click alert3"><i class="fa fa-lock"></i>Update Success!<a href="#" class="closed">×</a></div>'; $this->load->view('header'); $this->load->view('nav'); $this->load->view('sidebar'); $this->load->view('change_password', array('passworddetails' => $Model_user->getuserpass($uid), 'form_message' => $form_message)); $this->load->view('footer'); } else { $form_message = '<div class="kode-alert kode-alert kode-alert-icon kode-alert-click alert6"><i class="fa fa-lock"></i>Fail!<a href="#" class="closed">×</a></div>'; $this->load->view('header'); $this->load->view('nav'); $this->load->view('sidebar'); $this->load->view('change_password', array('passworddetails' => $Model_user->getuserpass($uid), 'form_message' => $form_message)); $this->load->view('footer'); } } } else { echo "1234"; } }