<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;
		
		$("#txt_kodeaw").val(kode);				
		$("#form_cari_kode").dialog('close');				
	}
</script>

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

echo "<table id='theList' width='100%'>
		<tr>
			<th>No.</th>
			<th>Nomor BBM</th>
			<th>Tanggal</th>			
			<th>Jml. Item</th>
			<th>Debet</th>
			<th>Kredit</th>
			<th>Posting</th>
			<th>Pilih</th>
		</tr>";
		
		$query = "SELECT kode_ju,tanggal,count(noakun) as totitem,sum(debet) as tdebet,sum(kredit) as tkredit,posting FROM jurnalum WHERE posting='' GROUP BY kode_ju ";
		$sql= mysql_query($query);
				
		$no=1;
		while($r_data=mysql_fetch_array($sql)){
			echo "<tr>
					<td align='center'>$no</td>
					<td align='center'>$r_data[kode_ju]</td>
					<td align='center'>".jin_date_str($r_data[tanggal])."</td>					
					<td align='center'>$r_data[totitem]</td>
					<td align='right'>".number_format($r_data[tdebet],2)."</td>
					<td align='right'>".number_format($r_data[tkredit],2)."</td>
					<td align='center'>$r_data[posting]</td>
					<td align='center'><a href='javascript:void(0)' onClick=\"pilih('$r_data[kode_ju]')\">
						<img src='images/view.png' border='0' id='edit' title='Pilih BBM' width='12' height='12' ></a>
					</td>
				</tr>";
			$no++;								
		}
	echo "</table>";
?>
