<?php
ini_set('memory_limit', '-1');
	require_once("../include/config.php");	
	require_once("../include/startup.php");
	
	$obj  = new Product();
	
	$data = array();
	
	$memberid 	= $_POST['memberid'];
	$type = $_POST['type'];
	$name = $_POST['name_startsWith'];
	
	$sqltext = "Select * from mstclients where UPPER(".$type.") LIKE '".strtoupper($name)."%' and memberid = $memberid order by companyname asc";
	//echo $sqltext;
//	echo json_encode($sqltext);
//	exit;
	$row = $obj-> getProduct('',$sqltext);
	
	$rowcount =count($row);

	for($i=0;$i<$rowcount;$i++)
	{
		$name = $row[$i]['companyname'].'|'.$row[$i]['clientcompanyid'].'|'.$row[$i]['Addline1'].'|'.$row[$i]['Addline2'].'|'.$row[$i]['head_CityName'].'|'.$row[$i]['head_StateidName'].'-'.$row[$i]['head_Pin'].'|'.$row[$i]['Country'].'|'.$row[$i]['gstno'];
		array_push($data, $name);
	}	
	echo json_encode($data);
?>
