<?php
if($this->session->userdata('is_logged_in')===FALSE){
            redirect('login');
}
?>
<div class="templatepopcentering" >
    <div id='pop' style="padding:5px;">
        <form id="frm_pemb_put_pdt" class="templatepopform" method="" action="">
		  <table id="" style="padding:5px;">
            <tr><td colspan="2" class="templatepoptitle">
            <?php 
                echo strtoupper($judul."<br/>Perkara ".$jnsperkara);
            ?>
            </td></tr>
                
                <tr>
                    <td class="templatepopleftcol">Pilih Surat <font color=red>*</font></td>
                
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="blangko_pbt" id="blangko_pbt" class="custom-dropdown__select custom-dropdown__select--white">                                
                                            <option value='-1'>--Pilih Blanko--</option>
                                <?php
                                    foreach($blangko_pbt->result() as $data)
                                        {
                                            ?>
                                            <option value='<?php echo $data->kode; ?>'><?php echo $this->templatehelper->ucname($data->nama); ?></option><?php
                                        }
                                ?>
                            </select> 
                        </span>
                    </td> 
                </tr>
                
                
                    <td colspan="2" style="background:white;" align="center">
                        <input type="button" id="kembali" value="Kembali" class="btn">
                        <input type="button" id="print_btn" onClick='print();' value="Cetak" class="btn">
                    </td>
                </tr>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">

$('#kembali').closingFormWin();

$('#jursitLabel').click(function(){
    if ($(this).prop('checked')){
        $('#jursitPLabel').prop('checked', false);
    }
});

$("#blangko_pbt_delegasi").change(function(){
    var pbt=$('#blangko_pbt_delegasi').val()

});

function print(){
    
    var jursit = $('#jursit').val();
    var pbt=$('#blangko_pbt_delegasi option:selected').attr('value')
    if (pbt=='-1') {
        alert('Pilih Jenis PBT')
        return
    }
    
    var jursit = $('#jursit option:selected').attr('value');
    var jursitLabel = $('input[type=radio]:checked').val();
    var id = '<?php echo $enc; ?>';
    var idpihak = '<?php echo $encidpihak; ?>';

    window.open('<?php echo base_url("c_template_agama_perdata_pemberitahuan_putusan/cetak_pemberitahuan_putusan_tergugat_delegasi")?>/'+id+'/'+idpihak+'/1/'+jursit+'/'+jursitLabel+'/'+pbt,'_self');
};


</script>