<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");
            }
        );
    });	
});

</script>
<?php
include '../../inc/inc.koneksi.php';

$cari	  = $_GET[cari];
echo "<table id='theList' width='100%'>
		<tr>			
			<th>Kode</th>
			<th>Nama Akun</th>
			<th>Level</th>
			<th>D/K</th>			
		</tr>";
		
		if (!empty($cari)){
			$query1= "SELECT * FROM gol_akun WHERE (nagol LIKE '%$cari%' or nogol LIKE '%$cari%') ORDER BY nogol";
		}
		else{
			$query1= "SELECT * FROM gol_akun ORDER BY nogol";
		}
		$data1	= mysql_query($query1);
		$jml=1;		
		while($r_data1=mysql_fetch_array($data1)){
			$nogol=$r_data1[nogol];

			echo "<tr>				
				<td><b>$r_data1[nogol]</b></td>			
				<td><b>$r_data1[nagol]</b></td>
			</tr>";
			
			$sql	= "SELECT * FROM akun_bb WHERE nogol='$nogol' ORDER BY noakun";
			$query = mysql_query($sql);
					
			while($r_data=mysql_fetch_array($query)){
				
				echo "<tr>					
					<td>$r_data[noakun]</td>
					<td>$r_data[naakun]</td>
					<td align='center'>$r_data[level]</td>
					<td align='center'>$r_data[kode]</td>
				</tr>";							
				$jml++;
			}
		}	
	echo "</table>";

	echo "<table width='100%'>
		<tr>
			<td>Jumlah Data : $jml</td>
		</tr>
		</table>";
?>