show total score on statistic site
This commit is contained in:
@@ -81,7 +81,18 @@ function get_teams($con) {
|
||||
$stmt->execute();
|
||||
$stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||
return $stmt;
|
||||
} catch(PDOExeption $e) {
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
|
||||
function get_total_score($con) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT M.name as Mannschaftsname, M.feuerwehr as Feuerwehr, SUM(P.punkte) as Gesamtpunkte FROM Punkte as P, Mannschaft as M WHERE P.m_id = M.m_id GROUP BY M.m_id ORDER BY Gesamtpunkte DESC");
|
||||
$stmt->execute();
|
||||
$stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||
return $stmt;
|
||||
} catch(PDOException $e) {
|
||||
handle_pdo_exception($e);
|
||||
}
|
||||
}
|
||||
@@ -52,4 +52,15 @@ function load_teams_table($con) {
|
||||
echo "<td>" . $row['feuerwehr'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
function load_total_score($con) {
|
||||
$stmt = get_total_score($con);
|
||||
foreach($stmt->fetchAll() as $row) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $row['Mannschaftsname'] . "</td>";
|
||||
echo "<td>" . $row['Feuerwehr'] . "</td>";
|
||||
echo "<td>" . $row['Gesamtpunkte'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user