This commit is contained in:
William 2022-02-15 13:07:18 +01:00
parent b3adf41960
commit 17e201e9a4
3 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@
<br> <br>
<table> <table>
<tr> <tr>
<th>#</th>
<th>Navn</th> <th>Navn</th>
<th>Bedrift</th> <th>Bedrift</th>
<th>Kortnummer</th> <th>Kortnummer</th>
@ -14,12 +15,15 @@
<th>Handling</th> <th>Handling</th>
</tr> </tr>
<?php <?php
$iterator = 0;
foreach ($teams as $row) { foreach ($teams as $row) {
++$iterator;
foreach ($row as $key => $value) foreach ($row as $key => $value)
{ {
$row[$key] = htmlspecialchars($row[$key]); $row[$key] = htmlspecialchars($row[$key]);
} }
echo '<tr>'; echo '<tr>';
echo "<td>{$iterator}</td>";
echo "<td>{$row['LagNavn']}</td>"; echo "<td>{$row['LagNavn']}</td>";
echo "<td>{$row['Bedrift']}</td>"; echo "<td>{$row['Bedrift']}</td>";
echo "<td>{$row['Kortnummer']}</td>"; echo "<td>{$row['Kortnummer']}</td>";

View File

@ -2,6 +2,7 @@
<br> <br>
<table> <table>
<tr> <tr>
<th>#</th>
<th>Navn</th> <th>Navn</th>
<th>Bedrift</th> <th>Bedrift</th>
<th>Kortnummer</th> <th>Kortnummer</th>
@ -12,12 +13,16 @@
<th>Bestetid</th> <th>Bestetid</th>
</tr> </tr>
<?php <?php
$iterator = 0;
foreach ($teams as $row) { foreach ($teams as $row) {
++$iterator;
// Escape all values
foreach ($row as $key => $value) foreach ($row as $key => $value)
{ {
$row[$key] = htmlspecialchars($row[$key]); $row[$key] = htmlspecialchars($row[$key]);
} }
echo '<tr>'; echo '<tr>';
echo "<td>{$iterator}</td>";
echo "<td>{$row['LagNavn']}</td>"; echo "<td>{$row['LagNavn']}</td>";
echo "<td>{$row['Bedrift']}</td>"; echo "<td>{$row['Bedrift']}</td>";
echo "<td>{$row['Kortnummer']}</td>"; echo "<td>{$row['Kortnummer']}</td>";

View File

@ -5,6 +5,6 @@ $model = $app->model('Teamtable');
$id = $model->addEmptyTeam(); $id = $model->addEmptyTeam();
$app->session->flash('Opprettet ny lagmal, <a href=' . "update.php?item=$id" . '>klikk her</a> for å endre på den', 'success', TRUE); $app->session->flash('Opprettet ny lagmal, <a class="success" href=' . "update.php?item=$id" . '>klikk her</a> for å endre på den', 'success', TRUE);
$app->redirect('index.php'); $app->redirect('index.php');