-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroute.php
28 lines (26 loc) · 801 Bytes
/
route.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
// Get the path from the url, if it doesn't exist, default to index
$path = $_GET["path"] ?? "index";
// Switch based on path
switch ($path) {
case "findstation":
require "controller/FindStationController.php";
FindStationController::getStation(
$_GET["id"] ?? null,
$_GET["name"] ?? null
);
break;
case "schedule":
require "controller/ScheduleController.php";
ScheduleController::getSchedule(
$_GET["id"] ?? null,
$_GET["arriving"] ?? false,
$_GET["date"] ?? date("Y-m-d", time()),
$_GET["time"] ?? date("H:i:s", time())
);
break;
default:
require "controller/IndexController.php";
IndexController::getIndex();
break;
}