<?php

class Lp_saturssa extends CI_Controller {
    
//-----------start variables for check action access----------//
    public $vartambah   = null;
    public $varedit     = null;
    public $vardelete   = null;
    public $varview     = null;

    public $parent      = 'SATURSSA';
    public $title       = 'REPORT';
    public $link        = 'Lp_saturssa';
    public $index       = 'index.php/Lp_saturssa';
    public $maincontent = 'saturssa/';
    public $idmenu      = '43';

//-----------start variables for check action access----------//
    
    function __construct(){
		parent::__construct();
		$this->check_isvalidated();
        $this->load->helper(array('form', 'date'));        
	}
    private function check_isvalidated(){
	   if(! $this->session->userdata('validated')){
	       redirect('index.php/ps_login');
        }
//--------------start check access this form page-------------//
        $this->db->where('am_fk_rolegroup_id', $this->session->userdata('s_IDRoleGroup'));
        $this->db->where('am_fk_menu_id', $this->idmenu);
        $this->db->where('am_access', 1);
        $cekMenu = $this->db->get('access_menu');
        $rowcount = $cekMenu->num_rows();
        if($rowcount==0){
            redirect('index.php');
        }else{
            foreach ($cekMenu->result() as $cm)
                {
                    $this->vartambah= $cm->am_create;
                    $this->varedit  = $cm->am_edit;
                    $this->vardelete= $cm->am_delete;
                    $this->varview  = $cm->am_view;
                }
        }
//--------------end check access this form page-------------//
    }

//----------------------------------------------------------------PLEBITIS
public function ketepatantrianoperasi(){
    $data['title']          = "SATURSSA - REPORT KETEPATAN ANTRIAN OPERASI";
    $data['parent']         = $this->parent;
    $data['link']           = $this->link;
    $data['main_content']   = $this->maincontent."/antrianoperasi/ketepatanantrianoperasi/v_ketepatanantrianoperasi";
    if(isset($_POST['tanggal'])) {
        $dateall    = $this->input->post('tanggal');
        $pisah      = explode ("-", $dateall);
        $awal       = date("Y-m-d", strtotime($pisah[0]));
        $akhir      = date("Y-m-d", strtotime($pisah[1]));
    }else{
        $awal       = date("Y-m-d");
        $akhir      = date("Y-m-d");
    }
    $data['awal']       = $awal;
    $data['akhir']      = $akhir;
    
    $this->load->model('m_saturssa_report_lp');
    $datanya = $this->m_saturssa_report_lp->ketepatanantrianoperasi();
    $this->load->vars('datanya', $datanya);

    $this->load->view('includes/template', $data);
}
}

?>