diff --git a/app/view/pages/race/configure/reset.php b/app/view/pages/race/configure/reset.php
new file mode 100644
index 0000000..e4a9f8f
--- /dev/null
+++ b/app/view/pages/race/configure/reset.php
@@ -0,0 +1,4 @@
+
Er du sikker?
+Er du sikker på at du vil nullstille alle runder?
+[ Nullstill ]
+[ Avbryt ]
\ No newline at end of file
diff --git a/app/view/pages/race/configure/teams/delete.php b/app/view/pages/race/configure/teams/delete.php
index d870fe9..b151254 100644
--- a/app/view/pages/race/configure/teams/delete.php
+++ b/app/view/pages/race/configure/teams/delete.php
@@ -1,4 +1,4 @@
Er du sikker?
Er du sikker på at du vil slette lag =htmlspecialchars($team->name)?>?
-[ Slett ]
+[ Slett ]
[ Avbryt ]
\ No newline at end of file
diff --git a/app/view/pages/race/configure/teams/index.php b/app/view/pages/race/configure/teams/index.php
index c2630de..93438af 100644
--- a/app/view/pages/race/configure/teams/index.php
+++ b/app/view/pages/race/configure/teams/index.php
@@ -1,5 +1,6 @@
Endre lagtabell
[ Opprett lag ]
+[ Nullstill runder ]
@@ -29,7 +30,7 @@
echo "" . htmlspecialchars($team->rounds) . " | ";
echo "" . htmlspecialchars(($team->bestTime === NULL) ? "Ukjent" : $team->bestTime) . " | ";
echo "";
- echo "[ Slett ] ";
+ echo "[ Slett ] ";
echo "[ Endre ]";
echo " | ";
echo '
';
diff --git a/public/race/configure/reset.php b/public/race/configure/reset.php
index 3cfdd12..0fe7849 100644
--- a/public/race/configure/reset.php
+++ b/public/race/configure/reset.php
@@ -1,6 +1,6 @@
view('template/header', ['title' => 'Nullstill runder']);
+ $app->view('pages/race/configure/reset');
+ $app->view('template/footer');
+ die();
+}
+
$teamMapper = new TeamMapper($app->database->conn);
$timeMapper = new TimeMapper($app->database->conn);
@@ -27,4 +37,7 @@ $times = $timeMapper->getAll();
foreach ($times as $key => $time)
{
$timeMapper->delete($time->id);
-}
\ No newline at end of file
+}
+
+$app->session->flash("Runder er nullstilt", "success");
+$app->redirect("index.php");
\ No newline at end of file
diff --git a/public/race/configure/teams/delete.php b/public/race/configure/teams/delete.php
index f89ddcb..67230d0 100644
--- a/public/race/configure/teams/delete.php
+++ b/public/race/configure/teams/delete.php
@@ -23,7 +23,7 @@ if (!$team)
}
// show confirmation page
-if ($confirm)
+if (!$confirm)
{
$app->view('template/header', ['title' => 'Bekreft sletting']);
$app->view('pages/race/configure/teams/delete', ['team' => $team]);