<script type="text/javascript">	
$(document).ready(function() {
	$("#tabs").tabs({selected:0});
	$("#form").load('spv/users/form.php');
	$("#tampil_data").load('spv/users/tampil_data.php');
	
	$(".cari_level").click(function() {
		var level = $(".cari_level:checked").val();
		
		$.ajax({
			type		: "GET",
			url		: "spv/users/tampil_data.php",
			data	: "level="+level,
			timeout	: 3000,
			beforeSend	: function(){		
				$("#tampil_data").html("<img src='loading.gif' />");			
			},				  
			success	: function(data){
				$("#tampil_data").html(data);
				$("#txt_cari").val('');
			}
		});
	});
});
</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 PENGGUNA</a></li>
	       <li><a href='#data'>DAFTAR PENGGUNA</a></li>
      </ul>";
	echo "<div id='form'></div>";
	
	echo "<div id='data'>
			<div id='pencarian'>
			<fieldset>
			<legend>Filter Data</legend>
			<table>
				<tr>
					<td>Level</td>
					<td>:</td>
					<td><input type='radio' name='cari_txt_level' id='cari_txt_level' value='Direktur' class='cari_level' >Direktur</td>
					<td><input type='radio' name='cari_txt_level' id='cari_txt_level' value='Administrator' class='cari_level' >Administrator</td>
					<td><input type='radio' name='cari_txt_level' id='cari_txt_level' value='All' class='cari_level' >All</td>
				</tr>	
			</table>
			</fieldset>
			</div><br>
			<div id='tampil_data' align='center' style='overflow-x: auto;height: 400px;scroll-behavior: smooth'></div>
	</div>";
	echo "<div id='info' align='center'></div>";
echo "</div>";
?>
