dl/htdocs/index.php
2020-06-17 20:49:28 +02:00

65 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
error_reporting(0);
ini_set('display_errors', 'Off');
require('./main.php');
$ui;
// Display stop info board or search for stops
if (isset($_GET['h']) && $_GET['h']) {
$stop = $_GET['h'];
if (preg_match('/^\d{5,}$/', $stop) === 1) {
$ui = new StopInfoboard($stop);
} else {
$searchquery = new SearchQuery($stop, SEARCH_STOPS);
$searchresults = $searchquery->execute();
$ui = new ResultsInterface($stop, $searchresults);
}
}
// Display line info board or search for lines
/* elseif (isset($_GET['l'])) {
$lineRef = $_GET['l'];
$ui = new LineInfoboard($lineRef);
}*/
// Show search interface
else {
$ui = new SearchUI();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=240, initial-scale=1" />
<meta name="format-detection" content="telephone=no" />
<link rel="shortcut icon" href="img/favicon.ico" />
<title><?php $title = $ui->title(); if ($title) echo $title . ' '; ?>De Lijn Reisinformatie lite</title>
<style>
@import url('css/main.css');
@import url('css/searchresults.css');
@import url('css/infoboards.css');
</style>
</head>
<body>
<?php
$ui->display();
?>
</body>
</html>