show teams table and terminate db connection
This commit is contained in:
@@ -12,4 +12,7 @@
|
|||||||
<h1><span>Punktesystem Kreispokalwettbewerb Altdorf</span></h1>
|
<h1><span>Punktesystem Kreispokalwettbewerb Altdorf</span></h1>
|
||||||
<p>test</p>
|
<p>test</p>
|
||||||
</body>
|
</body>
|
||||||
<?php echo file_get_contents("html/footer.html"); ?>
|
<?php
|
||||||
|
$con = null;
|
||||||
|
echo file_get_contents("html/footer.html");
|
||||||
|
?>
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
echo "Gib bitte gültige Daten ein!";
|
echo "Gib bitte gültige Daten ein!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$con = null;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -7,4 +7,24 @@
|
|||||||
|
|
||||||
echo file_get_contents("html/header.html");
|
echo file_get_contents("html/header.html");
|
||||||
?>
|
?>
|
||||||
<?php echo file_get_contents("html/footer.html"); ?>
|
|
||||||
|
<body>
|
||||||
|
<div class="table-div">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
<th scope="col">Feuerwehr</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php load_teams_table($con); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
echo file_get_contents("html/footer.html");
|
||||||
|
$con = null;
|
||||||
|
?>
|
||||||
@@ -26,4 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<?php echo file_get_contents("html/footer.html"); ?>
|
<?php
|
||||||
|
echo file_get_contents("html/footer.html");
|
||||||
|
$con = null;
|
||||||
|
?>
|
||||||
@@ -7,4 +7,7 @@
|
|||||||
|
|
||||||
echo file_get_contents("html/header.html");
|
echo file_get_contents("html/header.html");
|
||||||
?>
|
?>
|
||||||
<?php echo file_get_contents("html/footer.html"); ?>
|
<?php
|
||||||
|
echo file_get_contents("html/footer.html");
|
||||||
|
$con=null;
|
||||||
|
?>
|
||||||
@@ -73,4 +73,15 @@ function get_stations($con) {
|
|||||||
} catch(PDOException $e) {
|
} catch(PDOException $e) {
|
||||||
handle_pdo_exceptio($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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -42,4 +42,14 @@ function load_stations_table($con) {
|
|||||||
echo "<td>" . $row['standort'] . "</td>";
|
echo "<td>" . $row['standort'] . "</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_teams_table($con) {
|
||||||
|
$stmt = get_teams($con);
|
||||||
|
foreach($stmt->fetchAll() as $row) {
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<td>" . $row['name'] . "</td>";
|
||||||
|
echo "<td>" . $row['feuerwehr'] . "</td>";
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user