<div class="centering" style="width:80%;margin-top: 1%;">
        <div id='edit_data_umum' style="background:none;padding:10px; border:1px solid #fff">
                <div style="background:white;padding:5px">
                <div class="detil" style="font-size:14px;margin-top:25px;width: 100%;margin: 0 auto;border-color: #5fb85c;">
                        <form id="frm_diversi_edit" style="background:white;margin:0;" method="post" action="<?php echo base_url().'tab_diversi_c/validate_edit_hasil_diversi';?>">
                        	<table id='infoPerkara' style="font-size:14px;" >
                        		<col width="25%">
                                <col width="75%">
                                    <tbody>
                                        <tr>
                                            <td colspan="2"><h2 style="text-align:center"><?php echo $namahalaman;?></h2></td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Tgl. Hasil Musyawarah Diversi</td>
                                        	<td>
												<?php 
													echo $this->tanggalhelper->convertDayDate($jdiversiterakhir->tanggal_musyawarah);
													echo " (Sesuai Tanggal Jadwal Mediasi Terakhir)";
													?>
												<input type="hidden" id="tgl_hsl_musy_diversi" name="tgl_hsl_musy_diversi" value="<?php echo $jdiversiterakhir->tanggal_musyawarah;?>">
                                        	</td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Hasil Musyawarah Diversi<span style="color:red">*</span></td>
                                        	<td>
												<?php 
												if($detail_diversi->kesepakatan_melaksanakan_diversi==2){
													echo $select_hasil_diversi;
													echo "<input type='hidden' name='hasil_diversi' value='0'>";
												}else{ ?>
                                                <span class="custom-dropdown custom-dropdown--emerald">
												<?php
													echo form_dropdown('hasil_diversi', $select_hasil_diversi, $detail_diversi->hasil_diversi,'style="width:300px;height:28px;" class="custom-dropdown__select custom-dropdown__select--white" id="hasil_diversi" '.$disabled); 
												echo "</span>";
												}
												?>
                                        	</td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Isi Hasil Musyawarah Diversi<span style="color:red">*</span></td>
                                        	<td id='isi_hsl_musy_diversi_text' style="width:99%;height:100px">
                                        		<?php echo $this->ckeditor->editor("isi_hsl_musy_diversi",$detail_diversi->isi_singkat_diversi);?>
                                        	</td>
                                        </tr>
                                        <tr>
                                        <td id="first-child">Tanggal Laporan Hakim Fasilitator Kepada Ketua Pengadilan Negeri<span style="color:red">*</span></td>
                                            <td>
                                                <input id="tgl_laporan_hakim" name="tgl_laporan_hakim" value="<?php echo $this->tanggalhelper->convertToInputDate($detail_diversi->tgl_laporan_hakim); ?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun" required/>
                                                	
                                        	</td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" align="center" background="#fff">
                                                <input type="button" id='close_form_diversi' value="Kembali" class="btn">
												<?php
												if($detail_diversi->hasil_diversi!=NULL || $detail_diversi->hasil_diversi!=''){
												?>
												<input type="button" id="hapus" value="Hapus" style="text-decoration:none" class="btn btn-danger">
												<?php }?>
                                                <input id="simpan" class="btn" type="submit" value="Simpan">
                                            </td>
                                        </tr>
                                    </tbody>
                        	</table>
                            <input type="hidden" id="curr_date" value="<?php echo $current_date;?>">
                            <input type="hidden" id='enc' name='enc' value='<?php echo $enc;?>' >
							<input type="hidden" id='encdiversi' name='encdiversi' value='<?php echo $encdiversi;?>' >
							<input type="hidden" id='code' name='code' value='2' >
							<input type="hidden" id='namahalaman' name='namahalaman' value="<?php echo $namahalaman;?>" >
							<input type="hidden" id='isihslmusy' name='isihslmusy' value="<?php echo $isihslmusy;?>" >
							<input type="hidden" id='isihslmusydb' name='isihslmusydb' value="<?php echo $detail_diversi->isi_singkat_diversi;?>" >
                        </form>
                </div>
                </div>
        </div>
</div>
<script type="text/javascript">
/*$('#close_form_diversi').closingFormWin();*/
$('#close_form_diversi').click(function(){
    window.open("<?php echo base_url('perkara_detil/'.$enc.'/3');?>","_self");    
});	
$('#hapus').ButtonClickHandling({
    refresh:1,
    setRefresh:1,
    clicked:1,
    btnClicked:'#close_form_diversi',
    whenStatus:1,
    actions:'<?php echo base_url();?>tab_diversi_c/hapus_datapart_diversi',
    formName:'#frm_diversi_edit',
    actionName:'Hapus Data'
});

    $('#hasil_diversi').change(function(){
		if($(this).val()==1 && $('#isihslmusydb').val()==''){
			CKEDITOR.instances['isi_hsl_musy_diversi'].setData($('#isihslmusy').val());
		}
    });

    $('#frm_diversi_edit').SubmitHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_form_diversi',
        whenStatus:1, 
		next_step:1,
        isCKEdit:1, 
        tdID:'isi_hsl_musy_diversi_text', 
        textID: 'isi_hsl_musy_diversi'
    });

    $('#tgl_laporan_hakim').datepicker({
        beforeShowDay: $.datepicker.noWeekends,
        inline: true,
        showOtherMonths: true,
        dateFormat: 'dd/mm/yy',
        dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
        onSelect: function(dateText, inst) {
            var error = 0;
            var tmp = $(this).val().split("/");
            var tmp2 = $('#curr_date').val().split("/");
            var tmp3 = $('#tgl_hsl_musy_diversi').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((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() < new Date(tmp3[0]+"-"+tmp3[1]+"-"+tmp3[2]+"T00:00:00").getTime())){
                message = 'Tidak Dapat Memilih Kurang Dari Tanggal Hasil Musyawarah Diversi';
                error = 1;
            };
			
            if(error==1){
                message_error_show(message);
                $(this).css("background-color", "red");
            }else{
                $(this).css("background-color", "#dedbdb");
            }
            error = 0;
        }
    });   
    $('.datepicker').ValidateDateInput();
</script>