You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logout Class
|
|
|
|
*/
|
|
|
|
class Dashboard extends CI_Controller
|
|
|
|
{
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
if(! $this->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');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|