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

class Hr extends MY_Controller
{
	function __construct()
	{
		parent::__construct();
		$this->load->model('template/model_template');		
		$this->load->model('admin/model_general');

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

		if($this->logged_user){
			$this->login->checkModuleAccess(4);
			$this->logged_module = $this->session->userdata('module_data');
		}else{
			redirect(base_url());
		}
	}
	
	function index() {
		$this->dashboard();
	}

	function dashboard()
	{
		$this->load->model('admin/model_company');
		$data['branches'] 	 = $this->model_company->getBranches();
		$data['departments'] = $this->model_company->getDepartments();
		$data['company'] 	= $this->model_company->getCompanies(1);
		$this->load->model('hr/model_form');
		$data['forms']      = $this->model_form->getForms();
		
		// $data['categories'] = $this->model_general->fetchAll('hr__form_category', array(), array('is_delete' => 0));

		$this->load->model('hr/model_tnc');
		$data['tncs']       = $this->model_tnc->getTncs();


		$data['page_setup'] = $this->template->pageSetup('HR', 'home', 'Dashboard');
	
		$this->template->view('hr/dashboard/index', $data);
	}

	function setting()
	{
		$data['page_setup'] = $this->template->pageSetup('HR', 'home', 'Setting');
		$this->template->view('hr/setting', $data);
	}
}