<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Employee extends CI_Controller 
{
    public function employee_session()
    {
       //check session permission for creating the post
        if(!$this->session->userdata('emp_logged_in'))		//check login
        {
            $this->session->set_flashdata('emp_timeout','You are no longer logged in.Login Again.');
            redirect('home/login');
        }

    }

    public function index()
    {
       // echo "this is admin dashboard";
       //$username=$this->session->userdata('username');
       $this->employee_session();

       $title="Dashboard";
       $subtitle="Information At a Glance";
       $data['title']=$title.'<br><small>'.$subtitle.'</small>';
       $data['userdata']=$this->session->userdata;
     
       if(isset($this->session->userdata['emp_id']))
        {
            //$this->load->view('users/emp/template/emp_index_header',$data);
            //$this->load->view('users/emp/emp_index',$this->session->userdata);
            //$this->load->view('users/emp/template/emp_index_footer');
            $data['menus']=$this->menu_permission_model->get_menus(FALSE);
            $data['pages']=$this->menu_permission_model->get_pages(FALSE);
            $data['user_types']=$this->menu_permission_model->get_user_types(FALSE);
            $data['menu_permissions']=$this->menu_permission_model->get_menu_permissions(FALSE);

            $this->load->view('templates/header');
			$this->load->view('templates/nav',$data);
			//$this->load->view('menu_permission',$data);
			$this->load->view('templates/footer');

        } 
        else
        {
            redirect('home/login');
        }

    }


}
