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

class c_template_mil_akta_pemberitahuan_pencabutan_permohonan_kasasi extends CI_Controller {
	
    function popup_mil_akta_pemberitahuan_pencabutan_permohonan_kasasi(){
        $segment=$this->uri->segment_array();
        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['pihakasal']=$this->uri->segment('4'); 
		//$pihakasal=$this->encrypt->decode(base64_decode($data['pihakasal']));		
       // if(!is_numeric($pihakasal) OR !intval($pihakasal)>0){
       //     show_404();
       //     exit();
       // }

        $data['pihakasal']=$this->uri->segment('4');  
        if(!is_numeric($data['pihakasal']) OR !intval($data['pihakasal'])>0){
            show_404();
            exit();
        }

        $data['encpemohon']=$this->uri->segment('5');
        $idpemohon=$this->encrypt->decode(base64_decode($data['encpemohon']));
        if(!is_numeric($idpemohon) OR !intval($idpemohon)>0){
            show_404();
            exit();
        }
		

        //$data['idakta'] = $this->uri->segment('6');
        //print_r($data);exit;
		
		// echo "idperkara :".$idperkara;
		// echo "pihakasal :".$pihakasal;
		// echo "idpemohon :".$idpemohon;
        
		$this->load->model('generate_template/m_template_mil_akta_pemberitahuan_pencabutan_permohonan_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']=$this->template->getInfo($idperkara);
		
        $data['template']=$this->template2->getDataDocumentTemplate('120','30','420','3','');

        $this->load->view('generate_template/popup_mil_akta_pemberitahuan_pencabutan_permohonan_kasasi',$data);
    }

    function cetak_mil_akta_pemberitahuan_pencabutan_permohonan_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['encpemohon'] = $this->input->post('encpemohon',TRUE);
        $idpemohon=$this->encrypt->decode(base64_decode($data['encpemohon']));
        if(!is_numeric($idpemohon) OR !intval($idpemohon)>0){
            show_404();
            exit();
        }

        // $data['pemohon_id']=$idpemohon;
   //     $pihakasal = $this->input->post('pihakasal',TRUE);
	//	$data['pihakasal']=$this->encrypt->decode(base64_decode($pihakasal));		
    //    if(!is_numeric($data['pihakasal']) OR !intval($data['pihakasal'])>0){
    //        show_404();
    //        exit();
    //    }

                $data['pihakasal']=$this->input->post('pihakasal',TRUE);  
        if(!is_numeric($data['pihakasal']) OR !intval($data['pihakasal'])>0){
          show_404();
            exit();
        }

        $data['idpembuatakta'] = $this->input->post('pembuat',TRUE);
        $idpembuatakta=$this->encrypt->decode(base64_decode($data['idpembuatakta']));
        if(!is_numeric($idpembuatakta) OR !intval($idpembuatakta)>0){
             show_404();
             exit();
        }

        $data['idput'] = $this->input->post('putusan',TRUE);
        $idput=$this->encrypt->decode(base64_decode($data['idput']));
       if(!is_numeric($idput) OR !intval($idput)>0){
            show_404();
           exit();
        }

        //$data['tgl_pemberitahuan'] = $this->input->post('tgl_akta',TRUE);
		$data['tgl_pemberitahuan_cabut'] = $this->input->post('tgl_akta',TRUE);
		
        $this->load->model('generate_template/m_template_mil_akta_pemberitahuan_pencabutan_permohonan_kasasi','template');
		$this->load->model('generate_template/m_template_ambil_identitas_template','template2');
		
        //$data['info_DataTerdakwa']=$this->template->infoDataTerdakwa($idperkara);

        $data['datapencabutankasasi'] = $this->template->getDataPencabutanPermohonanKasasi($idperkara); 
        $data['datapencabutankasasi2'] = $this->template->getDataPencabutanPermohonanKasasi2($idperkara);		

        if ($data['pihakasal']==2){
            $data['dataTemplate'] = $this->template->cetak_permohonan_kasasi($idperkara,$idpembuatakta,$idput, $idpemohon);  
			$data['template']=$this->template2->getDataDocumentTemplate('120','30','420','3','');			
        }elseif ($data['pihakasal']==1){
            $data['dataTemplate'] = $this->template->cetak_permohonan_kasasi_oditur($idperkara,$idpembuatakta,$idput,$idpemohon);    
            $data['info_DataOditur']=$this->template->getDataOditur($idperkara);    
			$data['template']=$this->template2->getDataDocumentTemplate('120','30','420','4','');			
        }
        //$data['idakta'] = $this->input->post('idakta',TRUE);

        // switch ($data['idakta']) {
            // case '1':
                // if ($pihakasal=='1'){
                    // $doc='2';
                // }elseif ($pihakasal=='2'){
                    // $doc='1';
                // }
                // $data['template']=$this->template2->getDataDocumentTemplate('120','30','500',$doc,'');
            // break;
            
            // default:
                // $data['template']=array();
            // break;
        // }
        $this->load->view('generate_template/cetak_mil_akta_pemberitahuan_pencabutan_permohonan_kasasi',$data,FALSE);
    }	
	
}
/* End of file c_template_mil_akta_pemberitahuan_putusan_kasasi.php */
/* Location: ./application/controllers/c_template_mil_akta_pemberitahuan_putusan_kasasi.php */