<div style="padding:10px;"></div>
<div class="detil" style="padding: 4px;font-size:14px;margin-top:25px;width: 45%;margin: 0 auto;border-color: #FFFFFF;">
	<form id="frm_putusan" style="padding: 4px;background:white;margin:0;" method="post" action="<?php echo base_url().'saveputusanbanding';?>">
		<table id="tableDetilPerkara" style="font-size:14px;">
			<col width="50%">
			<col width="50%">
			<tbody>	
				<tr id="tr_pihak">
					<td colspan="2" class="divider">Edit - Penerimaan Berkas Banding</td>
				</tr>
				<tr>
					<td>Nomor Perkara</td>
					<td style="padding:0px;padding-left:5px;"><?php echo (!empty($noperkarapn) ? $noperkarapn : '');?></td>
				</tr>
				<tr>
					<td>Tanggal Permohonan</td>
					<td style="padding:0px;padding-left:5px;"><?php echo (!empty($tglpermohonan) ? $tglpermohonan : '');?></td>
				</tr>
				<tr id="tr_pihak">
					<input type="hidden" id="date_put" value="<?php echo (!empty($tglputusan))? $tglputusan:'';?>">
					<input type="hidden" id="enc" name="enc" value="<?php echo (!empty($idperkara))? $idperkara:'';?>">
				</tr>
				<tr>
					<td>Tanggal Putusan Banding<font color="red">*</font></td>					
					<td style="padding:0px;padding-left:5px;"><?php echo $tanggal_pts_banding;?></td>
				</tr>
				<tr>
					<td>Nomor Putusan Banding<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;"><?php echo $input_area;?>							
						<input type="hidden" id="curr_date" value="<?php echo $current_date;?>">
						<input type="hidden" name="jenis_form" value="<?php echo $jenis_form;?>">
						<input type="hidden" name="tgl_pts_banding" value="<?php echo $tgl_pts_banding;?>">
					</td>
				</tr>				
				<tr>
					<td id="first-child">Tanggal Pengarsipan Berkas Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tgl_arsip" name="tgl_arsip" value="<?php echo (!empty($tgl_arsip) ? $tgl_arsip : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>
				<tr>
					<td id="first-child">Tanggal Penerimaan Kembali Berkas Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tgl_berkas" name="tgl_berkas" value="<?php echo (!empty($tgl_berkas) ? $tgl_berkas : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>
				<tr>
					<td colspan="2" style="background:white;" align="center">
						<input type="button" value="Kembali" id="kembali" class="btn">
						<?php
						if (!empty($statusputusan)) 
						{ 
							echo '<input type="button" id="hapus" value="Hapus" style="text-decoration:none" class="btn btn-danger">';
						}	
						?>
						<input type="submit" id="simpan" value="Simpan" class="btn">
					</td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
<div style="padding:10px;"></div>
<script type="text/javascript">
$('#kembali').closingFormWin();
$('#frm_putusan').SubmitHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'.close_form',
	whenStatus:1	
});
$('#hapus').ButtonClickHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'.close_form',
	whenStatus:1,
	actions:'<?php echo base_url()?>detil_banding/hapus_putusan_banding/',
	formName:'#frm_putusan',
	actionName:'Hapus Data'
});
$( document ).ready(function() {
	$('.datepicker').ValidateDateInput();
    $( function() {        
		$('#tgl_arsip').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 date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				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();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
		$('#tgl_berkas').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 date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				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();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
    });
});
</script>
