<div class="centering" style="width:540px;margin-top: 1%;">
    <div id='memori' style="border: 1px solid #ffffff;">
        <div class="detil" style="padding: 2px;background-color: white;">
            <form id="frm_memori" method="post" action="<?php echo base_url().'tab_keberatan_c/validateInputMemoriKeberatan';?>">
            <table id="tableDetilPerkara" style="font-size:14px;">
                <col width="50%">
                <col width="60%">
                    <tbody>
                        <tr>
                            <td colspan="2" style="background:white;border:0px;font-size: 20px;color: #648C03;" align="center">PROSES PERMOHONAN KEBERATAN</td>
                        </tr>
                        <tr>
                        	<td id="first-child">Nomor Perkara</td>
                        	<td>
                        		<span><?php echo $nomor_perkara;?></span>
                                <input type='hidden' name='nomor_perkara' value='<?php echo $nomor_perkara;?>'>
                                <input type='hidden' name='enc' value='<?php echo $enc;?>'>
                            </td>
                        </tr>
                        <tr>
                        	<td id="first-child">Tanggal Putusan</td>
                        	<td>
                        		<span><?php echo $this->tanggalhelper->convertDayDate($tanggal_putusan);?></span>
                            </td>
                        </tr>
                        <tr>
                        	<td id="first-child">Tanggal Pendaftaran Keberatan</td>
                        	<td>
                                <span><?php echo $this->tanggalhelper->convertDayDate($tanggal_pendaftaran_keberatan);?></span>
                        	</td>
                        </tr>
                        <tr>
                            <td id="first-child">Tanggal Penerimaan Memori</td>
                            <td>
                                <input id="tgl_penerimaan_memori" name="tgl_penerimaan_memori" value="<?php echo $this->tanggalhelper->convertToInputDate($penerimaan_memori);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                            </td>
                        </tr>
                        <tr>
                            <td id="first-child">Tanggal Penyerahan Memori</td>
                            <td>
                                <input id="tgl_penyerahan_memori" name="tgl_penyerahan_memori" value="<?php echo $this->tanggalhelper->convertToInputDate($penyerahan_memori);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                            </td>
                        </tr>
                            <td id="first-child">Tanggal Penerimaan Kontra Memori</td>
                            <td>
                                <input id="tgl_penerimaan_kontra_memori" name="tgl_penerimaan_kontra_memori" value="<?php echo $this->tanggalhelper->convertToInputDate($penerimaan_kontra_memori);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                            </td>
                        </tr>
                        <tr>
                            <td id="first-child">Tanggal Penyerahan Kontra Memori</td>
                            <td>
                                <input id="tgl_penyerahan_kontra_memori" name="tgl_penyerahan_kontra_memori" value="<?php echo $this->tanggalhelper->convertToInputDate($penyerahan_kontra_memori);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                            </td>
                        </tr>
                        <tr>
							<td colspan="2" style="background:white;padding:2px;">
								<input type="hidden" id="enc" name="enc" value="<?php echo $enc;?>">
                                <input type="hidden" id="curr_date" value="<?php echo $current_date;?>">
							</td>
						</tr>
                    	<tr>
							<td colspan="2" style="background:white;" align="center">
								<input type="button" id='close_form_add_keberatan' value="Kembali" class="btn">
                                <?php
                                if(!empty($penerimaan_memori)){
                                    echo '<input type="submit" id="hapus" value="Hapus" class="btn btn-danger" onclick="return false;">';
                                }
                                ?>
								<input id="simpan" class="btn" type="submit" value="Simpan">
							</td>
						</tr>
                    </tbody>
            </table>
        </form>
        </div>
    </div>
</div>

<script type="text/javascript">
    $('#frm_memori').SubmitHandling({
		refresh:'1',
		setRefresh:1,
		divRef:'#konten',
		clicked:1,
		btnClicked:'#close_form_add_keberatan',
		whenStatus:1

    });
    $('#hapus').ButtonClickHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_form_add_keberatan',
        whenStatus:1,
        actions:'<?php echo base_url("tab_keberatan_c/validateDeleteProsesKeberatan");?>',
        formName:'#frm_memori',
        actionName:'Hapus Data Proses Keberatan'
    });
    // $('#close_form_add_keberatan').closingFormWin();   
    <?php 
    if($this->session->userdata('jenis_pengadilan')==1){
    ?>
        $('#close_form_add_keberatan').click(function(){
            window.open("<?php echo base_url('perkara_detil/'.$enc.'/19');?>","_self");    
        });    
    <?php
    }else if($this->session->userdata('jenis_pengadilan')==4){
    ?>
        $('#close_form_add_keberatan').click(function(){
            window.open("<?php echo base_url('perkara_detil_agama/'.$enc.'/19');?>","_self");    
        });        
    <?php
    }else{
    ?>
        $('#close_form_add_keberatan').closingFormWin();
    <?php
    }
    ?>
    $('#tgl_penerimaan_memori').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("/");
            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_penyerahan_memori').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("/");
            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_penerimaan_kontra_memori').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("/");
            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_penyerahan_kontra_memori').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("/");
            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;
        }
    });
    $('#inzage_pihak1').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("/");
            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;
        }
    });
    $('#inzage_pihak2').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("/");
            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;
        }
    });
    $('.datepicker').ValidateDateInput();
$( function() {$('.tr_new_pen').hide();});
</script>