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

class Antrian_dirput extends CI_Controller {
	function index(){
		if($this->session->userdata('is_logged_in')==FALSE){
			redirect('login');
		}
		$this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        $idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }
        $data['data_antrian'] = $this->antrian_dirput->get_antrian($batas,$offset,$data['key']);
        $tot_hal = $this->antrian_dirput->get_total_antrian();
        $data_minutasi = $this->antrian_dirput->get_data_minutasi()->result_array();
        $jumlahDirput = $this->antrian_dirput->getTotalPerkaraDirput($data['key']=NULL);
        $jumlahDirputAmbigu = $this->antrian_dirput->getTotalDirputAmbigu($data['key']);
        $data['jumlahDirputAmbigu'] =  $jumlahDirputAmbigu->num_rows();
        $data['jumlahDirput'] =  $jumlahDirput->num_rows();
        //print_r($data['jumlahDirputAmbigu']);exit();
        $data['putus'] =  $data_minutasi[0]['jumlah_put'];
        $data['minutasi'] =  $data_minutasi[0]['jumlah_minutasi'];
        $data['belumminutasi'] =  $data_minutasi[0]['jumlah_belum_minutasi'];
        $data['jumlah_edoc'] =  $data_minutasi[0]['jumlah_edoc'];
        $data['jum_non_edoc'] =  $data_minutasi[0]['jum_non_edoc'];

        $data_antrian_upaya_hukum = $this->antrian_dirput->get_antrian_upaya_hukum()->result_array();
        $data['uploadTK1'] = $data_antrian_upaya_hukum[0]['putusan_tk1_upload'];
        $data['uploadTK1Succes'] = $data_antrian_upaya_hukum[0]['putusan_tk1_berhasil_upload'];
        $rasioTK1 = ($data['uploadTK1Succes'])/ ($data['uploadTK1']) * 100;
        $data['rasioTK1'] =  number_format($rasioTK1,1,',','.');
        
        $data['uploadBDG'] = $data_antrian_upaya_hukum[0]['putusan_bdg_upload'];
        $data['uploadBDGSucces'] = $data_antrian_upaya_hukum[0]['putusan_bdg_berhasil_upload'];
        $rasioBDG = ($data['uploadBDGSucces'])/ ($data['uploadBDG']) * 100;
        $data['rasioBDG'] =  number_format($rasioBDG,1,',','.');

        $data['uploadKasasi'] = $data_antrian_upaya_hukum[0]['putusan_kasasi_upload'];
        $data['uploadKasasiSucces'] = $data_antrian_upaya_hukum[0]['putusan_kasasi_berhasil_upload'];
        $rasioKasasi = ($data['uploadKasasiSucces'])/ ($data['uploadKasasi']) * 100;
        $data['rasioKasasi'] =  number_format($rasioKasasi,1,',','.');

        $data['uploadPK'] = $data_antrian_upaya_hukum[0]['putusan_pk_upload'];
        $data['uploadPKSucces'] = $data_antrian_upaya_hukum[0]['putusan_pk_berhasil_upload'];
        $rasioPK = ($data['uploadPKSucces'])/ ($data['uploadPK']) * 100;
        $data['rasioPK'] =  number_format($rasioPK,1,',','.');

