From: Maxious Date: Wed, 08 Feb 2012 06:05:42 +0000 Subject: URL parameter to filter stop trips display by route or another stop on the route X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=af0f899fc4a3ed516edd2f15bb08d2af3cb4be7c --- URL parameter to filter stop trips display by route or another stop on the route --- --- a/geo/route.kml.php +++ b/geo/route.kml.php @@ -1,31 +1,105 @@ '; echo ' - + + + '; + + + '; $route = getRoute($routeid); echo "\n\n"; +$_REQUEST['time'] = "12:00"; +$trip = getRouteNextTrip($routeid, 0); +$link = curPageURL() . "/../trip.php?routeid=" . htmlspecialchars($route["route_id"]. "&directionid=0&tripid=".$trip['trip_id']) ; +echo "" . $route['route_short_name'] . " Direction 0 "; +echo ''; +echo '' . $route['route_short_name'] . " Direction 0]]> "; +echo "#yellowLineYellowPoly"; -$link = curPageURL() . "/../trip.php?routeid=" . htmlspecialchars($route["route_id"]); -echo "" . $route['route_short_name'] . ""; -echo ''; -echo '' . $route['route_short_name'] . " " . $route['route_long_name'] . "]]> "; -echo "#yellowLineGreenPoly"; -$trip = getRouteNextTrip($routeid); echo getTripShape($trip['trip_id']); + echo "\n"; +$stops = Array(); +foreach (getTripStops($trip['trip_id']) as $stop) { + $stop['style'] = "#ylw-pushpin"; + $stops[$stop['stop_id']] = $stop; +} -echo "\n\n"; + +echo "\n\n"; +$trip = getRouteNextTrip($routeid, 1); +$link = curPageURL() . "/../trip.php?routeid=" . htmlspecialchars($route["route_id"]. "&directionid=1&tripid=".$trip['trip_id']) ; +echo "" . $route['route_short_name'] . " Direction 1 "; +echo ''; +echo '' . $route['route_short_name'] . " Direction 1]]> "; +echo "#blueLineBluePoly"; + +echo getTripShape($trip['trip_id']); + echo "\n"; +foreach (getTripStops($trip['trip_id']) as $stop) { + if (isset($stops[$stop['stop_id']])) { + $stop['style'] = "#grn-pushpin"; + } else { + $stop['style'] = "#blue-pushpin"; + } + $stops[$stop['stop_id']] = $stop; +} +foreach ($stops as $stop) { + echo "\n\n"; + $link = curPageURL() . '/../stop.php?stopid=' . htmlspecialchars($stop['stop_id']); + echo "" . htmlspecialchars($stop['stop_name']) . ""; + echo ''; + echo '' . htmlspecialchars($stop['stop_name']) . "]]> "; + echo "" . $stop['style'] . ""; + echo $stop['positionkml']; + echo "\n"; +} + +echo "\n"; ?> --- a/geo/stops.kml.php +++ b/geo/stops.kml.php @@ -1,6 +1,8 @@ "; + $description = 'View stop page
'; // Creates a Placemark and append it to the Document. $node = $dom->createElement('Placemark'); $placeNode = $docNode->appendChild($node); --- a/geo/trip.kml.php +++ b/geo/trip.kml.php @@ -1,10 +1,37 @@ '; echo ' + + +