<div class="centering" style="width:600px;margin-top: 1%;">
    <div id='form_verzet' style="border: 1px solid #ffffff;">
		<div class="detil" style="padding: 2px;background-color: white;">
            <div>
                <form id="frm_upload_pengantar" method="post" action="<?php echo base_url().'simpankatapengantar'?>">
				    <table id="tableDetilPerkara" style="font-size:14px;">
                		<col width="45%">
                        <col width="55%">
                        <tbody>
                            <tr id="tr_pihak">
							 <td colspan="2" class="divider">Edit Surat Pengantar</td>
							</tr>
                            <tr>
                                <td id="first-child">Tanggal surat pengantar</td>
                                <td>
                                    <input type="hidden" name="ref_pengantar" value="<?php echo $ref_pengantar->dokumen_ref_id; ?>"> 
				                    <input type="hidden" name="upaya_id" value="<?php echo $upaya_id; ?>">                                      
				                    <input id="tanggal_surat" name="tanggal_surat" value="<?php echo $this->tanggalhelper->convertToInputDate($tanggal_masuk_arsip);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr>							
							<tr>
                                <td id="first-child">Nomor Surat Pengantar</td>
                                <td>
                                    <input type="text" id="nomor_surat" name="nomor_surat" value="" class="standard-input"maxlength="50">
                                </td>
                            </tr>                            
                            <tr>
                                <td id="first-child">Nomor resi PT.Pos</td>
                                <td>
                                    <input class="standard-input" id="nomer_resi" name="nomer_resi" value="<?php echo $nama_penyerah;?>" maxlength="50">
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">File surat pengantar<br></td>           
                                <td style="padding:0px;padding-left:5px;">
                                    <input type="file" accept='application/pdf' id='edoc_pengantar' name='edoc_pengantar' class="standard-input" maxlength="150" style="width:400px;">
                                 </td>
                            </tr>                            
                            <tr>
                                <td colspan="2" style="background:white;" align="center">
                                    <input type="button" id='close_form_pengantar' value="Kembali" class="btn close_form_add_arsip">
                                    <input id="simpan" class="btn" type="submit" value="Simpan">
                                    <input type="hidden" id="curr_date" name="curr_date" value="<?php echo $current_date; ?>">
                                </td>
                            </tr>
                        </tbody>
                	</table>               	
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
$( document ).ready(function() {
 $('#frm_upload_pengantar').SubmitHandling({
        refresh:1,
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'.close_form',
        whenStatus:1,
        upload:1,
        urlUpload:"<?php echo base_url('upload_dirput/upload_pengantar');?>"
    });
    $('#close_form_pengantar').closingFormWin();
    $('.close_form_pengantar').click(function(event){
        if($('#refresh').val()==1){
            refreshPage();
        }
    });
	
	$('.datepicker').ValidateDateInput();
    $( function() {
        $('#tanggal_surat').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>