show statistics of the stations is now possible

This commit is contained in:
2022-06-08 15:59:53 +02:00
parent 0962a70cd7
commit 13025edc3e
4 changed files with 129 additions and 26 deletions

View File

@@ -66,4 +66,15 @@ div.table-div th,td {
padding-left: 2.5vw;
padding-right: 2.5vw;
padding-bottom: 0.5vw;
}
div.headline {
display: block;
align-items: center;
justify-content: center;
}
div.headline h2{
text-align: center;
color: #002e5b;
}

View File

@@ -5,22 +5,48 @@
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>
<thead>
<th scope="col">Mannschaft</th>
<th scope="col">Feuerwehr</th>
<th scope="col">Gesamtpunkte</th>
</thead>
<tbody>
<?php
<?php
if($session == "total-score") {
load_total_score($con);
?>
</tbody>
} else {
load_station_table($con, $session);
}
?>
</table>
</div>
</body>