From 4c19cbcbb529cb6e55344fe52b308294c18afb4d Mon Sep 17 00:00:00 2001 From: William Date: Mon, 7 Feb 2022 11:09:16 +0100 Subject: [PATCH] Commit --- app/model/Teamtable.php | 17 +++++++++++++ app/view/teamtable/edit/index.php | 24 +++++++++++++++++++ .../{view-teams.php => teamtable/index.php} | 0 public/teamtable/edit/index.php | 8 +++++++ public/teamtable/index.php | 8 +++++++ 5 files changed, 57 insertions(+) create mode 100644 app/model/Teamtable.php create mode 100644 app/view/teamtable/edit/index.php rename app/view/{view-teams.php => teamtable/index.php} (100%) create mode 100644 public/teamtable/edit/index.php create mode 100644 public/teamtable/index.php diff --git a/app/model/Teamtable.php b/app/model/Teamtable.php new file mode 100644 index 0000000..caf64fa --- /dev/null +++ b/app/model/Teamtable.php @@ -0,0 +1,17 @@ +dbh = $database->conn; + } + + public function getTable(): array + { + $sth = $this->dbh->query('SELECT * FROM lagtabell'); + return $sth->fetchAll(PDO::FETCH_ASSOC); + } +} \ No newline at end of file diff --git a/app/view/teamtable/edit/index.php b/app/view/teamtable/edit/index.php new file mode 100644 index 0000000..292faee --- /dev/null +++ b/app/view/teamtable/edit/index.php @@ -0,0 +1,24 @@ +

Endre lagtabell

+
+ + + + + + + + + + + + + '; + foreach ($row as $key) { + echo ""; + } + echo ''; + } + ?> +
IDNavnBedriftKortnummerLederTelefonDeltagereRunderBestetid
$key
\ No newline at end of file diff --git a/app/view/view-teams.php b/app/view/teamtable/index.php similarity index 100% rename from app/view/view-teams.php rename to app/view/teamtable/index.php diff --git a/public/teamtable/edit/index.php b/public/teamtable/edit/index.php new file mode 100644 index 0000000..1c7d6d7 --- /dev/null +++ b/public/teamtable/edit/index.php @@ -0,0 +1,8 @@ +model('Teamtable'); + +$app->view('template/header', ['title' => 'Endre lagtabell']); +$app->view('teamtable/edit/index', ["teams" => $model->getTable()]); +$app->view('template/footer'); \ No newline at end of file diff --git a/public/teamtable/index.php b/public/teamtable/index.php new file mode 100644 index 0000000..7083a3d --- /dev/null +++ b/public/teamtable/index.php @@ -0,0 +1,8 @@ +model('Teamtable'); + +$app->view('template/header', ['title' => 'Lagtabell']); +$app->view('teamtable/index', ["teams" => $model->getTable()]); +$app->view('template/footer'); \ No newline at end of file