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

<style type="text/css">
.detail{
	font-size:14px;	
}
</style>
<?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 Pangkalan</th>
			<th>Harga Jual</th>
			<th>Jml. Unit</th>
			<th>Jumlah Harga</th>
			<th>Bank</th>
		</tr>";
		
		$query 	= mysql_query("SELECT * FROM faktur_sj WHERE kode_pj='$kode' ORDER BY no_urut");
		         
		$no=1;
		$total=0;
		$tunit=0;
		while($r_data=mysql_fetch_array($query)){
			$total	= $total+$r_data[jumlah];
			$tunit	= $tunit+$r_data[jml_unit];
			
			echo "<tr>
				<td align='center'>$no</td>
				<td>$r_data[kode_pl]</td>
				<td>$r_data[nama_pl]</td>
				<td align='right'>".number_format($r_data[hg_jual],0)."</td>
				<td align='right'>".number_format($r_data[jml_unit],0)."</td>
				<td align='right'>".number_format($r_data[jumlah],0)."</td>
				<td>$r_data[nabank]</td>
			</tr>";
			$no++;
		}
		
		echo "<tr>
			<td></td>
			<td></td>
			<td></td>
			<td align='right'>Total</td>
			<td align='right'>".number_format($tunit,0)."</td>
			<td align='right'>".number_format($total,0)."</td>
		</tr>
	</table>";
?>