<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 Barang</th>
			<th>Nama Barang</th>
			<th>Satuan</th>
			<th>Jml. Kirim</th>
			<th>Jml. Retur</th>
			<th>Harga Beli</th>
			<th>Nilai Retur</th>
			<th>Keterangan</th>
		</tr>";
		$sql = "SELECT * FROM retur_pb WHERE kode_rb='$kode' ";
						
		$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_st]</td>
					<td>$r_data[nama_st]</td>
					<td>$r_data[satuan]</td>
					<td align='center'>".number_format($r_data[jml_kirim],2)."</td>
					<td align='center'>".number_format($r_data[jml_retur],2)."</td>
					<td align='right'>".number_format($r_data[hg_beli])."</td>
					<td align='right'>".number_format($r_data[jumlah])."</td>
					<td>$r_data[keterangan]</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>";
?>