<div class="centering" style="width:65%;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_penetapankesepakatan_edit" style="background:white;margin:0;" method="post" action="<?php echo base_url().'tab_diversi_c/validate_edit_penetapan_kesepakatan_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">Tanggal Penetapan Kesepakatan Diversi<span style="color:red">*</span></td>
                                            <td>
                                                <input id="tgl_penetapan_kesepakatan" name="tgl_penetapan_kesepakatan" value="<?php echo $this->tanggalhelper->convertToInputDate($detail_diversi->tgl_penetapan_kesepakatan_diversi); ?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun" required/>
                                                	
                                        	</td>
                                        </tr>
                                        <td id="first-child">Status Barang Bukti Jika Kesepakatan Diversi Telah Dilaksanakan Sepenuhnya<span style="color:red">*</span></td>
                                            <td>
												<table class="cssTable">
													<tr>
														<td>No</td><td>Jenis Dan Uraian Lengkap Barang Bukti</td><td>Status Yang Harus Dilakukan</td>
													</tr>
												<?php
												$i=1;
												foreach($detail_bb->result() as $row){
													echo "<tr>";
													echo "<td>".$i."</td><td>".$row->jenis_barang_bukti."</td>";
													echo "<td><input type='text' style='color:black' class='standard-input' name='tindakan$row->id' value='".$row->tindakan_utk_pen_kesepakatan_diversi."' required></td>";
													echo "</tr>";
													$i++;
												}
												?>
												</table>
                                        	</td>
                                        </tr>
                                        <td id="first-child">Tanggal Mulai Pelaksanaan Kesepakatan Diversi<span style="color:red">*</span></td>
                                            <td>
                                                <input id="tgl_mulai_pelaksanaan" name="tgl_mulai_pelaksanaan" value="<?php echo $this->tanggalhelper->convertToInputDate($detail_diversi->tgl_pelaksanaan_isi_diversi); ?>" 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->tgl_penetapan_kesepakatan_diversi!=NULL){
												?>
												<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='namahalaman' name='namahalaman' value="<?php echo $namahalaman;?>" >
							<input type="hidden" id='code' name='code' value='3' >
							<input type="hidden" id='tgl_lap_hkm' name='tgl_lap_hkm' value='<?php echo $detail_diversi->tgl_laporan_hakim;?>' >
                        </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_penetapankesepakatan_edit',
    actionName:'Hapus Data'
});
    $('#frm_penetapankesepakatan_edit').SubmitHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_form_diversi',
        whenStatus:1,
		next_step:1
    });

    $('#tgl_penetapan_kesepakatan').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_lap_hkm).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 Sebelum Tanggal Laporan Hakim Fasilitator Kepada Ketua Pengadilan Negeri.';
                error = 1
            }
            if(error==1){
                message_error_show(message);
                $(this).css("background-color", "red");
            }else{
                $(this).css("background-color", "#dedbdb");
            }
            error = 0;
        }
    });   
    $('#tgl_mulai_pelaksanaan').datepicker({
        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 = $('#tgl_penetapan_kesepakatan').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 Kurang Dari Tanggal Penetapan Kesepakatan 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>