<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: #FFFFFF;">
                        <form id="frm_diversi_add" style="background:white;margin:0;" method="post" action="<?php echo base_url().'tab_diversi_c/f_validate_add';?>">
                        	<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">Nomor Perkara</td>
                                        	<td>
                                        	   <?php
                                        		  echo $perkara->nomor_perkara;
                                        		?>
                                        	</td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Anak Berhadapan dengan Hukum<span style="color:red">*</span></td>
                                        	<td>
                                        	   <div class="cssTable">
                                                    <table>
                                                        <col width="5%">
                                                        <col width="45%">
                                                        <col width="40%">
                                                        <col width="10%">
                                                        <tr>
                                        				    <td>No</td>
                                        					<td>Nama ABH</td>
                                        					<td>Orangtua/Wali</td>
                                        					<td>Diversi</td>
                                        				</tr>
                                                        <?php
                                                            $i=1;
                                                            foreach ($detail_terdakwa as $row) {
                                                                echo "<tr>";
                                                                echo "<td>".$i."</td>";
                                                                echo "<td>".$row->nama_anak."</td>";
                                                                echo "<td>".$row->nama_orang_tua."</td>";
                                                                echo "<td width='10%' align='center'>";?>
                                                                    <input type='checkbox' value='<?php echo $row->id;?>' checked 
                                                                    name='pihak_diversi[]' id='pihak_diversi_'<?php echo $i;?> style=";" class="sc-js-input scFormObjectOdd"><?php echo "</td>";
                                                                echo "</tr>";
                                                                $i++;
                                                            }
                                                        ?>
                                        			</table>
                                        		</div>
                                        	</td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Tanggal Penetapan Musyawarah Diversi Pertama<span style="color:red">*</span></td>
                                            <td>
                                               <input id="tgl_penetapan_musyawarah" name="tgl_penetapan_musyawarah" value="<?php echo $this->tanggalhelper->convertToInputDate($detail_diversi->tgl_penetapan_musyawarah); ?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun" required>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td id="first-child">Tanggal Musyawarah Diversi Pertama<span style="color:red">*</span></td>
                                            <td>
                                               <input id="tgl_musyawarah" name="tgl_musyawarah" value="<?php echo $this->tanggalhelper->convertToInputDate($detail_diversi->tgl_musyawarah); ?>" 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">
												<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='namahalaman' name='namahalaman' value="<?php echo $namahalaman;?>" >
							<input type="hidden" id='tglpenhakim' name='tglpenhakim' value='<?php echo $perkara->tglpenhakim;?>' >
                        </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");    
});	

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

    $('#tgl_penetapan_musyawarah').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 = $('#tglpenhakim').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 Penetapan Hakim Fasilitator';
                error = 1
            }

            if(error==1){
                message_error_show(message);
                $(this).css("background-color", "red");
            }else{
                $(this).css("background-color", "#dedbdb");
            }
            error = 0;
        }
    });
    $('#tgl_musyawarah').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_penetapan_musyawarah').val().split("/");            
            if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() < new Date(tmp3[2]+"-"+tmp3[1]+"-"+tmp3[0]+"T00:00:00").getTime())){
                message = 'Tidak Dapat Memilih Kurang Dari Tanggal Penetapan Musyawarah Diversi Pertama';
                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>