<?php
session_start();
include("include/config.php");
require_once "include/Database_functions.php";
$sqlObj=new sqlclass();
	
		$q = strtolower($_GET["q"]);
		if (!$q) return;
		if($_SESSION['typename'] == 'SuperAdmin')
		{
			$sql = "select `client_newcode`,`client_name` from `cf_client` where client_newcode LIKE '$q%'";
		}
		else
		{	
			$userids = $_SESSION['admin_id'];
			$sq_user=mysql_query("select * from cf_user_clientid where user_id = '$userids'");
			$rw = mysql_fetch_array($sq_user);			
			$sql = "select `client_newcode`,`client_name` from `cf_client` where client_newcode = '".$rw['client_code']."'";
		}
		
		$rsd = mysql_query($sql);
		while($rs = mysql_fetch_array($rsd)) {
			$cname = $rs['client_newcode']." (".$rs['client_name'].")";
			echo "$cname\n";
		}
	



?>