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

class Jurnal_hkk_cetak extends CI_Controller {
	function parseParam($params){
		$data = array();
		$idalurperkara = '';
		$tahapan_id = '';
		$tmp = explode(";", $params);
		if(count($tmp)>0){
			$tmp_var = explode("=", $tmp[0]);
			if(count($tmp_var)>0){
				$data['idalurperkara'] = $tmp_var[1];
			}
		}
		return $data;
	}


	function cetak(){
		if($this->session->userdata('is_logged_in')==FALSE){
			redirect('login');
		}

		$segment = $this->uri->segment_array();
		//print_r($segment);
		//$jenis_cetak = intval($segment[3]);
		$param = $this->encrypt->decode(base64_decode($segment[3]));
		$keyword_segment = $this->encrypt->decode(base64_decode($segment[4]));
				
		$data = $this->parseParam($param);
		$alur_perkara_id = $data['idalurperkara'];

		#Pencarian
		if($keyword_segment!==0){
			$keyword = $keyword_segment;
		} else {
			$keyword = "";
		}

		#Jurnal HKK
		$this->load->model('jurnal/jurnal_hkk','jurnal');
		$query = $this->jurnal->getJurnalListCetak($alur_perkara_id,$keyword);
		
		$data['list_jurnal_perkara'] = $query;
		$data['idalurperkara'] = $alur_perkara_id;
		
		$this->load->vars($data);
		$this->load->view('jurnal_perkara/jurnal_hkk_cetak');

	}
}
?>