<?php
class PoliklinikCR extends CI_Controller {

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

    function index(){
        set_time_limit(0);
        ini_set('memory_limit', '1024M');

        $view['error'] = '';
        $view['content'] = 'page\poliklinik';

        $view['data_kunjungan_rajal'] = $this->live_model->get_get_kunjungan_poliklinik()->result();
        //$view['data_kunjungan_rajal_by_company'] = $this->live_model->get_kunjungan_debitur()->result();
        //$view['data_kunjungan_penunjang'] = $this->live_model->get_kunjungan_penujang_medis()->result();

        $view['data_pendapatan_rajal'] = $this->live_model->get_get_pendapatan_poliklinik()->result();

        $view['data_barberjohnson'] = $this->live_model->get_barberjohnson()->result();
        $view['data'] = $this->live_model->view_thamrin()->result();
        $this->load->view('index', $view);
    }



    public function chart_kunjungan_poliklinik() {
        $view['content'] = 'chart/indikator_rs';
        $view['uri'] = 'chart_kunjungan_poliklinik/'.$this->uri->segment('3');
        $view['title'] = 'Kunjungan Rawat Jalan Berdasarkan Poliklinik - '.date('Y');
        $view['data'] = $this->live_model->chart_get_kunjungan_poliklinik()->result();
        $view['tahun'] = date('Y');
        if(isset($_POST['filter'])){
            $tahun = $_POST['tahun'];
            $view['title'] = 'Kunjungan Rawat Jalan Berdasarkan Poliklinik - '.$tahun;
            $view['data'] = $this->live_model->chart_get_kunjungan_poliklinik_by_tahun($tahun)->result();
        }
        $this->load->view('index', $view);
    }

    public function chart_pendapatan_poliklinik() {
        $view['content'] = 'chart/indikator_rs';
        $view['uri'] = 'chart_kunjungan_poliklinik/'.$this->uri->segment('3');
        $view['title'] = 'Pendapatan Rawat Jalan Berdasarkan Poliklinik - '.date('Y');
        $view['data'] = $this->live_model->chart_get_pendapatan_poliklinik()->result();
        $view['tahun'] = date('Y');
        if(isset($_POST['filter'])){
            $tahun = $_POST['tahun'];
            $view['title'] = 'Kunjungan Rawat Jalan Berdasarkan Poliklinik - '.$tahun;
            $view['data'] = $this->live_model->chart_get_pendapatan_poliklinik_by_tahun($tahun)->result();
        }
        $this->load->view('index', $view);
    }

}
?>