<div class="centering" style="width:600px;margin-top: 5%;">
    <div id='pemberitahuan_gugur' style="border: 1px solid #ffffff;">
    	<div class="detil" style="padding: 2px;background-color: white;">
            <table id='infoPerkara' style="font-size:14px;width:100%;">
                <col width="42%">
                <col width="58%">
                <tbody>
                    <tr>
                        <td colspan="2" style="background:white;border:0px;font-size: 20px;color: #648C03;" align="center">PEMBERITAHUAN PENETAPAN DISMISSAL</td>
                    </tr>
                </tbody>
            </table>
            <table id='infoPerkara' style="font-size:14px;width:100%;">
                <col width="42%">
                <col width="58%">
                <tbody>
                    <tr>
                        <td id="first-child">Nomor Perkara</td>
                        <td style="padding:0px;padding-left:5px;"><?php echo $nomor_perkara;?></td>
                    </tr>
                    <tr>
                        <td id="first-child">Tanggal Pendaftaran</td>
                        <td style="padding:0px;padding-left:5px;"><?php echo $this->tanggalhelper->convertDayDate($tanggal_pendaftaran); ?></td>
                    </tr>
                    <tr>
                        <td id="first-child">Tanggal Penetapan Dismissal</td>
                        <td style="padding:0px;padding-left:5px;"><?php echo $this->tanggalhelper->convertDayDate($tgl_dismissal); ?></td>
                    </tr>
                </tbody>
            </table>
            <form id="frm_pemberitahuan" method="post" action="<?php echo base_url().'dismissal_c/validatePemberitahuanInputTun';?>">
    			<table id='infoPerkara' style="font-size:14px;width:100%;">
    				<col width="42%">
                    <col width="58%">
                        <tbody> 
                            <tr>
                                <td colspan="2" style="background-color:#A3DBA8;padding:5px;"></td>
                            </tr>                       
                            <tr>
                                <td id="first-child">Pemberitahuan Kepada Penggugat</td>
                                <td style="padding:0px;padding-left:5px;">
                                    <input id="tgl_beritahuP" name="tgl_beritahuP" value="<?php echo (!empty($pemberitahuan_penggugat) ? $this->tanggalhelper->convertToInputDate($pemberitahuan_penggugat) : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Pemberitahuan Kepada Tergugat</td>
                                <td style="padding:0px;padding-left:5px;">
                                    <input id="tgl_beritahuT" name="tgl_beritahuT" value="<?php echo (!empty($pemberitahuan_tergugat) ? $this->tanggalhelper->convertToInputDate($pemberitahuan_tergugat) : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr>
                            <?php if($ada_perlawanan==0){ ?>
                            <tr>
                                <td id="first-child">Tanggal Minutasi</td>
                                <td style="padding:0px;padding-left:5px;">
                                    <input id="tgl_minut" name="tgl_minut" value="<?php echo (!empty($tgl_minutasi) ? $this->tanggalhelper->convertToInputDate($tgl_minutasi) : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr> 
                            <?php } ?>
                            <tr>
                                <td colspan="2" style="background:white;" align="center">
                                <input type="hidden" id="enc" name="enc" value="<?php echo $enc; ?>">
                                <input type="hidden" id="curr_date" name="curr_date" value="<?php echo $tgl_sekarang;?>">
                                <input type="button" id='close_form_penetapan' value="Batal" class="btn">
                                <input type="submit" id="simpan_btn" value="Simpan" class="btn">
                            </td>
                            </tr>

                        </tbody>
    			</table>
                <div style="padding:3px;"></div>
    		</form>
    	</div>
    </div>
</div>
<script type="text/javascript">

$('#tgl_beritahuP').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 date = $(this).datepicker('getDate');
                var dayOfWeek = weekday[date.getDay()];
                var message ='';
                if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
                    message ='Tidak Dapat Memilih diluar Hari Kerja.';
                    error = 1;
                }
                
                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
                }

                if(error==1){
                    message_error_show(message);
                    $(this).css("background-color", "red");
                }else{
                    $(this).css("background-color", "#dedbdb");
                }
                error = 0;
            }
        });
$('#tgl_beritahuT').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 date = $(this).datepicker('getDate');
                var dayOfWeek = weekday[date.getDay()];
                var message ='';
                if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
                    message ='Tidak Dapat Memilih diluar Hari Kerja.';
                    error = 1;
                }
                
                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
                }

                if(error==1){
                    message_error_show(message);
                    $(this).css("background-color", "red");
                }else{
                    $(this).css("background-color", "#dedbdb");
                }
                error = 0;
            }
        });
$('#tgl_minut').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 date = $(this).datepicker('getDate');
                var dayOfWeek = weekday[date.getDay()];
                var message ='';
                if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
                    message ='Tidak Dapat Memilih diluar Hari Kerja.';
                    error = 1;
                }
                
                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
                }

                if(error==1){
                    message_error_show(message);
                    $(this).css("background-color", "red");
                }else{
                    $(this).css("background-color", "#dedbdb");
                }
                error = 0;
            }
        });

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

// $('#close_form_penetapan').closingFormWin();
$('#close_form_penetapan').click(function(){
    window.open("<?php echo base_url('perkara_detil_tun/'.$enc.'/20');?>","_self");    
});
$('.datepicker').ValidateDateInput();

</script>