diff --git a/app/core/App.php b/app/core/App.php
index 93e83eb..e33fce8 100644
--- a/app/core/App.php
+++ b/app/core/App.php
@@ -24,7 +24,12 @@ class App
public function model(string $model, $injection = NULL): object
{
// Require model file
- require __DIR__ . '/../model/' . $model . '.php';
+ $path = __DIR__ . '/../model/' . $model . '.php';
+ if (!file_exists($path))
+ {
+ throw new Exception("Model does not exist");
+ }
+ require $path;
// Instantiate model
if (!$injection)
{
@@ -39,7 +44,12 @@ class App
// Import variables into the current symbol table from an array
extract($data);
// Require view file
- require __DIR__ . '/../view/' . $view . '.php';
+ $path = __DIR__ . '/../view/' . $view . '.php';
+ if (!file_exists($path))
+ {
+ throw new Exception("View does not exist");
+ }
+ require $path;
}
// Turn data array into JSON response
diff --git a/app/view/pages/teamtable/index.php b/app/view/pages/teamtable/index.php
index cf9c5b1..e1af4d8 100644
--- a/app/view/pages/teamtable/index.php
+++ b/app/view/pages/teamtable/index.php
@@ -2,7 +2,6 @@
ID | Navn | Bedrift | Kortnummer | @@ -15,9 +14,14 @@ '; - foreach ($row as $key) { - echo "$key | "; - } + echo "{$row['LagNavn']} | "; + echo "{$row['Bedrift']} | "; + echo "{$row['Kortnummer']} | "; + echo "{$row['Lagleder']} | "; + echo "{$row['Telefon']} | "; + echo "{$row['Deltagere']} | "; + echo "{$row['Runder']} | "; + echo "{$row['Bestetid']} | "; echo '
---|