Escape GET variables centrally
[busui.git] / stopList.php
blob:a/stopList.php -> blob:b/stopList.php
--- a/stopList.php
+++ b/stopList.php
@@ -40,19 +40,32 @@
 		$stops = getStops();
 		include_header("All Stops", "stopList");
 		navbar();
-		timePlaceSettings();
 	}
 	else if (isset($nearby)) {
 		$listType = 'nearby=yes';
 		include_header("Nearby Stops", "stopList", true, true);
 		trackEvent("Stop Lists", "Stops Nearby", $_SESSION['lat'] . "," . $_SESSION['lon']);
 		navbar();
-		timePlaceSettings(true);
 		if (!isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "") {
+			placeSettings();
 			include_footer();
 			die();
 		}
 		$stops = getNearbyStops($_SESSION['lat'], $_SESSION['lon'], 15);
+		echo '<span class="content-secondary">';
+		$stopPositions[] = Array(
+			$_SESSION['lat'],
+			$_SESSION['lon']
+		);
+		foreach ($stops as $sub_stop) {
+			$stopPositions[] = Array(
+				$sub_stop["stop_lat"],
+				$sub_stop["stop_lon"]
+			);
+		}
+		echo staticmap($stopPositions, 0, "iconb", true, true);
+		placeSettings();
+		echo '</span><span class="content-primary">';
 	}
 	else if (isset($suburb)) {
 		$stops = getStopsBySuburb($suburb);
@@ -64,7 +77,6 @@
 		$stops = getStops(true, $firstLetter);
 		include_header("Timing Points / Major Stops", "stopList");
 		navbar();
-		timePlaceSettings();
 	}
 	echo '  <ul data-role="listview" data-filter="true" data-inset="true" >';
 	if (!isset($firstLetter) && !isset($suburb) && !isset($nearby)) {
@@ -129,6 +141,7 @@
 		}
 	}
 	echo '</ul>';
+	if (isset($nearby)) echo '</span>';
 }
 include_footer();
 ?>