<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';
include '../../inc/fungsi_tanggal.php';

echo "<table id='theList' width='100%'>
		<tr>
			<th>No.</th>
			<th>Kode Akun</th>
			<th>Kode BP</th>
			<th>Nama Akun</th>
			<th>Keterangan</th>
			<th>Jumlah</th>
			<th>Posting</th>
		</tr>";
		
		$query1 = "SELECT kode_bk,tanggal,nobank,namabank FROM jurbk WHERE posting='' GROUP BY kode_bk ";
		$data1	= mysql_query($query1);
		
		$tjumlah=0;
		$jdata=1;
		while($r_data1=mysql_fetch_array($data1)){
			$kodebk = $r_data1[kode_bk];
			
			echo "<tr>
				<td></td>
				<td>Nomor BKM :</td>
				<td>$r_data1[kode_bk]</td>
				<td>Tanggal : ".jin_date_str($r_data1[tanggal])."</td>
				<td>Akun Bank : $r_data1[nobank] - $r_data1[namabank]</td>
				</tr>";
				
			$sql = "SELECT kode_bk,noakun,nobp,naakun,keterangan,jumlah,posting FROM jurbk WHERE kode_bk='$kodebk' ";
			$query = mysql_query($sql);
		
			$no=1;
			$sjumlah=0;
			while($r_data=mysql_fetch_array($query)){
				$sjumlah=$sjumlah+$r_data[jumlah];
				echo "<tr>
					<td align='center'>$no</td>
					<td align='center'>$r_data[noakun]</td>
					<td align='center'>$r_data[nobp]</td>
					<td>$r_data[naakun]</td>
					<td>$r_data[keterangan]</td>
					<td align='right'>".number_format($r_data[jumlah],2)."</td>
					<td align='center'>$r_data[posting]</td>
					</tr>";
				$no++;
				$jdata++;				
			}
			
			echo "<tr>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td align='right'>Jumlah</td>
					<td align='right'>".number_format($sjumlah,2)."</td>
				</tr>";
			$tjumlah=$tjumlah+$sjumlah;
		}
		echo "<tr></tr>
				<tr>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td align='right'>Total</td>
					<td align='right'>".number_format($tjumlah,2)."</td>
				</tr>";
		
	echo "</table>";
	
	echo "<table width='100%'>
		<tr>
			<td>Jumlah Data : $jdata</td>
		</tr>
	</table>";
?>