diff --git a/app/model/Simulator.php b/app/model/Simulator.php new file mode 100644 index 0000000..4747fd0 --- /dev/null +++ b/app/model/Simulator.php @@ -0,0 +1,11 @@ +database = $database; + } +} \ No newline at end of file diff --git a/app/view/simulator.php b/app/view/simulator.php new file mode 100644 index 0000000..29f41bf --- /dev/null +++ b/app/view/simulator.php @@ -0,0 +1,8 @@ +

Simulator

+

Skriv inn et kortnummer:

+
+ +
+
+ +
\ No newline at end of file diff --git a/public/api/get_times.php b/public/api/get_times.php new file mode 100644 index 0000000..245f5dc --- /dev/null +++ b/public/api/get_times.php @@ -0,0 +1,11 @@ +database->conn->prepare($sql); +$stmt->execute(); + + +$app->api([ + "data" => $stmt->fetchAll(PDO::FETCH_ASSOC) +]); \ No newline at end of file diff --git a/public/simulator.php b/public/simulator.php new file mode 100644 index 0000000..03b0002 --- /dev/null +++ b/public/simulator.php @@ -0,0 +1,18 @@ +model('Simulator'); + +if ($_SERVER['REQUEST_METHOD'] === 'POST') +{ + if (!isset($_POST['cardnumber']) || empty($_POST['cardnumber'])) + { + $app->session->flash('Kortnummer kan ikke være tom!', 'danger'); + } else { + $app->session->flash("Kortnummer: \"{$_POST['cardnumber']}\" er ikke blitt lastet opp men burde bli implementert snart!", 'success'); + } +} + +$app->view('template/header', ['title' => 'Simulator']); +$app->view('simulator'); +$app->view('template/footer'); \ No newline at end of file