<?php

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

if($_GET[mode]=='rateonp'){
	
	$items = mysqli_query($con,"SELECT code, `desc` FROM master where mstype = 'RTP' ");


while($row = mysqli_fetch_array($items)) {
	if (strpos(strtolower($row['code']), $q) !== false) {
		echo $row['code']."|".$row['desc']."\n";
		}
	}
	
	}
else{
$items = mysqli_query($con,"SELECT distinct(`ECode`) FROM empinfo ");


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


?>