<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Frontend_Controller extends MY_Controller {

   public function __construct(){
        parent::__construct();
	    $this->load->model('Login_model');
        // Login check
		$exception_uris = array(
			'Login', 
			'Login/varifyUser',
			'Login/logout'
		);
		if (in_array(uri_string(), $exception_uris) == FALSE) {
			if ($this->Login_model->loggedin() == FALSE) {
				redirect('Login');
			}else if($this->Login_model->loggedin() == TRUE && $this->Login_model->get_userType()=='admin'){
			    redirect('Admin');
			}
		}

    }

}
