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

class c_template_tun_cabut_akta_kasasi extends CI_Controller {
    public function index(){
        if($this->session->userdata('is_logged_in')==FALSE){
        redirect('login');
        }       

        $this->load->view('dashboard', FALSE);
    }

    function popup_tun_akta_cabut_kasasi(){
        if($this->session->userdata('is_logged_in')==FALSE){
            redirect('login');
        }       
        $data['enc']=$this->uri->segment('3');
        $idperkara=$this->encrypt->decode(base64_decode($data['enc']));
        $data['pihakasal']=$this->uri->segment('4');        
        $data['$encpemohon']=$this->uri->segment('5');
        $idpemohon=$this->encrypt->decode(base64_decode($data['$encpemohon']));
        $this->load->model('generate_template/m_template_tun_cabut_akta_kasasi','template');
        $this->load->model('generate_template/m_template_ambil_identitas_template','template2');
        $data['dataPutusan']=$this->template->getDataPutusan($idperkara);
        $data['info_penadatangan']=$this->template->getDataPejabat();
        $data['info_DataTerdakwa']=$this->template->infoDataTerdakwa($idperkara);
        $data['info_dataDataJaksaPK']=$this->template->getDataJaksaPK($idperkara);
        $data['info_DataPH_PK']=$this->template->infoDataPH_PK($idperkara);
        $data['info']=$this->template->getInfo($idperkara);
        $data['info_datakasasi']=$this->template->getDataKasasi($idperkara);
        $data['template']=$this->template2->getDataDocumentTemplate('9','30','410','8','');
        $this->load->view('generate_template/popup_tun_akta_cabut_kasasi', $data, FALSE);
    }

    function cetak_tun_akta_cabut_kasasi(){
        if($this->session->userdata('is_logged_in')==FALSE){
        redirect('login');
        }       
        $data['enc'] = $this->input->post('enc',TRUE);
        $idperkara=$this->encrypt->decode(base64_decode($data['enc']));
        if(!is_numeric($idperkara) OR !intval($idperkara)>0){
            show_404();
            exit();
        }
        $data['idpembuatakta'] = $this->input->post('pembuat',TRUE);
        $idpembuatakta=$this->encrypt->decode(base64_decode($data['idpembuatakta']));
        $data['idput'] = $this->input->post('putusan',TRUE);
        $idput=$this->encrypt->decode(base64_decode($data['idput']));
        $data['jenisTemplate'] = $this->input->post('jenisAkta',TRUE);       
        $this->load->model('generate_template/m_template_tun_cabut_akta_kasasi','template');
        $this->load->model('generate_template/m_template_ambil_identitas_template','template2');
        $data['dataPutusan']=$this->template->getDataPutusan($idperkara);
        $data['info_datakasasi']=$this->template->getDataKasasi($idperkara);
        $data['datapihakpenggugat'] = $this->template->getPihakPenggugat($idperkara);
        $data['datapihaktergugat'] = $this->template->getPihakTergugat($idperkara);
        $data['datapihakkuasa'] = $this->template->getInfo($idperkara);
        $data['dataTemplate'] = $this->template->cetak_pencabutan_kasasi($idperkara,$idpembuatakta,$idput);
        $data['template']=$this->template2->getDataDocumentTemplate('9','30','410','8','');
        $this->load->view('generate_template/cetak_tun_cabut_kasasi_tergugat',$data,FALSE);
    }

}
