<script type="text/javascript">	
$(document).ready(function() {	
	$("#tabs").tabs({selected:0});	
	
	cari_tgl();
	
	function cari_tgl(){
		var no = 1;
		$.ajax({
			type	: "POST",
			url	    : "modul/report/cari_tanggal.php",
			data	: "no="+no,
			dataType: "json",
			success	: function(data){
				$("#t_tglawal").val(data.tanggal);
				$("#t_tglakhir").val(data.tanggal);
			}
		});
	}
	
	$("#cari_rmb").click(function(){
		var tgl_awal	= $("#t_tglawal").val();
		var tgl_akhir 	= $("#t_tglakhir").val();
		var gdasl  		= $("#t_gdasl").val();
		var cari   		= $("#txt_carist").val();

		$.ajax({
			type	: "GET",
			url		: "md_kpt/retur_mbr/tampil_daftar.php",
			data	: "cari="+cari+
				"&gdasl="+gdasl+
				"&tgl_awal="+tgl_awal+
				"&tgl_akhir="+tgl_akhir,
			success	: function(data){
				$("#tampil_data").html(data);
			}
		});
	});
	
	$("#txt_carist").keyup(function(){
		var tgl_awal= $("#t_tglawal").val();
		var tgl_akhir= $("#t_tglakhir").val();
		var gdasl  	= $("#t_gdasl").val();
		var cari   	= $("#txt_carist").val();
		
		$.ajax({
			type	: "GET",
			url		: "md_kpt/retur_mbr/tampil_daftar.php",
			data	: "cari="+cari+
				"&gdasl="+gdasl+
				"&tgl_awal="+tgl_awal+
				"&tgl_akhir="+tgl_akhir,
			success	: function(data){
				$("#tampil_data").html(data);
			}
		});
	});
	
	$("#tutup").click(function(){
		document.location='?module=home';
	});
});
</script>

<style type="text/css">
#info {
	font-size:12px;
	font-weight:bold;
	color:#F00;
}
</style>

<?php
echo "<div id='tabs'>";
echo "<ul >
	    <li><a href='#data'>DAFTAR PENGEMBALIAN BARANG</a></li>
    </ul>";
	  
    echo "<div id='data'>
        <div id='pencarian'>
			<table width='100%'>
				<tr>
					<td>Pemindahan tanggal : <input type='date' id='t_tglawal' size='10'> Sampai dengan <input type='date' id='t_tglakhir' size='10'></td>
					<td>Cari barang : <input type='text' id='txt_carist' size='30'></td>
				</tr>
			</table>
			<table width='100%'>
				<tr>
					<td align='center'>
						<button id='cari_rmb'>Cari</button>
						<button id='tutup'>Tutup</button>
					</td>
				</tr>
			</table>
		</div>
		<div id='tampil_data' align='center'></div>
    </div>";
    
echo "<div id='info' align='center'></div>";
echo "</div>";
?>
