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

        $("#theList.detail tr").hover(
            function() {
                $(this).toggleClass("highlight");
            },
            function() {
                $(this).toggleClass("highlight");
            }
        );
    });	
});
</script>

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

$tanggal=$_GET[tanggal];
echo "<table id='theList' class='detail' width='100%'>
		<tr>
			<th>No.</th>
			<th>Kode Penerimaan</th>
			<th>Tanggal</th>
			<th>Kode Penebusan</th>
			<th>Jenis BBM</th>
			<th>Jumlah Liter</th>
			<th>Harga Beli</th>
			<th>Jumlah Harga</th>
		</tr>";
		$sql = "SELECT * FROM terima_bbm WHERE tanggal='$tanggal' AND batal='' ORDER BY kode_tb";
						
		$query = mysql_query($sql);
		$no=1;
		$tliter=0;
		$tjumlah=0;

		while($r_data=mysql_fetch_array($query)){
			$tliter= $tliter+$r_data[jml_liter];
			$tjumlah= $tjumlah+$r_data[jumlah];
			
			echo "<tr>
					<td align='center'>$no</td>
					<td>$r_data[kode_tb]</td>
					<td align='center'>".jin_date_str($r_data[tanggal])."</td>
					<td>$r_data[kode_do]</td>
					<td>$r_data[jenis]</td>
					<td align='right'>$r_data[jml_liter]</td>
					<td align='right'>".number_format($r_data[hg_beli])."</td>
					<td align='right'>".number_format($r_data[jumlah])."</td>
				</tr>";
			$no++;			
		}
		echo "<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td align='right'>Total </td>
				<td align='right'>$tliter</td>
				<td></td>
				<td align='right'>".number_format($tjumlah,0)."</td>
			</tr>";
	echo "</table>";	
?>