<?
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 led from ledger where led like '%$inno%'  and led like 't d s p%'  and brcode='$brcode' order by led asc limit 10") or die("ERR6:".mysqli_error($db));
$json="";
while($row=mysqli_fetch_array($re))
{

$json.= '{"supnm":"'.$row['led'].'"},';

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