<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Slide_sidang extends CI_Controller {
	function index(){
		$this->load->model('jadwalsidang/slide_sidang_m','slide');
		$query = $this->slide->getSystemInfo();
		foreach ($query->result() as $row) {
			if($row->id == 62){
				if(!empty($row->value)){
					$namaPN = $row->value;
					$this->session->set_userdata('namaPN',$row->value);
				}
			}

			if($row->id == 83){
				if(!empty($row->value)){
					$this->session->set_userdata('jenis_pengadilan',$row->value);
				}else{
					$this->session->set_userdata('jenis_pengadilan',1);
				}
			}
		}
		$data['tanggalSidang'] = date('Y-m-d'); 
		$data['namaPN'] = $this->slide->getNamaPN();
		$data['slidePidana'] = $this->slide->getJadwalSidang('1',$data['tanggalSidang']);
		$data['slidePerdata'] = $this->slide->getJadwalSidang('2',$data['tanggalSidang']);
		$data['slidePersiapan'] = $this->slide->getJadwalPersiapan($data['tanggalSidang']);
		$data['jenisPengadilan'] = $this->session->userdata('jenis_pengadilan');
		
		$this->load->vars($data);
		$this->load->view('header_jadwal');
		$this->load->view('slide_sidang/slide_sidang');
	}
}