<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Invalid Login') </script>";
 return;
}
include("../opendb.php");

$partcode=$_GET['key'];

 

     $res=mysqli_query($db,"select config,mcode from veh_master where brcode='$brcode' and config like '$partcode%' order by config");
   
       
   

$json="";
while($row=mysqli_fetch_array($res))
{
   
    
	 $json.= '{"partcode":"'.$row[0].'","partname":"'.addslashes($row['1']).'"},';
}











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

?>