<?php
if($this->session->userdata('is_logged_in')===FALSE){
            redirect('login');
}
?>
<div class="centering" style="width:780px;margin-top: 1%;z-index:-100">
    <div id='akta_militer' style="border: 1px solid #ffffff;">
        <div class="detil" style="padding: 2px;background-color: white;">
            <div style="font-size:14px;">
                <form id="frm_pop_put_mil" class="removeformbottomspace" method="post" 
                    action="<?php echo (base_url().'c_template_putusan_mil/cetak_putusan_mil') ;?>">
                    <table id='tableDetilPerkara' style="font-size:14px;">
                        <col width="25%">
                        <col width="75%">
                        <tbody>
                        <tr>
                            <td class="header" colspan="2">Cetak <?php echo $jdl; ?></td>
                        </tr>
                        <tr>
                            <td id="first-child">Nomor Perkara</td>
                            <td>
                                <?php print_r($perkara['0']['nomor_perkara']); ?>
                                <input type="hidden" name='enc' value='<?php echo $enc;?>'>
                            </td>
                        </tr>
                        <tr>
                            <?php
                            if (intval($perkara['0']['alur_perkara_id'])>100){
                                echo "<td id='first-child'>Tanggal Pelimpahan</td>";
                            }else{
                                echo "<td id='first-child'>Tanggal Pendaftaran</td>";
                            }
                            ?>
                            <td>
                            <?php echo $this->tanggalhelper->convertDayDate($tanggal_pelimpahan->tanggal_pendaftaran); ?>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="divider">Info <?php echo $jdl; ?></td>
                        </tr>
                        <tr>
                            <td id="first-child">Tanggal <?php echo $jdl; ?></td>
                            <td>
                            <?php print_r($this->tanggalhelper->convertDayDate($infoPutus->result()[0]->tanggal_putusan)); ?>
                            </td>
                        </tr>
                        <tr>                        
                            <td id="first-child">Amar <?php echo $jdl; ?></td>
                            <td>
                            <?php print_r($infoPutus->result()[0]->amar_putusan); ?>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="divider" >Cetak</td>
                        </tr>
                        <tr>
                            <td class="templatepopleftcol">Pilih Jenis Template <font color=red>*</font></td>
                            <td style="">
                                <span class="custom-dropdown custom-dropdown--emerald">
                                    <select style='width:303px;'  name="jns_template" id="jns_template" class="custom-dropdown__select custom-dropdown__select--white">
                                        <option value="-1">--pilih format template--</option>
                                    <?php 
                                        if($idalurperkara=='120'){
                                            if($jPut=='1'){ ?>
                                                <option value="1">Putusan Akhir [format biasa]</option>
                                                <option value="2">Putusan Akhir [format terdakwa tidak hadir]</option>
                                                <option value="3">Putusan Akhir [format N.O]</option>
                                                <option value="4">Putusan Akhir [format terdakwanya meninggal dunia]</option>
                                                <option value="5">Putusan Akhir [format susunan dakwaan komulatif / variatif]</option>
                                    <?php   }elseif($jPut=='2'){ ?>
                                                <option value="6">Petikan Putusan [format biasa]</option>
                                    <?php   }elseif($jPut=='3'){ ?>
                                                <option value="7">Pengumuman Pertama</option>
                                                <option value="8">Pengumuman Terakhir</option>
                                    <?php }
                                        }else{ 
                                            if($jPut=='1'){ ?>
                                                <option value="9">Putusan Akhir [format biasa Pelanggaran]</option>   
                                    <?php }elseif($jPut=='2'){ ?>
                                                <option value="10">Pengumuman Putusan</option>
                                    <?php }                  
                                        }
                                    ?>
                                    </select>
                                </span>
                            </td> 
                        </tr>
                        <tr id="jenis_no" hidden>
                            <td id="first-child">Jenis Putusan NO</td>
                            <td>
                            <span class="custom-dropdown custom-dropdown--emerald">
                                    <select style='width:303px;'  name="jenis_no" class="custom-dropdown__select custom-dropdown__select--white">
                                        <option value="1">NO Terdakwa Tidak Hadir</option>
                                        <option value="2">NO Terdakwa Meninggal</option>
                                        <option value="3">NO Daluwarsa</option>
                                        <option value="4">NO Pencabutan Pengaduan</option>
                                        <option value="5">NO Nebis In Idem</option>
                                    </select>
                                </span>
                            </td>
                        </tr>
                        <?php 
                        if($jPut=='3'){
                        ?>
                        <tr>
                            <td class="templatepopleftcol">Penandatangan Pengumuman<font color=red>*</font></td>
                            <td style="">
                                <span class="custom-dropdown custom-dropdown--emerald">
                                    <select style='width:430px;'  name="ket_terdakwa" id="ket_terdakwa" class="custom-dropdown__select custom-dropdown__select--white">
                                        <option value='68'><?php echo $this->templatehelper->ucname("Kepala Panitera ".$penandatangan->row(0)->NamaPN." :: ".$penandatangan->row(0)->PansekPNNama);?></option>
                                        <option value='70'><?php echo $this->templatehelper->ucname("Wakil Panitera ".$penandatangan->row(0)->NamaPN." :: ".$penandatangan->row(0)->WaPanNama);?></option>
                                    </select>
                                </span>
                            </td> 
                        </tr>
                        <?php } ?>
                        <?php 
                        if($idalurperkara=='120' && $jPut=='2'){
                        ?>
                        <tr>
                            <td class="templatepopleftcol">Sikap Terdakwa <font color=red>*</font></td>
                            <td style="">
                                <span class="custom-dropdown custom-dropdown--emerald">
                                    <select style='width:303px;'  name="ket_terdakwa" id="ket_terdakwa" class="custom-dropdown__select custom-dropdown__select--white">
                                        <option value="-1">-- Pilih sikap terdakwa --</option>
                                        <option value="1">1. Menerima putusan</option>
                                        <option value="2">2. Menerima putusan, dengan mengajukan permohonan grasi</option>
                                        <option value="3">3. Mengajukan permohonan banding</option>
                                        <option value="4">4. Mohon waktu untuk berpikir</option>
                                    </select>
                                </span>
                                <input type="hidden" id="ket_terdakwa_text" name="ket_terdakwa_text" value"">
                            </td> 
                        </tr>
                        <tr>
                            <td class="templatepopleftcol">Sikap Oditur<font color=red>*</font></td>
                            <td style="">
                                <span class="custom-dropdown custom-dropdown--emerald">
                                    <select style='width:303px;'  name="ket_oditur" id="ket_oditur" class="custom-dropdown__select custom-dropdown__select--white">
                                        <option value="-1">-- Pilih sikap oditur --</option>
                                        <option value="1">1. Menerima putusan</option>
                                        <option value="2">2. Mengajukan permohonan banding</option>
                                        <option value="3">3. Mohon waktu untuk berpikir</option>
                                        <option value="4">4. Mengajukan permohonan kasasi</option>
                                    </select>
                                </span>
                                <input type="hidden" id="ket_oditur_text" name="ket_oditur_text" value"">
                            </td> 
                        </tr>
                        <?php } ?>
                        <tr>
                            <td colspan="2" class="buttongroup">
                            <input type="button" id="kembali" value="Kembali" class="btn">
                            <input type="submit" id="simpan" value="Cetak" class="btn">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">