        $config['base_url'] = base_url() . 'antrian_dirput/cari/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_dirput_v',$data);
        //$this->load->view('antrian/modal_list_perkara');
        $this->load->view('footer');
	}

	public function cari(){
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['keyword']="";
        //$data['keyword']="";
        $keyword = $this->input->post('keyword');
        //echo $keyword;
        if(!empty($keyword))
        {
            $data['keyword'] = $this->input->post('keyword');
            $this->session->set_userdata('keyword', $data['keyword']);
        }
        else
        {
            $data['keyword'] = $this->session->userdata('keyword');
        }

        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $data_minutasi = $this->antrian_dirput->get_data_minutasi()->result_array();
        //print_r($data_minutasi['0']['jumlah_put']);
        $data['putus'] =  $data_minutasi[0]['jumlah_put'];
        $data['minutasi'] =  $data_minutasi[0]['jumlah_minutasi'];
        $data['belumminutasi'] =  $data_minutasi[0]['jumlah_belum_minutasi'];
        $data['jumlah_edoc'] =  $data_minutasi[0]['jumlah_edoc'];
        $data['jum_non_edoc'] =  $data_minutasi[0]['jum_non_edoc'];
        $tot_hal = $this->antrian_dirput->get_total_antrian($data['keyword']);
        $data['data_antrian'] = $this->antrian_dirput->get_antrian($batas,$offset,$data['keyword']);
        $data['nomor_perkara']=$this->antrian_dirput->get_nomor_perkara($batas,$offset,$data['keyword']);
        if(count($data['nomor_perkara'])>0){
            foreach ($data['nomor_perkara'] as $row) {
               $data['ls_noperkara'] = '<li onClick="load(\''.$row->nomor_perkara.'\');"style="cursor:pointer">'.$row->nomor_perkara.'</li>';
            }            
        }
        $config['base_url'] = base_url() . 'antrian_dirput/cari/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination" id = "pagination-div-id a" pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        $data['jlhpage']=$page;
        $data['$total_rows']=$tot_hal->num_rows();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_dirput_v',$data);
        $this->load->view('footer');
    }

    public function show_list(){
        $idRow = $this->input->post('idRow');
        if(!empty($idRow))
        {
            $data['idRow'] = $this->input->post('idRow');
            $idRow = $data['idRow'];
            $this->session->set_userdata('idRow', $data['idRow']);
        }
        else
        {
            $data['idRow'] = $this->session->userdata('idRow');
            $idRow = $data['idRow'];
        }
        //ECHO $idRow;
        //$data['idRow'] = $this->input->post('idRow');
        $keyword = $this->input->post('keyword');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['keyword']="";

        $keyword = $this->input->post('keyword');
        if(!empty($keyword))
        {
            $data['keyword'] = $this->input->post('keyword');
            $this->session->set_userdata('keyword', $data['keyword']);
        }
        else
        {
            $data['keyword'] = $this->session->userdata('keyword');
        }

        if($idRow==1){
            $data['title'] = 'JUMLAH PERKARA PUTUS';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL';
            
        }elseif ($idRow==2) {
            $data['title'] = 'JUMLAH PERKARA MINUTASI';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL AND a.tanggal_minutasi IS NOT NULL';
            
        }elseif ($idRow==3) {
            $data['title'] = 'JUMLAH PERKARA <b>BELUM </b> MINUTASI';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL AND a.tanggal_minutasi IS NULL';
            
        }elseif ($idRow==4) {
            $data['title'] = 'JUMLAH FILE PUTUSAN YANG <b>SUDAH</b> DI UPLOAD DI SERVER LOKAL ';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL AND a.tanggal_minutasi IS NOT NULL AND a.amar_putusan_dok != "" ';
            
        }elseif ($idRow==5) {
            $data['title'] = 'JUMLAH FILE PUTUSAN YANG <b>BELUM</b> DI UPLOAD DI SERVER LOKAL ';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL AND a.tanggal_minutasi IS NOT NULL AND a.amar_putusan_dok = "" ';
            
        }

        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $tot_hal = $this->antrian_dirput->get_total_perkara_putusan($data['keyword'],$mainWhere);
        $data['data_putusan'] = $this->antrian_dirput->get_perkara_putusan($batas,$offset,$data['key'],$mainWhere);
        //print_r($data['data_putusan']);exit();
        $config['base_url'] = base_url() . 'antrian_dirput/show_list/';
        //$config['base_url'] = base_url() . 'antrian_dirput/show_list/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination" pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        //print_r($data['jlhpage']);
        $data['$total_rows']=$tot_hal->num_rows();
        $data['jumlah_row']=$tot_hal->num_rows();

        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_putusan',$data);
        //$this->load->view('antrian/antrian_dirput/test',$data);
        $this->load->view('footer');
    }

    public function show_list_searching(){
        //$data['rowId'] = $this->uri->segment(3);
        //print_r($this->uri->segment(3));
        if(!empty($idRow))
        {
            $data['idRow'] = $this->input->post('idRow');
            $idRow = $data['idRow'];
            $this->session->set_userdata('idRow', $data['idRow']);
        }
        else
        {
            $data['idRow'] = $this->session->userdata('idRow');
            $idRow = $data['idRow'];
        }
        $keyword = $this->input->post('keyword');
       // ECHO $keyword;
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['keyword']="";
        //$data['keyword']="";
        $keyword = $this->input->post('keyword');
        if(!empty($keyword))
        {
            $data['keyword'] = $this->input->post('keyword');
            $this->session->set_userdata('keyword', $data['keyword']);
        }
        else
        {
            $data['keyword'] = $this->session->userdata('keyword');
        }

        //print_r($data['idlist']);
         if($idRow==1){
            $data['title'] = 'JUMLAH PERKARA PUTUS';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL';
            
        }elseif ($idRow==2) {
            $data['title'] = 'JUMLAH PERKARA MINUTASI';
            $mainWhere = 'AND a.tanggal_putusan IS NOT NULL AND a.tanggal_minutasi IS NOT NULL';
            
        }
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $tot_hal = $this->antrian_dirput->get_total_perkara_putusan($data['keyword'],$mainWhere);
        $data['data_putusan'] = $this->antrian_dirput->get_perkara_putusan($batas,$offset,$data['keyword'],$mainWhere);
        //print_r($data['data_putusan']);exit();
        $config['base_url'] = base_url() . 'antrian_dirput/show_list_searching/';
        //$config['base_url'] = base_url() . 'antrian_dirput/show_list/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination" pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        //print_r($data['jlhpage']);
        $data['$total_rows']=$tot_hal->num_rows();
        $data['jumlah_row']=$tot_hal->num_rows();

        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_putusan',$data);
        $this->load->view('footer');
    }


    
    function masuklagi($id){
        $this->db->where('id',$id)->set('status',0)->update('dirput_antrian');
        redirect(base_url('antrian_dirput/antrian_list'));
    }
    function hapusaja($id){
        $this->db->where('id',$id)->delete('dirput_antrian');
        $this->index();
    }

    function globalView(){
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_putusan',$data);
        $this->load->view('footer');
    }

    function antrian_list(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        $idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }
        $data['data_antrian'] = $this->antrian_dirput->get_antrian($batas,$offset,$data['key']);
        $tot_hal = $this->antrian_dirput->get_total_antrian();
        $data_minutasi = $this->antrian_dirput->get_data_minutasi()->result_array();
        //print_r($data_minutasi['0']['jumlah_put']);
        $data['putus'] =  $data_minutasi[0]['jumlah_put'];
        $data['minutasi'] =  $data_minutasi[0]['jumlah_minutasi'];
        $data['belumminutasi'] =  $data_minutasi[0]['jumlah_belum_minutasi'];
        $data['jumlah_edoc'] =  $data_minutasi[0]['jumlah_edoc'];
        $data['jum_non_edoc'] =  $data_minutasi[0]['jum_non_edoc'];
        //print_r($data['putus']);
        $config['base_url'] = base_url() . 'antrian_dirput/antrian_list_search/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_list',$data);
        //$this->load->view('antrian/modal_list_perkara');
        $this->load->view('footer');
    }

    public function antrian_list_search(){
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['keyword']="";
        //$data['keyword']="";
        $keyword = $this->input->post('keyword');
        //echo $keyword;
        if(!empty($keyword))
        {
            $data['keyword'] = $this->input->post('keyword');
            $this->session->set_userdata('keyword', $data['keyword']);
        }
        else
        {
            $data['keyword'] = $this->session->userdata('keyword');
        }

        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $data_minutasi = $this->antrian_dirput->get_data_minutasi()->result_array();
        //print_r($data_minutasi['0']['jumlah_put']);
        $data['putus'] =  $data_minutasi[0]['jumlah_put'];
        $data['minutasi'] =  $data_minutasi[0]['jumlah_minutasi'];
        $data['belumminutasi'] =  $data_minutasi[0]['jumlah_belum_minutasi'];
        $data['jumlah_edoc'] =  $data_minutasi[0]['jumlah_edoc'];
        $data['jum_non_edoc'] =  $data_minutasi[0]['jum_non_edoc'];
        $tot_hal = $this->antrian_dirput->get_total_antrian($data['keyword']);
        $data['data_antrian'] = $this->antrian_dirput->get_antrian($batas,$offset,$data['keyword']);
        $data['nomor_perkara']=$this->antrian_dirput->get_nomor_perkara($batas,$offset,$data['keyword']);
        if(count($data['nomor_perkara'])>0){
            foreach ($data['nomor_perkara'] as $row) {
               $data['ls_noperkara'] = '<li onClick="load(\''.$row->nomor_perkara.'\');"style="cursor:pointer">'.$row->nomor_perkara.'</li>';
            }            
        }
        $config['base_url'] = base_url() . 'antrian_dirput/antrian_list_search/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination" id = "pagination-div-id a" pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        $data['jlhpage']=$page;
        $data['$total_rows']=$tot_hal->num_rows();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/antrian_list',$data);
        $this->load->view('footer');
    }

    function dirput_list(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        $idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }
        $data['dirput_list'] = $this->antrian_dirput->getPerkaraDirput($batas,$offset,$data['key']);
        $tot_hal = $this->antrian_dirput->getTotalPerkaraDirput($data['key']);

        $config['base_url'] = base_url() . 'antrian_dirput/dirput_list_searching/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/dirput_list',$data);
        //$this->load->view('antrian/modal_list_perkara');
        $this->load->view('footer');
    }

    function dirput_list_searching(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        $idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }
        $data['dirput_list'] = $this->antrian_dirput->getPerkaraDirput($batas,$offset,$data['key']);
        $tot_hal = $this->antrian_dirput->getTotalPerkaraDirput($data['key']);

        $config['base_url'] = base_url() . 'antrian_dirput/dirput_list_searching/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 50;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/dirput_list',$data);
        //$this->load->view('antrian/modal_list_perkara');
        $this->load->view('footer');
    }

    function dirput_ambigu(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        $idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }
        $data['DirputAmbigu'] = $this->antrian_dirput->getDirputAmbigu($batas,$offset,$data['key']);

        $tot_hal = $this->antrian_dirput->getTotalDirputAmbigu();
        $jumlahDirputAmbigu = $this->antrian_dirput->getTotalDirputAmbigu($data['key']);
        $data['jumlahDirputAmbigu'] =  $jumlahDirputAmbigu->num_rows();
        //print_r($data_minutasi['0']['jumlah_put']);
        //print_r($data['putus']);
        $config['base_url'] = base_url() . 'antrian_dirput/dirput_ambigu_search/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        //print_r($data["paginator"]);
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/dirput_ambigu',$data);
        //$this->load->view('antrian/modal_list_perkara');
        $this->load->view('footer');
    }

    public function dirput_ambigu_search(){
        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['keyword']="";
        //$data['keyword']="";
        $keyword = $this->input->post('keyword');
        //echo $keyword;
        if(!empty($keyword))
        {
            $data['keyword'] = $this->input->post('keyword');
            $this->session->set_userdata('keyword', $data['keyword']);
        }
        else
        {
            $data['keyword'] = $this->session->userdata('keyword');
        }

        $data['DirputAmbigu'] = $this->antrian_dirput->getDirputAmbigu($batas,$offset,$data['key']);
        $tot_hal = $this->antrian_dirput->getTotalDirputAmbigu();
        $jumlahDirput = $this->antrian_dirput->getTotalPerkaraDirput($data['key']);
        $data['jumlahDirputAmbigu'] =  $jumlahDirput->num_rows();

        $config['base_url'] = base_url() . 'antrian_dirput/dirput_ambigu_search/';
        $config['total_rows'] = $tot_hal->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination" id = "pagination-div-id a" pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        $data['jlhpage']=$page;
        $data['$total_rows']=$tot_hal->num_rows();
        $data['jumlah_row']=$tot_hal->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/dirput_ambigu',$data);
        $this->load->view('footer');
    }

    public function antrian_saat_ini(){
        $this->load->view('antrian/antrian_dirput/antrian_saat_ini');
    }

    function upaya_hukum_list(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }
        $idRow = $this->input->post('idRow');

        if(!empty($idRow))
        {
            $data['idRow'] = $this->input->post('idRow');
            $idRow = $data['idRow'];
            $this->session->set_userdata('idRow', $data['idRow']);
        }
        else
        {
            $data['idRow'] = $this->session->userdata('idRow');
            $idRow = $data['idRow'];
        }

        $this->load->model('antrian/antrian_dirput_m','antrian_dirput');
        $page=$this->uri->segment(3);
        $batas=50;
        if(!$page):
        $offset = 0;
        else:
        $offset = $page;
        endif;

        $data['key']="";
        $data['idlist']="";
        $postkata = $this->input->post('key');
        //$idlist = $this->input->post('idlist');
        if(!empty($postkata))
        {
            $data['key'] = $this->input->post('key');
            $this->session->set_userdata('key_word', $data['key']);
        }
        else
        {
            $data['key'] = $this->session->userdata('key_word');
        }

        if($idRow==1){
            $data['title'] = 'JUMLAH PERKARA PUTUS';
            $mainWhere = " WHERE a.pengajuan_id = 1 ";
            
        }elseif ($idRow==2) {
            $data['title'] = 'JUMLAH PERKARA MINUTASI';
            $mainWhere = ' WHERE a.pengajuan_id = 2 ';
            
        }elseif ($idRow==3) {
            $data['title'] = 'JUMLAH PERKARA <b>BELUM </b> MINUTASI';
            $mainWhere = ' WHERE a.pengajuan_id = 3 ';
            
        }elseif ($idRow==4) {
            $data['title'] = 'JUMLAH FILE PUTUSAN YANG <b>SUDAH</b> DI UPLOAD DI SERVER LOKAL ';
            $mainWhere = ' WHERE a.pengajuan_id = 4 ';
            
        }
        // echo $mainWhere;exit();

        $data['upayaHukumList'] = $this->antrian_dirput->getUpayaHukumList($batas,$offset,$data['key'],$mainWhere);
        
        $tot_hal = $this->antrian_dirput->getUpayaHukumList($batas,$offset,$data['key']);

        $jumlahUpayaHukumList = $this->antrian_dirput->getTotalUpayaHukumList($data['key']);
        $data['jumlahUpayaHukumList'] =  $jumlahUpayaHukumList->num_rows();
        //print_r($data['jumlahDirputAmbigu']);exit();
        $config['base_url'] = base_url() . 'antrian_dirput/upaya_hukum_list';
        $config['total_rows'] = $jumlahUpayaHukumList->num_rows();
        $config['per_page'] = $batas;
        $config['uri_segment'] = 3;
        $config['full_tag_open'] = '<ul class="pagination"  pagination-sm no-margin pull-right>';
        $config['full_tag_close'] = '</ul>';
        $config['first_link'] = '&laquo; First';
        $config['first_tag_open'] = '<li class="prev page">';
        $config['first_tag_close'] = '</li>';
        $config['last_link'] = 'Last &raquo;';
        $config['last_tag_open'] = '<li class="next page">';
        $config['last_tag_close'] = '</li>';
        $config['next_link'] = 'Next &rarr;';
        $config['next_tag_open'] = '<li class="next page">';
        $config['next_tag_close'] = '</li>';
        $config['prev_link'] = '&larr; Prev';
        $config['prev_tag_open'] = '<li class="prev page">';
        $config['prev_tag_close'] = '</li>';
        $config['cur_tag_open'] = '<li><a href="">';
        $config['cur_tag_close'] = '</a></li>';
        $config['num_tag_open'] = '<li class="page">';
        $config['num_tag_close'] = '</li>';
        $this->pagination->initialize($config);
        $data["paginator"] =$this->pagination->create_links();
        $data['jlhpage']=$page;
        $data['jml_antrian'] = $this->antrian_dirput->get_jumlah_antrian();
        $data['jumlah_row']=$jumlahUpayaHukumList->num_rows();
        $this->load->view('header');
        $this->load->view('antrian/antrian_dirput/upaya_hukum_list',$data);
        $this->load->view('footer');
    }

}
