<div class="centering" style="width:700px;margin-top: 1%;z-index:-100">
     <div id='majelis_hakim' style="border: 1px solid #ffffff;">
          <div class="detil" style="padding: 2px;background-color: white;">
          <div style="font-size:14px;">
          <form id="frm_majelis" class="removeformbottomspace" method="post" action="<?php echo base_url(); ?>penetapan_hakim_pk_simpan">
          <table id='tableDetilPerkara' style="font-size:13px;">
               <col width="35%">
               <col width="65%">
               <tbody>
                    <tr>
	         <td colspan="2" style="padding:4px;background:white;font-size:16px;color:#111;" align="center"><strong>PENETAPAN HAKIM/MAJELIS HAKIM PENINJAUAN KEMBALI</strong></td>
	    </tr>
	    <tr>
                         <td id="first-child">Nomor Perkara</td>
                         <td><span><?php echo $nomor_perkara_pn; ?></span></td>
                    </tr>
                    <tr>
                         <td id="first-child">Tanggal Penetapan</td>
                         <td><input id="tgl_penetapan_majelis" name="tgl_penetapan_majelis"  class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"></td>
                    </tr>
                    <tr class="row_majelis">
                         <td id='first-child'>Majelis Hakim/Hakim</td>
                         <td><?php echo  form_dropdown('jenis_hakim', $jenis_hakim,'', 'class="form-control" onChange="cekJenisHakim()"  id="_jenis_hakim"'); ?></td>
                    </tr>
                    <tr class="tunggal">
                         <td id="first-child">Hakim Tunggal</td>
                         <td><?php echo  form_dropdown('hakim_tunggal', $nama_hakim, '', 'class="form-control"  id="hakim_tunggal"'); ?></td>
                    </tr>
	    <tr class="majelis">
                         <td id="first-child">Hakim Ketua</td>
                         <td><?php echo  form_dropdown('hakim1', $nama_hakim,'', 'class="form-control hakim"  id="hakim1"'); ?></td>
                    </tr>
	    <tr class="majelis">
                         <td id="first-child">Hakim Anggota 1</td>
                         <td><?php echo  form_dropdown('hakim2', $nama_hakim,'', 'class="form-control hakim"  id="hakim2"'); ?></td>
                         </tr>
	    <tr class="majelis">
                         <td id="first-child">Hakim Anggota 2</td>
                         <td><?php echo  form_dropdown('hakim3', $nama_hakim,'', 'class="form-control hakim"  id="hakim3"'); ?></td>
                    </tr>
                    <tr>
                         <td id="first-child" style="vertical-align: top;">Keterangan</td>
                         <td></td>
                    </tr>
                    <tr>
                         <td colspan="2" class="buttongroup">
                              <input type="hidden" id="curr_date" value="<?php echo $current_date; ?>">
                              <input type="button" id='close_form_add_majelis' value="Kembali" class="btn close_form_add_majelis">
                              <input type="hidden" id='close_form_refresh' value="">
                              <input type="submit" id="simpan" value="Simpan" class="btn">
                         </td>
                    </tr>
               </tbody>
               </table>
          </form>
          </div>
          </div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
     $('.majelis').hide();
     $('.tunggal').hide();
     $('#simpan').hide();
});

$('#frm_majelis').SubmitHandling({
     refresh:'1',
     setRefresh:1,
     divRef:'#konten',
     clicked:1,
     btnClicked:'#close_form_add_majelis',
     whenStatus:1
    });

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


function cekJenisHakim(){
      var jenis_hakim=$('#_jenis_hakim').val();
      if(jenis_hakim==1){
          $('.majelis').hide();
          $('.tunggal').show();
          $('#simpan').show();
     } else if (jenis_hakim==2) {
          $('.tunggal').hide();
          $('.majelis').show();
          $('#simpan').show();
     } else {
          $('.tunggal').hide();
          $('.majelis').hide();
          $('#simpan').hide();
     }
}

$('#tgl_penetapan_majelis').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay:$.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
               var error = 0;
               
               var tmp = $(this).val().split("/");
                    var tmp2 = $('#curr_date').val().split("/");
                    if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
                         message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
                         error = 1
                    }

                    if(error==1){
                         message_error_show(message);
                         $(this).css("background-color", "red");
                    }else{
                         $(this).css("background-color", "#dedbdb");
                    }
                    error = 0;
          }
          });
</script>
