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

class Manage_perkara extends CI_Controller {

	function redir_show_detil(){
		$this->setParams();
		$this->nativesession->set_flash_session('open_dataumum', "No");
		#$this->nativesession->set('main_url_requested', current_url());
		redirect('detil_perkara');
	}
	#07-10-2015
	function redir_show_detil_tun(){
		$this->setParams();
		$this->nativesession->set_flash_session('open_dataumum', "No");
		#$this->nativesession->set('main_url_requested', current_url());
		redirect('detil_perkara_tun');
	}
	function redir_show_detil_mil(){
		$this->setParams();
		$this->nativesession->set_flash_session('open_dataumum', "No");
		#$this->nativesession->set('main_url_requested', current_url());
		redirect('detil_perkara_mil');
	}

	function redir_show_detil_agama(){
		$this->setParams();
		$this->nativesession->set_flash_session('open_dataumum', "No");
		#$this->nativesession->set('main_url_requested', current_url());
		redirect('detil_perkara_agama');
	}
	#end
	function redir_banding(){
		$this->setParams(FALSE);
		redirect('detil_banding');
	}

	function redir_open_banding(){
		$this->setParams(FALSE);
		$this->nativesession->set_flash_session('view', TRUE);
		redirect('detil_banding');
	}

	function redir_kasasi(){
		$this->setParams(FALSE);
		redirect('detil_kasasi');
	}

	function redir_open_kasasi(){
		$this->setParams(FALSE);
		$this->nativesession->set_flash_session('view', TRUE);
		redirect('detil_kasasi');
	}


	function redir_pk(){
		$this->setParams(FALSE);
		redirect('detil_pk');
	}

	function redir_open_pk(){
		$this->setParams(FALSE);
		$this->nativesession->set_flash_session('view', TRUE);
		redirect('detil_pk');
	}
	
	function redir_show_dataumum(){
		$this->setParams();
		$this->nativesession->set_flash_session('open_dataumum', "Yes");
		redirect('detil_perkara');
	}

	

	function redir_sela(){
		$this->setParams();
		redirect('managePutusanSela');
	}

	function redir_putusan_akhir(){
		$this->setParams();
		redirect('managePutusanAkhir');
	}


	#DODON 3/6/2015
	function redir_show_detil_grasi(){
		$this->setParams(FALSE);
		redirect('perkara_grasi/detil_grasi');
	}
	function redir_show_hapus_grasi(){
		$this->setParams(FALSE);
		redirect('perkara_grasi/hapus_grasi');
	}
	function redir_show_edit_grasi(){
		$this->setParams();
		redirect('perkara_grasi/edit_grasi');
	}

	#08/02/2016
	function redir_show_edit_grasi_pertimbangan_ma(){
		$this->setParams();
		redirect('perkara_grasi/edit_grasi_pertimbangan_ma');
	}

	#08/02/2016
	function redir_show_edit_grasi_putusan_presiden(){
		$this->setParams();
		redirect('perkara_grasi/edit_grasi_putusan_presiden');
	}


		
	function setParams($setUrl=TRUE){
		$segment = $this->uri->segment_array();
		if(count($segment)>3){
			show_404();
		}
		$this->nativesession->set_flash_session('security', TRUE);
		
		if($setUrl==TRUE){
			$oldsess = $this->nativesession->get_flash_session('url_requested');
			if(empty($oldsess)){
				$this->nativesession->set('main_url_requested', $this->nativesession->get('main_url_requested'));
			}else{
				$this->nativesession->set('main_url_requested', $oldsess);
			}
		}

		
		$url = current_url();
		if($this->uri->segment(3)!=''){
			$arr = explode('/', $url);
			unset($arr[count($arr)-1]);
			$url = implode('/', $arr);

		}

		$this->nativesession->set_flash_session('url_requested', $url);
		$this->nativesession->set_flash_session('enc', $this->uri->segment(2));
		$this->nativesession->set_flash_session('tab_no', $this->uri->segment(3));
		$this->nativesession->set_flash_session('perkara_id', $this->encrypt->decode(base64_decode($this->uri->segment(2))));
		#atria
		$this->nativesession->set_flash_session('varlist_alur_perkara_id', $this->encrypt->decode(base64_decode($this->uri->segment(2))));
		#endofatria
		#varlist_alur_perkara_id=1;var_tahapan_id=10
		#

	}
}
