<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 DO</th>
			<th>Tanggal</th>
			<th>Nomor Bukti</th>
			<th>Jenis BBM</th>
			<th>Jumlah Liter</th>
			<th>Harga Beli</th>
			<th>Jumlah Harga</th>
			<th>Jumlah PPH</th>
			<th>Jumlah Disetor</th>
		</tr>";
		$sql = "SELECT * FROM tebus_do WHERE tanggal='$tanggal' AND batal='' ORDER BY kode_do";
						
		$query = mysql_query($sql);
		$no=1;
		$totharga=0;
		$totpph=0;
		$totsetor=0;
		while($r_data=mysql_fetch_array($query)){
			$totharga= $totharga+$r_data[jml_harga];
			$totpph  	= $totpph+$r_data[jml_pph];
			$totsetor= $totsetor+$r_data[jml_setor];
			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])."</td>
					<td align='right'>".number_format($r_data[jml_harga],0)."</td>
					<td align='right'>".number_format($r_data[jml_pph],0)."</td>
					<td align='right'>".number_format($r_data[jml_setor],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($totharga,0)."</td>
				<td align='right'>".number_format($totpph,0)."</td>
				<td align='right'>".number_format($totsetor,0)."</td>
			</tr>";
	echo "</table>";	
?>