<?
session_start();
$brcode=$_SESSION['brcode'];
include("opendb.php");
include("test.php");

$partcode=$_GET['key'];
$re=mysqli_query($db,"select acname,addr1 from cust_master where acname like '%$partcode%' and branch='$brcode' order by acname");
$json="";
while($row=mysqli_fetch_array($re))
{

	 $json.= '{"id":"'.$row[0].'","value":"'.$row[1].'"},';

}

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

?>
