From 4ffef02bb94476afa931f5feb5c8f6889f22ab4f Mon Sep 17 00:00:00 2001 From: George Kaklamanos Date: Sun, 21 Feb 2016 20:53:00 +0200 Subject: [PATCH] Adapted getRoutesByStop(). --- modules/libdata.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/libdata.php b/modules/libdata.php index 399759e..35a2a68 100644 --- a/modules/libdata.php +++ b/modules/libdata.php @@ -21,17 +21,17 @@ function getRoutesOfLine($line){ return $tmp; } -function getRoutesByStop($stopId){ +function getRoutesByStop($stopId,$direction){ global $routes; - $tmp = array(); + $res = array(); foreach ($routes as $route){ - foreach ($route['stops'] as $stop){ + foreach ($route['stops'][$direction] as $stop){ if ($stop == $stopId){ - array_push($tmp, $route); + array_push($res, $route["id"]); } } } - return $tmp; + return $res; } function isValidRoute($id){