<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Dashboard
 *
 * @author mzq163
 */
class Dashboard extends CI_Controller {

    //put your code here
    var $responseData = null;

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->model('Dashboard_model', 'd_model');
    }

    /**
     * 
     * 
     * 
     * 
     */
    public function getAdminDashboard() {
        $this->session->set_userdata('tab_index_company', 1);
        $this->responseData['list_single_user'] = $this->d_model->getSingleUserSessionPlayModel();
        $this->responseData['list_group_user'] = $this->d_model->getGroupUserSessionPlayModel();
        $this->session->set_userdata('rendering', 'dashboard');
        //print_r($this->responseData);
        $this->load->view('dashboard', $this->responseData);
    }

    /**
     * 
     * 
     * 
     */
    public function getSingleDashboard() {
        $districtId = $this->input->get('distrcitId');
   
        $this->responseData['list_single_user'] = $this->d_model->getSingleUserSessionPlayModel($districtId);
        $this->responseData['array_single'] = array(3, 2, 3, 2, 4, 2, 3, 3, 3, 1, 1, 1);
        $this->load->view('dashboard_single', $this->responseData);
    }

    /**
     * 
     * 
     * 
     */
    public function getGroupDashboard() {
       $districtId = $this->input->get('distrcitId');
      
        $this->responseData['list_group_user'] = $this->d_model->getGroupUserSessionPlayModel($districtId);
        $this->responseData['count'] = $this->d_model->getGroupUserSessionCountModel();
        $this->responseData['array_group'] = array(3, 2, 3, 2, 4, 2, 3, 3, 3, 1, 1, 1);
        $this->load->view('dashboard_group', $this->responseData);
    }

}
