<?
session_start();
include("opendb.php");
$inno = $_REQUEST['inno'] ?? '';

if ($inno === '') {
    echo "inno not received";
    exit;
}
$json='';
$sq=mysqli_query($db,"select * from veh_purchase where chasis like '%$inno%' and brcode='PSN236'");
    while($row=mysqli_fetch_array($sq))
    {
        $purtyp='purchase';
        $json.= '{"partcode":"'.$row['chasis'].'","partname":"'.addslashes($row[11]).'","rate":"'.addslashes($row[5]).'","supqty":"'.addslashes($row[8]).'","purtp":"'.addslashes($purtyp).'"},';
    }

    echo $json;
?>