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.

92 lines
1.9 KiB

<?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()
{
9 years ago
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';
9 years ago
// Header
$this->load->view('header', $data);
// login page
//$this->load->view('dashboard_user', $data);
// Footer
$this->load->view('footer');
9 years ago
}
public function user()
{
$data['page'] = 'home';
9 years ago
// Header
$this->load->view('header', $data);
9 years ago
// login page
$this->load->view('dashboard_user', $data);
// Footer
$this->load->view('footer');
}
public function changeregio()
{
if (! $this->session->superadmin == '1') {
redirect(base_url('/dashboard'));
}
// Set new regionaam in session
if ($this->security->xss_clean($this->input->post('regioid'))) {
$this->session->set_userdata('regio', $this->security->xss_clean($this->input->post('regioid')));
// Load model
$this->load->model('Regio_model');
$regionaam = $this->Regio_model->get_regio($this->security->xss_clean($this->input->post('regioid')));
$this->session->set_userdata('regionaam', $regionaam);
redirect(base_url('/dashboard'));
}
$data['page'] = 'regio';
// Load model
$this->load->model('Regio_model');
$regios = $this->Regio_model->get_regio_list();
// Arrange data
foreach ($regios as $regio) {
$data['regio'][$regio['id']] = $regio['naam'];
}
// Header
$this->load->view('header', $data);
// login page
$this->load->view('sa_changeregio', $data);
// Footer
$this->load->view('footer');
}
}