<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 DO</th>
			<th>Tanggal</th>
			<th>Nomor DO</th>
			<th>Jenis BBM</th>
			<th>Jumlah Liter</th>
			<th>Harga Beli</th>
			<th>Jumlah Harga</th>
		</tr>";
		
		$sql = "SELECT * FROM stock_do WHERE !(jml_liter='0') ORDER BY kode_do";
						
		$query = mysql_query($sql);
		$no=1;
		$total=0;
		while($r_data=mysql_fetch_array($query)){
			$total	= $total+$r_data[jumlah];
			echo "<tr>
					<td align='center'>$no</td>
					<td>$r_data[kode_do]</td>
					<td align='center'>".jin_date_str($r_data[tanggal])."</td>
					<td>$r_data[nobukti]</td>
					<td>$r_data[jenis]</td>
					<td align='right'>$r_data[jml_liter]</td>
					<td align='right'>".number_format($r_data[hg_beli],2)."</td>
					<td align='right'>".number_format($r_data[jumlah],0)."</td>
				</tr>";
			$no++;			
		}
		echo "<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td align='right'>Total </td>
				<td align='right'>".number_format($total,0)."</td>
			</tr>";
	echo "</table>";
?>