<?php
class Iki extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('user_model');
        $this->load->model('live_model');
        $this->load->helper('content');

        if ($this->user_model->is_logged_in() == FALSE)
            redirect(base_url(), 'refresh');
    }

    function _remap($bln, $thn) { $this->index($bln, $thn); }

    function index($bln, $thn) {
        $bln = $this->uri->segment(3);
        $thn = $this->uri->segment(4);
        if (empty($bln) && empty($thn)){ 
            $bln = date('m'); 
            $thn = date('Y'); 
        } else { 
            $bln = $this->uri->segment(3);
            $thn = $this->uri->segment(4);
        }

        $view['content'] = 'chart/iki';
        $view['title'] = 'Hasil Penilaian Indikator Kinerja Individu (IKI)';
        $view['data'] = $this->live_model->get_iki($bln, $thn);
        $this->load->view('admin/index', $view);
    }

}