<?php

class OverviewGuru extends CI_Controller {
    public function __construct()
    {
		parent::__construct();
		$this->load->helper('url');
		$this->load->model('Login_model');
		$this->load->model('Guru_model');
        $this->load->model('Siswa_model');

		// //anti bypass
        if ($this->session->userdata('level') == "1") {
            redirect('/admin/overview');
        } elseif ($this->session->userdata('level') == "3") {
            redirect('/siswa/overviewsiswa');
        } elseif (!$this->session->userdata('level')) {
            redirect('/login');
        }
	}

	public function index()
	{

        if($this->session->userdata('isLogin') == FALSE)

		{

			redirect('login/login');

		}else

		{

			$this->load->model('Login_model');

			$user = $this->session->userdata('username');

			$data['level'] = $this->session->userdata('level');

			

			$this->load->view('guru/headerGuru', $data);
			$this->load->view('guru/overviewGuru', $data);
		}
	}
}
{'avg_line_length': 20.829787234042552, 'max_line_length': 61, 'alphanum_fraction': 0.5638406537282942, 'licenses': ['MIT'], 'repository_name': 'nendhe04/E-learning', 'path': 'application/controllers/guru/OverviewGuru.php', 'size': 979, 'lang': 'PHP'}