This commit is contained in:
William 2022-02-05 15:43:48 +01:00
parent 2063418302
commit 65735fb457
3 changed files with 51 additions and 0 deletions

24
app/view/view-teams.php Normal file
View File

@ -0,0 +1,24 @@
<h1>Lagtabell</h1>
<br>
<table>
<tr>
<th>ID</th>
<th>Navn</th>
<th>Bedrift</th>
<th>Kortnummer</th>
<th>Leder</th>
<th>Telefon</th>
<th>Deltagere</th>
<th>Runder</th>
<th>Bestetid</th>
</tr>
<?php
foreach ($teams as $row) {
echo '<tr>';
foreach ($row as $key) {
echo "<td>$key</td>";
}
echo '</tr>';
}
?>
</table>

View File

@ -118,4 +118,22 @@ a {
background: #fff3cd;
border-color: #dfc678;
background: linear-gradient(0deg, rgb(251, 229, 161) 0%, rgb(255, 243, 205) 100%);
}
table {
border-collapse: collapse;
width: 100%;
}
table td, table th {
border: 0.05rem solid #aaa;
font-weight: normal;
padding: 0.05rem 0.25rem 0.05rem 0.25rem;
}
table tr:nth-child(even) {
background-color: #fff;
}
table th {
text-align: left;
background-color: #222;
color: #eee;
}

9
public/view-teams.php Normal file
View File

@ -0,0 +1,9 @@
<?php
$app = require '../app/inc.php';
$sth = $app->database->conn->query('SELECT * FROM lagtabell');
$teams = $sth->fetchAll(PDO::FETCH_ASSOC);
$app->view('template/header', ['title' => 'Lagtabell']);
$app->view('view-teams', ["teams" => $teams]);
$app->view('template/footer');