<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';
$kode	= $_GET[kode];
echo "<table id='theList' class='detail' width='100%'>
		<tr>
			<th>No.</th>
			<th>Kode</th>
			<th>Nama Pelanggan</th>
			<th>No.Polisi</th>
			<th>Jml. Liter</th>
			<th>Jml. Rupiah</th>
			<th>Jatuh Tempo</th>
		</tr>";
		$sql = "SELECT * FROM setor_bbm WHERE kode_sb='$kode' ORDER BY kode_sb";
						
		$query = mysql_query($sql);		
		$no=1;
		$tnopol=0;
		$tliter=0;
		while($r_data=mysql_fetch_array($query)){			
			$tliter=$tliter+$r_data[jml_nopol];
			$tnopol=$tnopol+$r_data[nilai_nopol];
			echo "<tr>
					<td align='center'>$no</td>
					<td>$r_data[kode_pl]</td>
					<td>$r_data[nama_pl]</td>
					<td>$r_data[nopol]</td>
					<td align='center'>$r_data[jml_nopol]</td>
					<td align='right'>".number_format($r_data[nilai_nopol],2)."</td>
					<td align='center'>$r_data[tanggal_jt]</td>
				</tr>";
			$no++;			
		}
		
		echo "<tr>
				<td></td>
				<td></td>
				<td></td>
				<td align='right'>Total</td>
				<td align='center'>".number_format($tliter,2)."</td>
				<td align='right'>".number_format($tnopol,2)."</td>
			</tr>";
	echo "</table>";
?>