$('#jns_template').change(function() {
    var jns_template = $('#jns_template').val();
    if(jns_template==3){
        $("#jenis_no").show();
    }else{
        $("#jenis_no").hide();
    }
});

$('#frm_pop_put_mil').submit(function(e) {
    var jns_template = $('#jns_template').val();
    if(jns_template==-1){
        message_error_show('Silahkan Plilih Jenis Template');
        e.preventDefault();
    }
});
$('#ket_oditur').change(function() {
    var val= $('#ket_oditur').val();
    if (val!='-1') {
        $('#ket_oditur_text').val(val) ;    
    }
});

$('#ket_terdakwa').change(function() {
    var val= $('#ket_terdakwa').val();
    if (val!='-1') {
        $('#ket_terdakwa_text').val(val) ;    
    }
});

$('#frm_pop_put_mil').submit(function(e) {
    var ket_terdakwa = $('#ket_terdakwa').val();
    if(ket_terdakwa==-1){
        message_error_show('Silahkan Pilih Keterangan Terdakwa');
        e.preventDefault();
    }
});
$('#frm_pop_put_mil').submit(function(e) {
    var ket_oditur = $('#ket_oditur').val();
    if(ket_oditur==-1){
        message_error_show('Silahkan Pilih Keterangan Oditur');
        e.preventDefault();
    }
});


$('#kembali').closingFormWin();
</script>   