<script type="text/javascript">	
$(document).ready(function() {
	$("#tabs").tabs({selected:0});
	$("#form").load('modul/karyawan/form.php');
	$("#tampil_data").load('modul/karyawan/tampil_data.php');
	$("#tampil_datadok").load('modul/karyawan/tampil_datadok.php');
	
	$("#txt_cari").keyup(function() {
		var cari 	= $("#txt_cari").val()
		var akses	= 1;
		$.ajax({
			type	: "GET",
			url	: "modul/karyawan/tampil_data.php",
			data	: "cari="+cari,
			timeout	: 2000,
			beforeSend	: function(){		
				$("#tampil_data").html("<img src='loading.gif' />");			
			},				  
			success	: function(data){
				$("#tampil_data").html(data);
			}
		});
	});
	
	$("#txt_caridok").keyup(function() {
		var cari 	= $("#txt_caridok").val()
		var akses	= 1;
		$.ajax({
			type	: "GET",
			url	: "modul/karyawan/tampil_datadok.php",
			data	: "cari="+cari,
			timeout	: 2000,
			beforeSend	: function(){		
				$("#tampil_datadok").html("<img src='loading.gif' />");			
			},				  
			success	: function(data){
				$("#tampil_datadok").html(data);				
			}
		});
	});
	
	$("#cetak_kar").click(function() {
		var cari 	= $("#txt_cari").val()		
		window.location.href='modul/laporan/daftar_kar.php?cari='+cari;
	});
	
	$("#cetak_dokkar").click(function() {
		var cari 	= $("#txt_cari").val()		
		window.location.href='modul/laporan/daftar_dokkar.php?cari='+cari;
	});
	
	$("#keluar").click(function(){
		document.location='?module=home';
	});
	
	$("#close").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='#form'>INPUT KARYAWAN</a></li>
	       <li><a href='#data'>DAFTAR KARYAWAN</a></li>		   
      </ul>";
	echo "<div id='form'></div>";
	echo "<div id='data'>
			<div id='pencarian'>
			<fieldset>
			<legend>Filter Data</legend>
			<table width='100%'>
				<tr>
					<td>Cari Kata : <input type='text' name='txt_cari' id='txt_cari' size='40'></td>
					<td align='right'>
						<button align='right' name='cari_tgl' id='cetak_kar'>Cetak Laporan</button>
						<button align='right' name='keluar' id='keluar'>Tutup</button>
					</td>
				</tr>
			</table>
			</fieldset>
			</div><br>
			<div id='tampil_data' align='center'></div>
	</div>";
	echo "<div id='info' align='center'></div>";
echo "</div>";
?>
