From 42cd6956b9fad9fe5f143f2e92096bd5d0f98ef0 Mon Sep 17 00:00:00 2001 From: Grisu Date: Wed, 8 Jun 2022 12:30:53 +0200 Subject: [PATCH] show teams table and terminate db connection --- app/public/index.php | 5 ++++- app/public/login.php | 1 + app/public/mannschaft.php | 22 +++++++++++++++++++++- app/public/stationen.php | 5 ++++- app/public/statistik.php | 5 ++++- app/scripts/database_queries.php | 11 +++++++++++ app/scripts/functions.php | 10 ++++++++++ 7 files changed, 55 insertions(+), 4 deletions(-) diff --git a/app/public/index.php b/app/public/index.php index 5f07997..d3cb2c8 100644 --- a/app/public/index.php +++ b/app/public/index.php @@ -12,4 +12,7 @@

Punktesystem Kreispokalwettbewerb Altdorf

test

- \ No newline at end of file + \ No newline at end of file diff --git a/app/public/login.php b/app/public/login.php index 7106361..a5a5b54 100644 --- a/app/public/login.php +++ b/app/public/login.php @@ -21,6 +21,7 @@ echo "Gib bitte gültige Daten ein!"; } } + $con = null; ?> diff --git a/app/public/mannschaft.php b/app/public/mannschaft.php index 8590566..ef3ebea 100644 --- a/app/public/mannschaft.php +++ b/app/public/mannschaft.php @@ -7,4 +7,24 @@ echo file_get_contents("html/header.html"); ?> - \ No newline at end of file + + +
+ + + + + + + + + + +
NameFeuerwehr
+
+ + + \ No newline at end of file diff --git a/app/public/stationen.php b/app/public/stationen.php index 49d55fa..8145a1b 100644 --- a/app/public/stationen.php +++ b/app/public/stationen.php @@ -26,4 +26,7 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/public/statistik.php b/app/public/statistik.php index 8590566..8575432 100644 --- a/app/public/statistik.php +++ b/app/public/statistik.php @@ -7,4 +7,7 @@ echo file_get_contents("html/header.html"); ?> - \ No newline at end of file + \ No newline at end of file diff --git a/app/scripts/database_queries.php b/app/scripts/database_queries.php index e48ce15..02e50ae 100644 --- a/app/scripts/database_queries.php +++ b/app/scripts/database_queries.php @@ -73,4 +73,15 @@ function get_stations($con) { } catch(PDOException $e) { handle_pdo_exceptio($e); } +} + +function get_teams($con) { + try { + $stmt = $con->prepare("SELECT name, feuerwehr FROM Mannschaft"); + $stmt->execute(); + $stmt->setFetchMode(PDO::FETCH_ASSOC); + return $stmt; + } catch(PDOExeption $e) { + handle_pdo_exception($e); + } } \ No newline at end of file diff --git a/app/scripts/functions.php b/app/scripts/functions.php index 58168d9..357e412 100644 --- a/app/scripts/functions.php +++ b/app/scripts/functions.php @@ -42,4 +42,14 @@ function load_stations_table($con) { echo "" . $row['standort'] . ""; echo ""; } +} + +function load_teams_table($con) { + $stmt = get_teams($con); + foreach($stmt->fetchAll() as $row) { + echo ""; + echo "" . $row['name'] . ""; + echo "" . $row['feuerwehr'] . ""; + echo ""; + } } \ No newline at end of file