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

$cari= $_GET['cari'];

$tnilai =0;
$jml=1;
		
echo "<table id='theList' width='100%'>
		<tr>
			<th>No.</th>
			<th>Kode</th>
			<th>Jumlah SO</th>
			<th>Nama Barang</th>
			<th>Barcode</th>
			<th>Satuan</th>
		</tr>";
		if(!empty($cari))
			$query = mysql_query("SELECT * FROM stock WHERE concat(substr(kode_st,1,2))='$cari' GROUP BY kode_st");
		else
			$query = mysql_query("SELECT * FROM stock WHERE 1 GROUP BY kode_st");
		
		$no=1;
		while($r=mysql_fetch_array($query)){
			$nilai = $r['jml_stok']*$r['hg_beli'];
			echo "<tr>
				<td>$no</td>
				<td>$r[kode_st]</td>
				<td align='center'> __________ </td>
				<td>$r[nama_st]</td>
				<td>$r[barcode]</td>
				<td>$r[satuan]</td>
			</tr>";
			$no++;
			$jml++;
		}		
	echo "</table>";
echo "</div>";
?>