<?
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='inde.php'; </script>";
 return;
}

$regno=$_GET['key'];
$re=mysqli_query($db,"select regno,chasisno,make,model,owner from vehmaster where regno like '%$regno%' limit 10");



$json="";
while($row=mysqli_fetch_array($re))
{

	 $json.= '{"regno":"'.$row[0].'","chasisno":"'.addslashes($row[1]).'","make":"'.addslashes($row[2]).'","model":"'.addslashes($row[3]).'"},';

}

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

?>
