<div class="centering" style="width:612px;margin-top: 1%;z-index:-100">
    <div id='frm_barang_bukti' style="border: 1px solid #ffffff;">
        <div class="detil" style="padding: 2px;background-color: white;">
            <div style="font-size:14px;">
                <?php if($act=='tambah'){ ?>
                <form id="frm_input_bb" class="removeformbottomspace" method="post" action="<?php echo base_url().'add_barang_bukti/validateInput';?>">
                <?php }elseif($act=='edit'){ ?>
                <form id="frm_input_bb" class="removeformbottomspace" method="post" action="<?php echo base_url().'add_barang_bukti/validateEdit';?>">
                <?php } ?>
                    <table id='tableDetilPerkara' style="font-size:14px; width:100%" border="0">
                        <col width="280px">
                        <col>
                        <tbody>
                            <tr><th colspan="2" style="font-size:16px">TAMBAH/EDIT BARANG BUKTI<br><br></th></tr>
                            <tr><td class="divider" colspan="2">Data Perkara</td></tr>                                                       
                            <tr>
                            	<td >Nomor Perkara</td>
                                <td style="font-weight: bold;"><span><?php print $nomor_perkara;?></span></td>
                            </tr>                    
                            <tr>
                            	<td >Jenis Perkara</td>
                                <td style="font-weight: bold;"><span><?php print $jenis_perkara;?></span></td>
                            </tr>
                            <tr>
                                <td >Tanggal Pendaftaran</td>
                                <td style="font-weight: bold;"><span><?php print $tgl_pendaftaran;?></span></td>
                            </tr>
                            <tr><td class="divider" colspan="2">Penerimaan Barang Bukti Oleh Pengadilan</td></tr> 
                             <tr>
                                <td>Tanggal Terima Dari Penuntut Umum<font color="red">*</font></td>
                                <td style="padding:0px;padding-left:5px;">
                                    <input id="tgl_terima" name="tgl_terima" value="<?php echo $tgl_terima; ?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr>                   
                            <tr>
                                <td valign="top" style="vertical-align:top;">Jenis dan Uraian lengkap Barang Bukti<font color="red">*</font></td>
                                <td><textarea class="standard-input" id="jenis_bb" name="jenis_bb"  style="height: 50px;resize: none;width:300px"><?php echo $jenis_bb; ?></textarea><td>
                            </tr>
                            <tr>
                                <td >Tempat Penyimpanan</td>
                                <td><input type="text" id='tempat_penyimpanan' name='tempat_penyimpanan' value="<?php echo $tempat_penyimpanan; ?>" class="standard-input" maxlength="50"  style="width:300px;"></td>
                            </tr>
                            <tr>
                                <td >Tempat Penyerahan</td>
                                <td><input type="text" id='tempat_penyerahan' name='tempat_penyerahan' value="<?php echo $tempat_penyerahan; ?>" class="standard-input" maxlength="50"  style="width:300px;"></td>
                            </tr>
                            <tr>
                                <td >Nama Penerima<font color="red">*</font></td>
                                <td><input type="text" id='nama_penerima' name='nama_penerima' value="<?php echo $nama_penerima; ?>" class="standard-input" maxlength="50"  style="width:300px;"></td>
                            </tr>
        				    <tr><td class="divider" colspan="2">Penyerahan Kembali Barang Bukti</tr>
                            <tr>                    
                                <td>Tgl Penyerahan Barang Bukti Setelah Putusan</font></td>
                                    <td style="padding:0px;padding-left:5px;">
                                        <input id="tanggal_penyerahan" name="tanggal_penyerahan" value="<?php echo $tgl_penyerahan; ?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                                </td>
                            </tr>               
                            <tr>
                                <td >Catatan </td>
                                <td><input type="text" id='catatan' name='catatan' value="<?php echo $catatan; ?>" class="standard-input" maxlength="50"  style="width:300px;"></td>
                            </tr> 
                            <tr>
                            	<td colspan="2" class="buttongroup">
                                    <input type="button" id='close_frm_bb' value="Kembali" class="btn">
                                    <?php
                                    if(!empty($jenis_bb)){
                                        echo '<input type="button" id="hapus" value="Hapus" style="text-decoration:none" class="del_btn">';
                                    }
                                    ?>                                   
                                    <input type="submit" id="simpan" value="Simpan" class="btn">
                                </td>
                            </tr>
                            <input type="hidden" id="nomor_perkara" name="nomor_perkara" value="<?php echo $nomor_perkara;?>" >
                            <input type="hidden" id="curr_date" value="<?php echo $current_date;?>">
                            <input type="hidden" id="refresh" class='detil_perkara_refresh' value="0">
                            <input type="hidden" name='enc' value='<?php echo $enc;?>'>
                            <input type="hidden" name='enc_BB' value='<?php echo $enc_BB;?>'>
                    	</tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">    
    $('#close_frm_bb').closingFormWin();
    $('#frm_input_bb').SubmitHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_frm_bb',
        whenStatus:1
    });
    $('#hapus').ButtonClickHandling({
        refresh:'1',
        setRefresh:1,
        divRef:'#konten',
        clicked:1,
        btnClicked:'#close_frm_bb',
        whenStatus:1,
        actions:'<?php echo base_url()?>add_barang_bukti/hapus_barang_bukti/',
        formName:'#frm_input_bb',
        actionName:'Hapus Data'
    });
       
    $('#tgl_terima').datepicker({
                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;
                        $(this).val('');
    				}
                   
    				if(error==1){
    					message_error_show(message);
    					$(this).css("background-color", "red");
    				}else{
    					$(this).css("background-color", "#dedbdb");
    				}
    				error = 0;
            	}
    });

    $('#tanggal_penyerahan').datepicker({
                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;
                        $(this).val('');
                    }
                   
                    if(error==1){
                        message_error_show(message);
                        $(this).css("background-color", "red");
                    }else{
                        $(this).css("background-color", "#dedbdb");
                    }
                    error = 0;
                }
    });

    $('.datepicker').ValidateDateInput();

   
</script>
