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() { } public function user() { $data['title'] = 'JOS'; // Header $this->load->view('header'); // login page $this->load->view('dashboard_user', $data); // Footer $this->load->view('footer'); } }