<div class="centering" style="width:500px;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_add_ijin_cerai" method="post" action="<?php echo base_url().'add_ijin_cerai_c/validateInputAddIjinCerai';?>">
				<table id="tableDetilPerkara" style="font-size:14px;">
                		<col width="45%">
                        <col width="55%">
                        <tbody>
                            <tr>
                                <td colspan="2" style="background:white;border:0px;font-size: 20px;color: #648C03;" align="center">TAMBAH/EDIT DATA IZIN CERAI</td>
                            </tr>
                            <tr>
                                <td id="first-child">Nama Pemohon/Penggugat</td>
                                <td>
                                    <span>
                                        <?php echo $pihak1_text; ?>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Status Surat</td>
                                <td>
                                    <span class="custom-dropdown custom-dropdown--emerald" style='width:250px;'>
                                        <select name="status_id" id="status_id" style='width:250px;' class="custom-dropdown__select custom-dropdown__select--white">
                                            <option value=0 <?php echo $status_id==0?"selected":""; ?>>Tidak Ada Izin</option>
                                            <option value=1 <?php echo $status_id==1?"selected":""; ?>>Ada Izin</option>
                                        </select>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Tanggal Surat</td>
                                <td>
                                    <span>
                                        <input  id="tgl_surat" name="tgl_surat" value="<?php echo $this->tanggalhelper->convertToInputDate($tgl_surat);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Nomor Surat</td>
                                <td>
                                    <span>
                                        <input class="standard-input" type="text" id="nomor_surat" name="nomor_surat" value="<?php echo $nomor_surat; ?>" maxlength="30">
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Pejabat Pembuat Surat</td>
                                <td>
                                    <span>
                                        <input class="standard-input" type="text" id="nama_pejabat" name="nama_pejabat" value="<?php echo $nama_pejabat; ?>" maxlength="50">
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td id="first-child">Jabatan Pejabat Pembuat Surat</td>
                                <td>
                                    <span>
                                        <input class="standard-input" type="text" id="jabatan" name="jabatan" value="<?php echo $jabatan; ?>" maxlength="50">
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="background:white;" align="center">
                                    <input type="hidden" id="act" name="act" value="<?php echo $act;?>">
                                    <input type="hidden" id="enc" name="enc" value="<?php echo $enc;?>">
                                    <input type="hidden" id="pihak" name="pihak" value="<?php echo $pihak;?>">
                                    <input type="hidden" id="curr_date" value="<?php echo $today;?>">
                                    
                                    <input type="button" id='close_form_add_ijin_cerai' value="Kembali" class="btn close_form_add_arsip">
                                    <input id="simpan" class="btn" type="submit" value="Simpan">
                                </td>
                            </tr>
                        </tbody>
                	</table>               	
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#frm_add_ijin_cerai').SubmitHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_form_add_ijin_cerai',
        whenStatus:1
    });
    $('#close_form_add_ijin_cerai').closingFormWin();

$('#tgl_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 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;
    }
});
</script>
