-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
107 lines (85 loc) · 3.17 KB
/
index.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/**
OSMTrainRouteAnalysis Copyright © 2014-2015 sb12 osm.mapper999@gmail.com
This file is part of OSMTrainRouteAnalysis.
OSMTrainRouteAnalysis is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
// load settings
include "functions/settings.php";
// load needed functions
include "functions/overpass.php";
include "functions/train_details.php";
include "functions/getData.php";
include "functions/lang.php";
include "functions/start.php";
include "functions/train.php";
include "functions/signals.php";
include "functions/search.php";
include "po_parser/src/Sepia/PoParser.php";
//FIXME: add possibility to change language
// define path to home directory
define("PATH", "");
//define version numbers of external software
$v_bootstrap = "3.3.7";
$v_leaflet = "0.7.7";
$v_jquery = "1.12.4";
// load language
Lang::defineLanguage();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="description" content="<?php echo Lang::l_('Analysis of Train Routes Based on OpenStreetMap Data');?>">
<!-- include leaflet -->
<script src="http://cdn.leafletjs.com/leaflet/v<?php echo $v_leaflet;?>/leaflet.js"></script>
<!-- include bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/<?php echo $v_bootstrap;?>/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/<?php echo $v_bootstrap;?>/css/bootstrap-theme.min.css">
<!-- load jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/<?php echo $v_jquery;?>/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/<?php echo $v_bootstrap;?>/js/bootstrap.min.js"></script>
<!-- load javascript functions -->
<script type="text/javascript" src="javascript/functions.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v<?php echo $v_leaflet;?>/leaflet.css" />
<link rel="stylesheet" type="text/css" href="style/style.css">
<link rel="alternate" type="application/rss+xml" href="changelog.php" title="Changelog">
<?php
//route id is defined -> get route
if ( isset( $_GET["id"] ) || isset( $_POST["id"] ) )
{
$route = new Route();
// get data
$route -> getData();
$route -> train = new Train();
$route -> loadXml();
$route -> loadRelationWays();
$route -> calculateSpeed();
$route -> sortStops();
$route -> output();
showAbout();
}
// route is not defined -> possibility to show route
else
{
start();
Search::showSearchResult();
showAbout();
}
?>
</body>
</html>