Adapted getRoutesByStop().

This commit is contained in:
George Kaklamanos 2016-02-21 20:53:00 +02:00
parent b9ed5b7bf5
commit 4ffef02bb9

View file

@ -21,17 +21,17 @@ function getRoutesOfLine($line){
return $tmp; return $tmp;
} }
function getRoutesByStop($stopId){ function getRoutesByStop($stopId,$direction){
global $routes; global $routes;
$tmp = array(); $res = array();
foreach ($routes as $route){ foreach ($routes as $route){
foreach ($route['stops'] as $stop){ foreach ($route['stops'][$direction] as $stop){
if ($stop == $stopId){ if ($stop == $stopId){
array_push($tmp, $route); array_push($res, $route["id"]);
} }
} }
} }
return $tmp; return $res;
} }
function isValidRoute($id){ function isValidRoute($id){