<?php if (!defined('BASEPATH'))     exit('No direct script access allowed');
class Home extends OWN_Controller{

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     * 		http://example.com/index.php/welcome
     * 	- or -  
     * 		http://example.com/index.php/welcome/index
     * 	- or -
     * Since this controller is set as the default controller in 
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see http://codeigniter.com/user_guide/general/urls.html
     */
    function __construct() {
        parent::__construct();
        $this->admin_login_check();
        $this->load->model('TaskModel');
        //$this->load->model('notificationsetupmodel/notificationsetupmodel','notificationsetupmodel');
    }

    public function index() {
        //$data['countNotification']=  $this->notificationsetupmodel->countNotification();
        $this->load->view('common/header');
        $this->load->view('common/menu');
        
        // $employeeid=$this->session->userdata('employeeId');
        // if($employeeid =='1234'){
        //   $this->load->view('admin/myTask'); 
        // } else {
        //   $this->load->view('dashbord');  
        // }
        $this->load->view('admin/myTask'); 
        $this->load->view('common/footer');
    }
    function show(){
	    $sessionuser = $this->session->userdata('employeeId');
		$data=$this->TaskModel->employeeList($sessionuser);
		echo json_encode($data);
	}
	function donelist(){
	    $sessionuser = $this->session->userdata('employeeId');
		$data=$this->TaskModel->DoneTaskList($sessionuser);
		echo json_encode($data);
	}
	function done(){
		$data=$this->TaskModel->doneTask();
		echo json_encode($data);
	}
	function save(){
		$data=$this->TaskModel->saveEmp();
		echo json_encode($data);
	}
	function update(){
		$data=$this->TaskModel->updateEmp();
		echo json_encode($data);
	}
	function delete(){
		$data=$this->TaskModel->deleteEmp();
		echo json_encode($data);
	}

}
