<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';

$tgl_awal	= $_GET['tgl_awal'];
$tgl_akhir= $_GET['tgl_akhir'];
$jenis	= $_GET['jenis'];

echo "<table id='theList' width='100%'>
		<tr>
			<th>No.</th>
			<th>Kode Penguapan</th>
			<th>Tanggal</th>
			<th>Jenis BBM</th>
			<th>Tanki</th>
			<th>Jumlah Stok</th>
			<th>Hasil Stik</th>
			<th>Penguapan</th>
			<th>Harga Beli</th>
			<th>Nilai Penguapan</th>
		</tr>";
		
		if(!empty($jenis))
			$sql = "SELECT * FROM penguapan WHERE tanggal BETWEEN '$tgl_awal' AND '$tgl_akhir' AND jenis='$jenis' AND batal='' GROUP BY kode_ls ";
		else
			$sql = "SELECT * FROM penguapan WHERE tanggal BETWEEN '$tgl_awal' AND '$tgl_akhir' AND batal='' GROUP BY kode_ls ";
		$query = mysql_query($sql);
		
		$no=1;
		$tsls=0;
		$tnilai=0;
		
		while($r_data=mysql_fetch_array($query)){
			$tsls = $tsls+$r_data[jml_sls];
			$tnilai= $tnilai+$r_data[nilai_sls];
			
			echo "<tr>
					<td align='center'>$no</td>
					<td align='center'>$r_data[kode_ls]</td>
					<td align='center'>".jin_date_str($r_data[tanggal])."</td>
					<td>$r_data[jenis]</td>
					<td align='center'>$r_data[tanki]</td>
					<td align='right'>$r_data[jml_stok]</td>
					<td align='right'>$r_data[jml_stik]</td>
					<td align='right'>$r_data[jml_sls]</td>
					<td align='right'>".number_format($r_data[hg_beli])."</td>
					<td align='right'>".number_format($r_data[nilai_sls])."</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'>$tsls</td>
				<td></td>
				<td align='right'>".number_format($tnilai)."</td>
			</tr>";
	echo "</table>";
?>