This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/public/simulator.php

23 lines
671 B
PHP
Raw Normal View History

2022-01-24 10:54:42 +00:00
<?php
$app = require '../app/inc.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
if (!isset($_POST['cardnumber']) || empty($_POST['cardnumber']))
{
$app->session->flash('Kortnummer kan ikke være tom!', 'danger');
} else {
2022-01-26 13:38:22 +00:00
$model = $app->model('Simulator');
if ($model->insert($_POST['cardnumber']))
{
$app->session->flash("Lag funnet for \"{$_POST['cardnumber']}\"", "success");
} else {
$app->session->flash("Opprettet lag for \"{$_POST['cardnumber']}\"");
}
2022-01-24 10:54:42 +00:00
}
}
$app->view('template/header', ['title' => 'Simulator']);
$app->view('simulator');
$app->view('template/footer');