<?php
///$q = strtolower($_GET["q"]);
//if (!$q) return;
include 'db_connect.php';



if($_GET['mode']=='subcat'){
	

$items = mysqli_query($con,"SELECT `desc`, det , det1 FROM  `master` WHERE  `mstype` LIKE  'SUBCAT'");

while($row = mysqli_fetch_array($items)) {
	//if (strpos(strtolower($row['desc']), $q) !== false) {
		//echo $row['vehno']."\n";
		echo $row['desc']."\n";
		//}

	}

}
	
else if($_GET['mode']=='statusfill'){
	
  $items = mysqli_query($con,"SELECT `desc`, det FROM master where mstype='STATUS'");
  
 	 while($row = mysqli_fetch_array($items)) {
  
  		$output_arr[]['list'] = $row;
 	 }
  
  echo json_encode($output_arr);
}

	else{


	$items = mysqli_query($con,"SELECT `desc`, det , det1, det2, det3 FROM  `master` WHERE  `mstype` LIKE  'CAT'");

	while($row = mysqli_fetch_array($items)) {
	
		echo $row['desc']."|".$row['det']."|".$row['det1']."|".$row['det2']."|".$row['det3']."\n";


		}

	}

mysqli_close($con);


?>