<?php
if($this->session->userdata('is_logged_in')===FALSE){
            redirect('login');
}
?>
<div class="templatepopcentering" >
    <div id='pop' style="padding:5px;">
        <form id="frm_pem_put_pdt_kuasa_p" 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">Nama Kuasa Penggugat<font color=red>*</font></td>
                    <td >
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="kp" id="kp" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Nama Kuasa Penggugat--</option>
                                <?php 
                                    if($getListKuasa_P != ''){
                                        if($getListKuasa_P->num_rows>0){
                                            foreach ($getListKuasa_P->result() as $row) {
                                                 $pengacara_id = base64_encode($this->encrypt->encode($row->pengacara_id));
                                                 echo "<option value='".$pengacara_id."' pihakke='".$row->urutan."'>&nbsp; ". $row->urutan_pengacara .". ". $row->nama_pengacara ." </option>";
                                            }
                                        }
                                    }
                                ?>
                            </select>
                        </span>
                    </td> 
                </tr>
                <tr>
                    <td class="templatepopleftcol">Jenis Template<font color=red>*</font></td>
                    <td >
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="jenisTemplate" id="jenisTemplate" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Pilih Template---</option>
                                <option value='1'>&nbsp;1.&nbsp;Pemberitahuan Putusan Kepada Kuasa Penggugat Bertemu Atau Tidak Bertemu</option>
                                <option value='2'>&nbsp;2.&nbsp;Pemberitahuan Putusan Kepada Kuasa Penggugat Meninggal Dunia</option>
                            </select>
                        </span>
                    </td> 
                </tr>
                <tr>
                    <td class="templatepopleftcol">Nama Jurusita / Jurusita Pengganti<font color=red>*</font></td>
                    <td >
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="jursit" id="jursit" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Pilih Jurusita--</option>
                                <?php 
                                    if($getListJurusita != ''){
                                        if($getListJurusita->num_rows>0){
                                            foreach ($getListJurusita->result() as $row) {
                                                $jurusita_id = base64_encode($this->encrypt->encode($row->jurusita_id));
                                                echo "<option value='".$jurusita_id."'>&nbsp;".$row->jurusita_nama." </option>";
                                            }
                                        }
                                    }
                                ?>
                            </select>
                        </span>
                    </td> 
                </tr>
                <tr>
                    <td class="templatepopleftcol">Jabatan Jurusita<font color=red>*</font></td>
                    <td width="170" style='font-size:13px;padding-left: 20px; height: 23px;' >
                        <input type="radio" name="jursitLabel" id="jursitLabel" class="jurGroup" value="1" checked="true">Jurusita &nbsp;
                        <input type="radio" name="jursitPLabel" id="jursitPLabel"  class="jurGroup" value="2">Jurusita Pengganti
                    </td>
                </tr>
                <tr>
                    <td class="templatepopleftcol">Jumlah Biaya<font color=red>*</font></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="biaya" id="biaya" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Biaya--</option>
                                <?php 
                                    if($getBiayaPerkara != ''){
                                        if($getBiayaPerkara->num_rows>0){
                                            foreach ($getBiayaPerkara->result() as $row) {
                                                echo "<option value='".$row->jumlah."'>&nbsp;Rp.&nbsp;".number_format($row->jumlah) ." </option>";
                                            }
                                        }
                                    }
                                ?>  
                            </select>
                        </span>
                    </td> 
                </tr>
                <tr>
                    <td class="templatepopleftcol">Status Bertemu<font color=red>*</font></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;'  name="stat_bertemu" id="stat_bertemu" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='1'>&nbsp;Bertemu</option>
                                <option value='2'>&nbsp;Tidak Bertemu</option>
                            </select>
                        </span>
                    </td> 
                </tr>
                <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);
    }
});

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

function print(){
    var kp = $('#kp').val();
    if(kp==-1){
        alert('Silahkan Pilih Kuasa Penggugat');
        return;
    }
    var jenisTemplate = $('#jenisTemplate').val();
    if(jenisTemplate==-1){
        alert('Silahkan Pilih Jenis Template');
        return;
    }
    var jursit = $('#jursit').val();
    if(jursit==-1){
        alert('Silahkan Pilih Jurusita');
        return;
    }
    var biaya = $('#biaya').val();
    if(biaya==-1){
        alert('Silahkan Pilih Jumlah Biaya');
        return;
    }

    var stat_bertemu = $('#stat_bertemu').val();
    if(biaya==-1){
        alert('Silahkan Pilih Status Bertemu');
        return;
    }

    var kp = $('#kp option:selected').attr('value');
    var jenisTemplate = $('#jenisTemplate option:selected').attr('value');
    var jursit = $('#jursit option:selected').attr('value');
    var jursitLabel = $('input[type=radio]:checked').val();
    var biaya = $('#biaya option:selected').attr('value');
    var stat_bertemu = $('#stat_bertemu option:selected').attr('value');
    var id = '<?php echo $enc; ?>';
    window.open('<?php echo base_url("c_template_perdata_pemberitahuan_putusan/cetak_pemberitahuan_putusan_pdt_kuasa_p")?>/'+id+'/'+kp+'/'+jenisTemplate+'/'+jursit+'/'+jursitLabel+'/'+biaya+'/'+stat_bertemu,'_self');
} 
</script>