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

class c_template_putusan_pidana_pra extends CI_Controller {

    function index() {
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }  
        $this->load->view('dashboard', FALSE);
    }

   function cetak_putusan_pra_format_gugur() {
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }  
        $data['enc']=$this->uri->segment('3');
        $idperkara=$this->encrypt->decode(base64_decode($data['enc']));
        if(!is_numeric($idperkara) OR !intval($idperkara)>0){
            show_404();
            exit();
        }   
        $this->load->model('generate_template/m_template_putusan_pidana_pra','template');
        $data['data_pn']= $this->template->getDataPN();
        $data['data_perkara']=$this->template->getDataPerkara($idperkara);
        $data['data_putusan']=$this->template->getDataPutusan($idperkara);
        $data['data_penetapan_hakim']=$this->template->getDataPenetapanHakim($idperkara);
        $data['data_pp']=$this->template->getdata_pp($idperkara);
		
        $this->load->model('generate_template/m_template_ambil_identitas_template','template2');
        $data['template']=$this->template2->getDataDocumentTemplate('119','15','210','1','');
        $this->load->view('generate_template/cetak_putusan_pidana_pra_gugur',$data,FALSE);
    }

    function cetak_putusan_pra_kabul_tolak() {
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }  
        $data['enc']=$this->uri->segment('3');
        $idperkara=$this->encrypt->decode(base64_decode($data['enc']));
        if(!is_numeric($idperkara) OR !intval($idperkara)>0){
            show_404();
            exit();
        }   
        $data['jenisTemplate']=$this->uri->segment('4');

        $this->load->model('generate_template/m_template_putusan_pidana_pra','template');
        $data['data_pn']= $this->template->getDataPN();
        $data['data_perkara']=$this->template->getDataPerkara($idperkara);
        $data['data_penetapan_hakim']=$this->template->getDataPenetapanHakim($idperkara);
        $data['data_putusan']=$this->template->getDataPutusan($idperkara);
        $data['data_pp']=$this->template->getdata_pp($idperkara);
	
        $this->load->model('generate_template/m_template_ambil_identitas_template','template2');
        $data['template']=$this->template2->getDataDocumentTemplate('119','15','210','2','');
        $this->load->view('generate_template/cetak_putusan_pidana_pra_kabul_tolak',$data,FALSE);
    }
}
?>