<?php
include 'data.php';
function getStopsOfRoute($id){
global $routes;
foreach ($routes as $route){
if ($route['id'] == $id){
return $route['stops'];
}
function getRoutesOfLine($line){
$tmp = array();
if ($route['line'] == $line){
array_push($tmp, $route);
return $tmp;
function getRoutesByStop($stopId){
foreach ($route['stops'] as $stop){
if ($stop == $stopId){
function isValidRoute($id){
return true;
return false;
function isValidLine($line){
function isValidStop($stp){
global $stops;
foreach ($stops as $stop){
if ($stop['id'] == $stp){
function getRouteInfo($id){
return $route;
function getStopInfo($id){
if ($stop['id'] == $id){
return $stop;
?>