<?php
require_once("../include/config.php");
require_once("../include/startup.php");

$testclass    			= 	new AllTables();
if(!empty($_POST["companyname"])) {
//	$companyname = $_POST["companyname"];
	  $query ="SELECT * FROM mstrepresentative WHERE represent_companyname  =  '" . $_POST["companyname"] . "'";
	
		  $results	         = $testclass-> getInfo("",$query);
	//$MemberName = $results[$i]['MemberName'];


?>
	<option value="">Select Members</option>
<?php
	foreach($results as $represent) {
			if(strtoupper($companyname)==strtoupper($represent[$i]['represent_companyname']))
				{
?>
	<option value="<?php echo $represent["representid"].'-'.$represent["MemberName"].'-'.$representlist[$i]["MemberSurName"]; ?>" selected=""><?php echo ucwords(strtolower($represent["MemberName"])); ?> <?php echo ucwords(strtolower($represent["MemberSurName"])); ?></option>
<?php
	}
	else 
	{
?>
	<option value="<?php echo $represent["representid"].'-'.$represent["MemberName"].'-'.$representlist[$i]["MemberSurName"]; ?>"><?php echo ucwords(strtolower($represent["MemberName"])); ?> <?php echo ucwords(strtolower($represent["MemberSurName"])); ?></option>
<?php
}
}
}
?>