57 lines
1.6 KiB
PHP
57 lines
1.6 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
include("../scripts/connection.php");
|
|
include("../scripts/functions.php");
|
|
$user_data = check_login($con);
|
|
|
|
if(isset($_POST['stationen'])) {
|
|
$_SESSION['select-statistics'] = $_POST['stationen'];
|
|
}
|
|
|
|
echo file_get_contents("html/header.html");
|
|
?>
|
|
|
|
<body>
|
|
<div>
|
|
<form name="switch-statistics" method="post">
|
|
<label for="station">Welche Station soll angezeigt werden?</label>
|
|
<select name="stationen" id="station" onchange="this.form.submit()">
|
|
<?php
|
|
if(!isset($_SESSION['select-statistics']) || $_SESSION['select-statistics'] == "total-score") {
|
|
$session = "total-score";
|
|
} else {
|
|
$session = $_SESSION['select-statistics'];
|
|
echo $session;
|
|
}
|
|
load_options_stations($con, $session);
|
|
?>
|
|
</select>
|
|
</form>
|
|
</div>
|
|
<div class="headline">
|
|
<?php
|
|
if($session == "total-score") {
|
|
echo "<h2>Gesamtpunkte</h2\n";
|
|
} else {
|
|
echo "<h2>" . get_station_name($con, $session)['name'] . "</h2>\n";
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="table-div">
|
|
<table>
|
|
<?php
|
|
if($session == "total-score") {
|
|
load_total_score($con);
|
|
} else {
|
|
load_station_table($con, $session);
|
|
}
|
|
?>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
|
|
<?php
|
|
echo file_get_contents("html/footer.html");
|
|
$con=null;
|
|
?>
|