<script type="text/javascript">
$(document).ready(function() {
    $(function() {
        $("#theList tr:even").addClass("stripe1");
        $("#theList tr:odd").addClass("stripe2");

        $("#theList tr").hover(
            function() {
                $(this).toggleClass("highlight");
            },
            function() {
                $(this).toggleClass("highlight");
            }
        );
    });
});	

	function pilih(ID){
		var kode = ID;	
		$.ajax({
			type	: "POST",
			url	: "modul/pener_kas/cari_nokas.php",
			data	: "kode="+kode,
			dataType: "json",
			success	: function(data){
				$("#txt_nokas").val(kode);
				$("#txt_namakas").val(data.nakas);
				$("#form_cari_kas").dialog('close');
				$("#txt_pener").focus();
			}
		});		
	}
</script>

<?php
include '../../inc/inc.koneksi.php';
include '../../inc/fungsi_tanggal.php';

echo "<table id='theList' width='100%'>
		<tr>			
			<th>No. Akun</th>
			<th>Nama Akun</th>
			<th>Level</th>			
			<th>Pilih</th>
		</tr>";
		
		$query = "SELECT noakun,naakun,level FROM akun_bb WHERE noakun BETWEEN '11101' AND '11109' ORDER BY noakun ";
		$sql= mysql_query($query);
						
		while($r_data=mysql_fetch_array($sql)){
			echo "<tr>					
					<td align='center'>$r_data[noakun]</td>					
					<td>$r_data[naakun]</td>
					<td align='center'>$r_data[level]</td>
					<td align='center'><a href='javascript:void(0)' onClick=\"pilih('$r_data[noakun]')\">
						<img src='images/view.png' border='0' id='edit' title='Pilih Akun Kas' width='12' height='12' ></a>
					</td>
				</tr>";			
		}

	echo "</table>";
?>
