session->userdata('validated')){ redirect(base_url('/login')); } } public function index() { if ($this->session->admin == '1' OR $this->session->superadmin == '1') { redirect(base_url('/dashboard/admin')); } else { redirect(base_url('/dashboard/user')); } } public function admin() { $data['page'] = 'home'; // Header $this->load->view('header', $data); // login page //$this->load->view('dashboard_user', $data); // Footer $this->load->view('footer'); } public function user() { $data['page'] = 'home'; // Header $this->load->view('header', $data); // login page $this->load->view('dashboard_user', $data); // Footer $this->load->view('footer'); } }