<?php
if($this->session->userdata('is_logged_in')===FALSE){
            redirect('login');
}
?>
<div class="templatepopcentering" style="width:500px;margin-top: 1%;">
    <div id='pop' style="border: 1px solid #ffffff;">
        <div class="detil" style="padding: 4px;background-color: white;"> 
        <form id="frm_relaas_panggilan_pid_pra" style="padding: 4px;background:white;margin:0;" method="post" action="<?php echo base_url().'c_template_penetapan_pidana_pra/cetak_relaas_panggilan_praperadilan';?>">
            <table id="" style="padding:10px;"> 
                <tr><td colspan="2" style="background:#5fb85c;padding:10px;color:#fff;text-align:center;">
                <?php 
                    $i=0;
                    foreach ($template->result() as $template)
                    {
                        if ($i=='0')
                        {
                            $judul=$template->namatemplate;
                            $judul=explode("Kepada",$judul);
                            $jnsperkara=$template->jnsperkara;
                        }
                    }
                        echo strtoupper($judul[0]."<br/>Perkara ".$jnsperkara);
                ?>
                </td></tr>
            <tr>
                <td class="templatepopleftcol">Pilih Jenis Relaas<font color=red>*</font></td>
                    <td style="">
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;border:#ddd 1px solid'  name="jenisRelaas" id="jenisRelaas" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Jenis Relaas Panggilan--</option>
                                <option value='1'>Relaas Panggilan Praperadilan Untuk Pemohon</option>
                                <option value='2'>Relaas Panggilan Praperadilan Untuk Pemohon Tidak Bertemu</option>
                                <option value='3'>Relaas Panggilan Praperadilan Untuk Termohon</option>
                            </select>
                        </span>
                </td> 
            </tr>
            <tr>
                <td class="templatepopleftcol">Pilih Jabatan<font color=red>*</font></td>
                    <td style="">
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;border:#ddd 1px solid'  name="jursitLbl" id="jursitLbl" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Jurusita/Jursita Pengganti--</option>
                                <option value='1'>Jurusita</option>
                                <option value='2'>Jurusita Pengganti</option>
                            </select>
                    </span>
                </td> 
            </tr>
            <tr>
                <td class="templatepopleftcol">Pilih Nama Jurusita/JSP<font color=red>*</font></td>
                    <td style="">
                        <span class="custom-dropdown custom-dropdown--emerald">
                            <select style='width:250px;border:#ddd 1px solid'  name="jurusita" id="jurusita" class="custom-dropdown__select custom-dropdown__select--white">
                                <option value='-1'>--Pilih Nama Jurusita/Jursita Pengganti--</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;". $this->templatehelper->ucname($row->jurusita_nama)." </option>";
                                            }
                                        }
                                    }
                                ?>
                            </select>
                        </span>
                </td> 
            </tr>
                <tr>
                    <td colspan="2" style="background:white;" align="center">
                        <input type="hidden" id="enc" name = 'enc' value="<?php echo $enc; ?>">
                        <input type="button" id="kembali" value="Kembali" class="btn">
                        <input type="submit" id="print_btn"  value="Cetak" class="btn">
                    </td>
                </tr>
            </table>
        </form>
        </div>
    </div>
</div>
<script type="text/javascript">

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


$('#frm_relaas_panggilan_pid_pra').submit(function(e) {
    var jenisRelaas = $('#jenisRelaas').attr('value');
    if(jenisRelaas==-1){
        message_error_show('Silahkan Pilih Jenis Relaas Panggilan');
        e.preventDefault();
    }
    var jursitLbl = $('#jursitLbl').val();
    if(jursitLbl == -1){
        message_error_show('Silahkan Pilih Jurusita/Jursita Pengganti');
        e.preventDefault();
    }
    var jurusita = $('#jurusita').val();
    if(jurusita == -1){
        message_error_show('Silahkan Pilih Nama Jurusita/Jursita Pengganti');
        e.preventDefault();
    }
    
});
</script>