<?
session_start();
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='index.php'; </script>";
 return;
}
$inno=$_GET['key'];
$re=mysqli_query($db,"select * from sup_master where supname like '%$inno%'  order by supname asc limit 10") or die("ERR6:".mysqli_error($db));
$json="";
while($row=mysqli_fetch_array($re))
{

$json.= '{"supnm":"'.$row['web'].'","partname":"'.addslashes($row['suptype']).'","stock":"'.addslashes($row['dist']).'","rate":"'.addslashes($row['stat']).'"},';

}
echo '['.trim($json,',').']';
?>