<hr class="thick-line" style="clear:both;">
<div style="padding:20px;"></div>
	<div class="detil" style="font-size:14px;margin-top:25px;width:540px;margin: 0 auto;border-color: #FFFFFF">
		<form id="frm_add_bb" style="background:white;margin:0;border:1px solid #ddd;padding:10px 0px 10px 20px" method="post" action="<?php echo base_url().'add_barang_bukti/validateInput';?>">
			<table id="tableDetilPerkara" style="font-size:14px;;">
				<col width="40%">
				<col width="50%">
				<tbody>
					<tr><th colspan="2">TAMBAH BARANG BUKTI<br><br></th></tr>
					<tr><td colspan="2"><span style="color:white;font-weight:bold">Penerimaan Barang Bukti Oleh Pengadilan</span></b></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="" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
						</td>
					</tr>
					<tr hidden>
						<td>
							<input type="text" id="enc" name="enc" class="standard-input" maxlength="150"></tr>
						</td>
					<tr>
						<td>Nomor Perkara<font color="red">*</font></td>
						<td>
						<input type="text" id='nomor_perkara' name='nomor_perkara' placeholder="contoh : 123/pid.b/2013/PN ABC" class="standard-input" maxlength="150">
						<input type="button" id = "cari_perkara" value="Cari" style="padding: 4px 0;color:white;background: #7f8c8d;border: 0 none;  border-radius: 0 0 0 0;width: 50px;">
						</td>
					</tr>
					<tr>
						<td>Jenis Perkara<font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;" >
						<input type="text" id='jenis_perkara' name='jenis_perkara' style="width:300px;" placeholder="Klik Tombol Cari" class="standard-input" readonly="readonly">
						</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"></textarea><td>
					</tr>
					<tr>
						<td >Tempat Penyimpanan</td>
						<td><input type="text" id='tempat_penyimpanan' name='tempat_penyimpanan' value="" 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="" 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="" class="standard-input" maxlength="50"  style="width:300px;"></td>
					</tr>	
					<tr><td colspan="2"><span style="color:white;font-weight:bold">Penyerahan Kembali Barang Bukti</span></td></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=" " class="datepicker" maxlength="10">
						</td>
					</tr>				
					<tr>
						<td >Catatan </td>
						<td><input type="text" id='catatan' name='catatan' value="" class="standard-input" maxlength="50"  style="width:300px;"></td>
					</tr>
					<tr>
						<td colspan="3" style="background:white;" align="center">
							<input id="kembalibb" type="button" onClick='kembali();' value="Kembali" class="btn">
							<input type="submit" id="simpan" value="Simpan" class="btn">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
<script src="<?php echo base_url();?>resources/js/autoNumeric.js"></script>
<script type="text/javascript">

$( document ).ready(function() {
	$('#simpan').hide();
    $( function() {
        $('#tgl_terima').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            //onSelect: function(dateText, inst) {
        	//}
        });
        $('#tanggal_penyerahan').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            //onSelect: function(dateText, inst) {
        	//}
        });       
    });
    $('input,select').not('#simpan').keypress(function(event) { return event.keyCode != 13; });  
});
$('#tgl_terima').ValidateDateInput();
$('#tanggal_penyerahan').ValidateDateInput();
function kembali(){
	window.open("<?php echo $previous;?>","_self");
}

/*
$('#frm_add_bb').on('click', '#simpan', function(event) {
	var enc=$('#enc').val();
	var nomor_perkara=$('#nomor_perkara').val();
	var jenis_bb=$('#jenis_bb').val();
	var penerimaan_bb=$('#penerimaan_bb').val();
	var tgl_terima=$('#tgl_terima').val();
	var tempat_penyimpanan=$('#tempat_penyimpanan').val();
	var tempat_penyerahan=$('#tempat_penyerahan').val();
	var nama_penerima=$('#nama_penerima').val();
	var catatan=$('#catatan').val();
	if(nomor_perkara=='' || jenis_bb=='' || penerimaan_bb =='' || tgl_terima ==''){
		message_error_show_parent('Data belum diisi dengen benar !!');
		$(this).css("background-color", "red");
		event.preventDefault();
		return;
	}
});
*/

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


$("#cari_perkara").click(function() {
	var val=$('#nomor_perkara').val();
	openLoadingDialog()
	$.post('<?php echo base_url()?>add_barang_bukti/fetchData', {
		val
	}, function(response){
		var json = jQuery.parseJSON(response);
		closeLoading()
		if(json.st==1){
			$('#enc').val(json.enc);
			$('#jenis_perkara').val(json.perkara_nama);
			$('#jenis_bb').focus();
			$('#simpan').show();
		}else if(json.st==0){
			$('#simpan').hide();
			message_error_show_parent(json.msg);
			return
		}
	});
});
</script>