<div class="centering" style="width:1024px;margin-top: 1%;z-index:-100">
<div id='pemeriksaan_persiapan' style="border: 1px solid #ffffff;">
	<div class="detil" style="padding: 2px;background-color: white;">
		<form id="show_pemeriksaan_persiapan" style="background:white;margin:0;" method="post" action="<?php echo base_url().'pemeriksaan_persiapan/validatePemeriksaanEdit';?>">
			<table id="tableDetilPerkara" style="font-size:14px;">
				<col width="40%">
				<col width="60%">
				<tbody>
					<tr>
						<td colspan="2" style='text-align:center;background:#fff;color:#5fb85c;border:2px solid #fff;margin-bottom:10px;font-size: 20px;'>Edit Data Pemeriksaan Persiapan</td>
					</tr>
					<tr>
						<td>Tanggal Penetapan<font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;">							
							<input id="tgl_penetapan" name="tgl_penetapan" value="<?php echo $tanggalPenetapanPemeriksaan; ?>"  class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
						</td>
					</tr>
					<input id="enc" name="enc" type="hidden" value="<?php echo $enc; ?>">
					<tr>
						<td>Petitum</td>
						<td style="background:white;" id="petitum_text">
							<?php echo $this->ckeditor->editor("petitum",$petitum);?>
						</td>
					</tr>
					<input type="hidden" id="curr_date" value="<?php echo $curr_date;?>">
					<tr>
						<td colspan="2" style="background:white;border:0px;" align="center">
							<input type="button" id='close_form_pemeriksaan_persiapan' value="Kembali" class="btn">
							<input type="submit" id="simpan" value="Simpan" class="btn">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</div>
<script type="text/javascript">
$('#close_form_pemeriksaan_persiapan').closingFormWin();
$('#show_pemeriksaan_persiapan').SubmitHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'#close_form_pemeriksaan_persiapan',
	whenStatus:1,
	isCKEdit:1,
	tdID:'petitum_text',
	textID:'petitum'
});

$('#tgl_penetapan').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
		}

		dob = new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00");
		var tglDaftar = new Date($('#tanggalPendaftaran').val());
		var age = Math.floor((tglDaftar-dob) / (365.25 * 24 * 60 * 60 * 1000));
		if(age >1){
			message = 'Tanggal Tidak Valid. Silahkan Periksa Kembali';
			error = 1
		}
		if(error==1){
			message_error_show(message);
			$(this).css("background-color", "red");
		}else{
			$(this).css("background-color", "#dedbdb");
		}
		error = 0;
 	}
});
$('#tgl_sidang_pertama').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 = $('#tgl_penetapan').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 Sebelum Tanggal '+$('#tgl_penetapan').val();
          	error = 1;
            $(this).val('');
      	}
    	if(error==1){
    		message_error_show(message);
    		$(this).css("background-color", "red");
    	}else{
    		$(this).css("background-color", "#dedbdb");
    	}
    	error = 0;
 	}
});

$('.datepicker').ValidateDateInput();
</script>