Commit
This commit is contained in:
parent
b5cd0c82a8
commit
4c19cbcbb5
17
app/model/Teamtable.php
Normal file
17
app/model/Teamtable.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Teamtable
|
||||
{
|
||||
public PDO $dbh;
|
||||
|
||||
public function __construct(Database $database)
|
||||
{
|
||||
$this->dbh = $database->conn;
|
||||
}
|
||||
|
||||
public function getTable(): array
|
||||
{
|
||||
$sth = $this->dbh->query('SELECT * FROM lagtabell');
|
||||
return $sth->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
24
app/view/teamtable/edit/index.php
Normal file
24
app/view/teamtable/edit/index.php
Normal file
@ -0,0 +1,24 @@
|
||||
<h1>Endre 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>
|
8
public/teamtable/edit/index.php
Normal file
8
public/teamtable/edit/index.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$app = require '../../../app/inc.php';
|
||||
|
||||
$model = $app->model('Teamtable');
|
||||
|
||||
$app->view('template/header', ['title' => 'Endre lagtabell']);
|
||||
$app->view('teamtable/edit/index', ["teams" => $model->getTable()]);
|
||||
$app->view('template/footer');
|
8
public/teamtable/index.php
Normal file
8
public/teamtable/index.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$app = require '../../app/inc.php';
|
||||
|
||||
$model = $app->model('Teamtable');
|
||||
|
||||
$app->view('template/header', ['title' => 'Lagtabell']);
|
||||
$app->view('teamtable/index', ["teams" => $model->getTable()]);
|
||||
$app->view('template/footer');
|
Reference in New Issue
Block a user