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

class manage_popup_mediator extends CI_Controller {

	function __construct() {
        parent::__construct();
		if($this->session->userdata('is_logged_in')==FALSE){
			redirect('login');
		}
		$this->load->model('mediasi/mediasi_m');
    }

    function index(){
		$this->popup_mediator();
    }

    function popup_mediator($hal=0,$var=NUL,$status_mediator=NULL,$nama=NULL){
		
		if(empty($nama) AND ($nomor_sk)){
			show_404();
		}else{
			$hal				=$this->uri->segment(2);
			$var				=$this->uri->segment(3);
			$status_mediator	=$this->uri->segment(4);
			$nama				=$this->uri->segment(5);
			if($hal>0){
				$begin_limit=($hal-1)*20;
			}else{
				$hal=1;
				$begin_limit=0;
			}

			$data['nilai_var']		=$var;
			$data['page_number']	=$hal;
			$data['page_active']	=$begin_limit;
			$data['status_mediator']=$status_mediator;
			
			if($status_mediator=='H'){
				$judulatas='DAFTAR MEDIATOR';
			}else{
				$judulatas='DAFTAR MEDIATOR LUAR PENGADILAN';
			}
			
			$data['judulatas']		=$judulatas;
			$data['data_mediator']	=$this->mediasi_m->get_mediator1($nama,$begin_limit,$status_mediator);
			
			if($nama==''){
				if($status_mediator=='H'){
					$data['total_data']=$this->mediasi_m->total_mediator()->row(0)->total;
				}else{
					$data['total_data']=$data['data_mediator']->num_rows;
				}
			}else{
				$data['total_data']=$data['data_mediator']->num_rows;
			}
			
			$this->load->vars($data);
			$this->load->view('perkara_tab/popup_mediator');
		}
	}
}
