<?php
	date_default_timezone_set('America/New_York');

	class UtilitiesSystem
	{
		var $username;     
		
		function UtilitiesSystem(){

		}
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		function getCities($sCity){
			global $database;
			
			$query = "
				SELECT 
					City,
					IndexID
				FROM 
					".TBLSYSTEMCITIES." 
				WHERE 
					isactive = '1'
			";
			
			$result = $database->query($query);
			$numRows = mysql_numrows($result);
			
			if(!$result || $numRows < 0){
				if(DEBUG == true){
					printf("Error in query: %s", $query);
				}
			}
			
			for($i=0; $i<$numRows; $i++){
				$City = mysql_result($result, $i, "City");
				
				if(strtoupper($City) == strtoupper($sCity))
				{
					echo "<option selected='' value='$City'>$City</option>";
				}
				else
				{
					echo "<option value='$City'>$City</option>";
				}
			}
		}//END getCities
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		function getEthnicity($sEthnicity){
			global $database;
			
			$query = "
				SELECT 
					Ethnicity,
					IndexID
				FROM 
					".TBLSYSTEMETHNICITY." 
				WHERE 
					isactive = '1'
			";
			
			$result = $database->query($query);
			$numRows = mysql_numrows($result);
			
			if(!$result || $numRows < 0){
				if(DEBUG == true){
					printf("Error in query: %s", $query);
				}
			}
			
			for($i=0; $i<$numRows; $i++){
				$Ethnicity = mysql_result($result, $i, "Ethnicity");
				
				if(strtoupper($Ethnicity) == strtoupper($sEthnicity))
				{
					echo "<option selected='' value='$Ethnicity'>$Ethnicity</option>";
				}
				else
				{
					echo "<option value='$Ethnicity'>$Ethnicity</option>";
				}
			}
		}//END getEthnicity
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	};

	$system = new UtilitiesSystem;
?>