0 ? "WHERE State = '".mysql_real_escape_string($state)."' " : ""; $query .= "ORDER BY City, State, Zip"; $result = mysql_query($query); $count = mysql_num_rows($result); for ($i = 0; $i < $count; $i++) { $row = mysql_fetch_array($result); $al = new Altos(); $al = $al->load($row); $firstChar = substr($al->getCity(), 0, 1); $areas = isset($arrArea) ? $arrArea[$firstChar] : NULL; if (isset($areas) == false) { $areas = array(); } $areas[count($areas)] = $al; $arrArea[$firstChar] = $areas; } ?> Choose Area \n"; echo "State: "; echo isset($state) && $state == "PA" ? "" : ""; echo "Pennsylvania"; echo isset($state) && $state == "PA" ? "" : ""; echo " | "; echo isset($state) && $state == "NJ" ? "" : ""; echo "New Jersey"; echo isset($state) && $state == "NJ" ? "" : ""; echo " | "; echo isset($state) == false ? "" : ""; echo "Both"; echo isset($state) == false ? "" : ""; echo "

"; for ($i = 65; $i <= 90; $i++) { if ($i > 65) { echo " | "; } $x = chr($i); $areas = $arrArea[$x]; if ($x == $start) { echo "$x"; } else if (isset($areas) == false || count($areas) == 0) { echo $x; } else { echo "".$x.""; } } echo "

"; $areas = $arrArea[$start]; echo "

Click on an area to view its market information. Optionally, choose a letter above to see the areas that start with that letter.

"; if (isset($areas) == false) { echo "

There are no areas that begin with '$start'.

"; } else { ?> >
getCity()) ?>, getState()) ?> getZip()) ?>