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

echo "<table id='theList' width='100%'>
		<tr>
			<th width='2%'>No.</th>
			<th>Kode</th>
			<th>Nama Supplier</th>
			<th>Alamat</th>
			<th>Telepon</th>
			<th>Faxcimile</th>
			<th>Bank</th>
			<th>Nomor Rekening</th>
			<th>Atas Nama</th>
			<th>Contact Person</th>
		</tr>";
		if (!empty($cari))
			$sql= "SELECT * FROM supplier WHERE (nama LIKE '%$cari%' OR alamat LIKE '%$cari%' OR telepon LIKE '%$cari%') ORDER BY kode_sp";		
		else $sql= "SELECT * FROM supplier ORDER BY kode_sp";
		$query = mysql_query($sql);
		
		$no=1;
		while($r=mysql_fetch_array($query)){
			echo "<tr>
				<td align='center'>$no</td>
				<td>$r[kode_sp]</td>
				<td>$r[nama]</td>
				<td>$r[alamat]</td>
				<td>$r[telepon]</td>
				<td>$r[fax]</td>
				<td>$r[bank]</td>
				<td>$r[nomor_ac]</td>
				<td>$r[nama_ac]</td>
				<td>$r[kontak]</td>
			</tr>";
			$no++;
		}
	echo "</table>";
?>