load->model("UserModel"); if($this->UserModel->isNotLogin()) { redirect(site_url('login')); } elseif(!($this->UserModel->isAdmin())) { redirect(site_url('dashboard')); } $get = $this->input->get(); if($get['id_user']==NULL){ redirect(site_url('admin/dashboard')); } } public function index() { $get = $this->input->get(); $pemilik = $this->UserModel->getUsersById($get['id_user']); if($this->input->post()){ if($this->UserModel->resetPassword($pemilik->id_user)){ redirect(site_url('admin/resetpasspemilik?id_user='.$pemilik->id_user.'&msg=success')); } else { $data['msg']="error!"; } } $data['pemilik'] = $pemilik; $data['user_logged'] = $this->session->userdata('user_logged'); $this->load->view('admin/resetpasspemilik',$data); } }