75 lines
2.3 KiB
PHP
75 lines
2.3 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
include("../scripts/connection.php");
|
|
include("../scripts/functions.php");
|
|
$user_data = check_login($con);
|
|
|
|
if(isset($_GET['stationen'])) {
|
|
$_SESSION['select-statistics'] = $_GET['stationen'];
|
|
}
|
|
|
|
if(!isset($_SESSION['select-statistics']) || $_SESSION['select-statistics'] == "total-score") {
|
|
$session = "total-score";
|
|
} else {
|
|
$session = $_SESSION['select-statistics'];
|
|
}
|
|
|
|
include("header_footer/header.php");
|
|
?>
|
|
|
|
<body>
|
|
<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>
|
|
<form name="switch-statistics" method="get">
|
|
<select name="stationen" id="station" onchange="this.form.submit()">
|
|
<?php
|
|
load_options_stations($con, $session, true);
|
|
?>
|
|
</select>
|
|
</form>
|
|
<?php
|
|
if($session != "total-score" && get_teams_no_points($con, $session)->rowCount() > 0) {
|
|
echo "<form action=\"add_entry.php\" method=\"get\">
|
|
<input type=\"hidden\" name=\"station\" value=\"$session\"/>
|
|
<input type=\"submit\" value=\"Ergebniss eintragen\"/>
|
|
</form>\n";
|
|
}
|
|
|
|
?>
|
|
</div>
|
|
<?php
|
|
if ($session != "total-score") {
|
|
echo "<div>
|
|
<form action=\"edit_statistics.php\" method=\"get\">
|
|
<input type=\"button\" id=\"edit_statistic\" value=\"Eintrag bearbeiten\" class=\"edit\" disabled=true/>
|
|
<input type=\"hidden\" id=\"team_id\" name=\"m_id\"/>
|
|
<input type=\"hidden\" id=\"station_id\" name=\"s_id\" value=\"". $session . "\"/>
|
|
</form>
|
|
</div>";
|
|
} ?>
|
|
<div class="table-div">
|
|
<table id="table">
|
|
<?php
|
|
if($session == "total-score") {
|
|
load_total_score($con);
|
|
} else {
|
|
load_station_table($con, $session);
|
|
}
|
|
?>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
|
|
<?php
|
|
echo file_get_contents("header_footer/footer.html");
|
|
$con=null;
|
|
?>
|