-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
267 lines (231 loc) · 9.21 KB
/
index.php
File metadata and controls
267 lines (231 loc) · 9.21 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php
/*
* Created on 20.11.2015
*
*/
if (stristr($_SERVER["REQUEST_URI"], '/index.php') === false) {
header('Location: '.$_SERVER["SCRIPT_NAME"].'?func=veranstaltung');
}
$showContent = false;
session_start();
include "function.php";
$link = connectDB();
$allowedFunctions = array('veranstaltung',
'teilnehmer',
'auswertung',
'rennen',
'klasse',
'import',
'einlaufListe',
'ziel',
'reader',
'statistic');
$_GET = filterParameters($_GET);
$_POST = filterParameters($_POST);
$html = "";
# Wenn keine Funktion übergeben wurde, dann wird die Veranstaltungsauswahl angezeigt
if (!isset($_GET['func'])) {
$func[0] = 'veranstaltung';
} else {
$func[0] = "";
$func[1] = "";
$func = explode(".", $_GET['func']);
}
#Prüfung ob eine erlaubte function übergeben wird.
if(array_search($func[0], $allowedFunctions) !== false) {
if (isset($_SESSION['vID']) || $func[0] == 'veranstaltung') {
$showContent = true;
}
if (!isset($_SESSION['vID'])) {
$func[0] = 'veranstaltung';
$showContent = true;
}
}
if (!isset($_SESSION['vTitel'])) { $_SESSION['vTitel'] = ''; }
if (!isset($_SESSION['vDatum'])) { $_SESSION['vDatum'] = ''; }
if (!isset($_SESSION['vUntertitel'])) { $_SESSION['vUntertitel'] = ''; }
if (!isset($_SESSION['rID'])) { $_SESSION['rID'] = 0; }
$testDiv = false;
if((stristr($_SERVER["SCRIPT_NAME"], 'test') !== FALSE) || (stristr($config['dbname'], 'test'))){
$testDiv = true;
}
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache; no-store; max-age=0" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="description" content="openTiming SportsTiming" />
<meta http-equiv="Content-Language" content="de" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="decorator" content="main" />
<title>openTiming</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/opentiming.css" rel="stylesheet">
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/bootstrap-datepicker3.css" rel="stylesheet">
<link href="css/bootstrap-select.min.css" rel="stylesheet">
<link href="js/jquery-ui/jquery-ui.min.css" rel="stylesheet">
<script src="js/jquery-2.1.4.js"></script>
<script src="js/jquery-ui/jquery-ui.min.js"></script>
<script>
/*** Handle jQuery plugin naming conflict between jQuery UI and Bootstrap ***/
$.widget.bridge('uibutton', $.ui.button);
$.widget.bridge('uitooltip', $.ui.tooltip);
</script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/bootstrap-datepicker.de.min.js"></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/opentiming.js"></script>
<script src="js/base64.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
</head>
<body>
<script>
$(document).ready(function(){
$(".btn").mouseup(function(){
$(this).blur();
})
$("#submit-chat").click(function(event){
event.preventDefault();
if( $( "#new-chat-message" ).val() != "" ) {
submitForm('#addChatMessage', false);
}
clearTimeout(cncm);
checkNewChatMessage();
$( "#new-chat-message" ).val('');
});
$("#enableChat").click(function(event){
event.preventDefault();
$( "#chat" ).css('display', 'block');
});
checkNewChatMessage();
});
</script>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php"><span class="navbar-brand-orange">open</span>Timing</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-left">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-wrench"></i> Administration <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index.php?func=veranstaltung">Veranstaltung</a></li>
<li><a href="index.php?func=rennen">Rennen</a></li>
<li><a href="index.php?func=klasse">Klassen</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user"></i> Teilnehmer <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index.php?func=teilnehmer">Teilnehmerliste</a></li>
<li><a href="index.php?func=teilnehmer&id=new">Teilnehmer Eingabe</a></li>
<li><a href="index.php?func=import.teilnehmer">Teilnehmer Laden</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-clock-o"></i> Zeit <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index.php?func=import.zeit">Zeitliste Einlesen</a></li>
<li><a href="index.php?func=ziel.edit">Readerzeit manuell Bearbeiten</a></li>
<li role="separator" class="divider"></li>
<li><a href="index.php?func=einlaufListe">Einlaufliste</a></li>
<li><a href="index.php?func=ziel.analyse">Analyse Zielzeiten</a></li>
</ul>
</li>
<li><a href="index.php?func=auswertung"><i class="fa fa-cog"></i> Auswertung</a></li>
<li><a href="index.php?func=reader"><i class="fa fa-cog"></i> Reader</a></li>
<?php getHelpMenue(); ?>
<li><a href="#" id="enableChat"><i class="fa fa-envelope-o"></i> Chat</a></li>
<?php getStatisticMenue(); ?>
</ul>
<?php
if ($testDiv == true) {
echo "<div class=\"nav navbar-nav navbar-right testsystem\">Das ist das Testsystem</div>";
}
?>
</div>
</div>
</nav>
<div class="main">
<h2 id="page-header" class="page-header text-center"><?php echo $_SESSION['vTitel']; ?></h2>
<div class="race-table">
<?php
if ($showContent == true) {
$func[0]();
} else {
echo "Use of disallowed function"; die;
}
?>
</div>
<div class="content-table"></div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modal" aria-labelledby="gridSystemModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" onclick="clearModal(); return false;" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="gridSystemModalLabel"> </h4>
</div>
<div class="modal-body" id="modal-body">
<span class="text-muted">loading...</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="clearModal(); return false;" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modal2" aria-labelledby="gridSystemModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" onclick="clearModal(); return false;" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="gridSystemModalLabel"> </h4>
</div>
<div class="modal-body" id="modal2-body">
<span class="text-muted">loading...</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="clearModal(); return false;" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="chat" class="" style="display:none;" tabindex="-1">
<button type="button" class="close" onclick="closeChat(); return false;" aria-label="Close"><span aria-hidden="true">×</span></button>
<div id="chat-message"></div>
<div id="chat-new-message">
<form role="form" id="addChatMessage">
<input type="hidden" name="form" value="addChatMessage">
<div class="row">
<div class="col-xs-10">
<input type="text" class="form-control input-sm" id="new-chat-message" name="new-chat-message" placeholder="new chat message">
</div>
<div class="col-xs-2">
<button type="submit" id="submit-chat" class="btn btn-default input-sm">Send</button>
</div>
</div>
</form>
</div>
</div>
</body>
</html>
<?php
$link->close();
#phpinfo(32);
#print_r($_SESSION);
?>