<script type="text/javascript">	
$(document).ready(function() {
	$("#cari").click(function() {
		var kode	= $("#t_kodedep").val();
		
		if (kode.length==''){
			alert('Maaf, Silahkan pilih departemen lebih dahulu.');
			$("#kode").focus();
			return false;
		}
		
	   	$.ajax({
			type	: "GET",
			url	: "modul/report/tampil_data_df.php",
			data	: "kode="+kode,
			success	: function(data){
				$("#data").html(data);
			}
		});		
	});
	
	$("#refresh").click(function() {
		window.location.reload();		
	});
	
	$("#cetak").click(function() {
		var kode 	= $("#t_kodedep").val();		
		window.location.href='modul/laporan/daftar_inv.php?kode='+kode;
	});
	
	$("#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 span='12' style='background-color:white'>";
echo "<div id='form' align='center'><h2>DAFTAR INVENTARIS KARYAWAN<h2></div>";
echo "<div id='filter' align='left'>
	<fieldset>
		<legend>Filter Data </legend>
		<table width='100%'>
			<tr>
				<td><select name='t_kodedep' id='t_kodedep' >
					<option value='' selected>-Pilih-</option>";
						$sql	= "SELECT * FROM departemen ";
						$query	= mysql_query($sql);
						while($r=mysql_fetch_array($query)){
							echo "<option value='$r[kode_dep]'>$r[kode_dep] - $r[nama_dep]</option>";
						}
						echo "</select>
				</td>
			
				<td align='center' colspan='7'>
					<button name='cari' id='cari'>CARI DATA</button>
					<button name='refresh' id='refresh'>REFRESH</button>
					<button name='tutup' id='tutup'>TUTUP</button>
				</td>
			</tr>
		</table>
	</fieldset>
	</div><br>";
echo "<div id='data' align='center'></div>";
echo "<div id='tombol' align='center'><button name='cetak' id='cetak'>CETAK</button></div>";
echo "</div>";
?>
