Fix geolocation
[busui.git] / stopList.php
blob:a/stopList.php -> blob:b/stopList.php
--- a/stopList.php
+++ b/stopList.php
@@ -36,19 +36,20 @@
    navbar();
    timePlaceSettings(true);
 } else if ($_REQUEST['suburb']) {
-   $url = $APIurl."/json/stopzonesearch?q=".filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING);
-include_header("Stops in ".ucwords(filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING)),"stopList");
+   $suburb = filter_var($_REQUEST['suburb'], FILTER_SANITIZE_STRING);
+   $url = $APIurl."/json/stopzonesearch?q=".$suburb;
+include_header("Stops in ".ucwords($suburb),"stopList");
 if (isMetricsOn()) {
 // Create a new Instance of the tracker
 $owa = new owa_php($config);
 // Set the ID of the site being tracked
-$owa->setSiteId('bus.lambdacomplex.org');
+$owa->setSiteId($owaSiteID);
 // Create a new event object
 $event = $owa->makeEvent();
 // Set the Event Type, in this case a "video_play"
 $event->setEventType('view_stop_list_suburb');
 // Set a property
-$event->set('stop_list_suburb',$_REQUEST['suburb']);
+$event->set('stop_list_suburb',$suburb);
 // Track the event
 $owa->trackEvent($event);
     }
@@ -85,7 +86,9 @@
         echo "<a name=$firstletter></a>";
         $firstletter = substr($row[1],0,1);
     }
-      echo  '<li><a href="stop.php?stopid='.$row[0].'">';
+      echo  '<li>';
+   if (!startsWith($row[5],"Wj")) echo '<img src="css/images/time.png" alt="Timing Point" class="ui-li-icon">';
+      echo '<a href="stop.php?stopid='.$row[0].(startsWith($row[5],"Wj") ? '&stopcode='. $row[5] : "") .'">';
       if (isset($_SESSION['lat']) && isset($_SESSION['lon'])){
 	 echo '<span class="ui-li-count">'.floor(distance($row[2], $row[3], $_SESSION['lat'], $_SESSION['lon'])).'m away</span>';
       }