<?php
include('config.php');

$q 		= strtolower($_GET["q"]);

if (!$q) return;

$sqlprod = "SELECT * FROM mst_product where (pm_name LIKE '%$q%') LIMIT 0,25";
$prod_conn = $conn->query($sqlprod);
while($prod = $prod_conn->fetch_assoc()){
	
		$name 				= ($prod['pm_name']);
		$product_id 		= ($prod['pm_autoid']);
		$product_name 		= ($prod['pm_name']);
		$avg_price			= ($prod['pm_avg_price']);
		
		
		
		
		
		
		
		$stok = get_stok_info($product_id,0,$conn);
		
		echo "$name|$product_id|$product_name|$avg_price|$stok \n";
}
?>