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/teamtable/edit/update.php

25 lines
643 B
PHP
Raw Normal View History

2022-03-07 06:13:17 +00:00
<?php $app = require '../../../app/inc.php';
2022-02-14 01:52:59 +00:00
2022-03-07 06:13:17 +00:00
use App\Teamtable\Team;
2022-02-14 01:52:59 +00:00
2022-03-07 06:13:17 +00:00
$item = filter_input(INPUT_GET, 'item', FILTER_VALIDATE_INT);
2022-02-14 01:52:59 +00:00
2022-03-07 06:13:17 +00:00
$model = $app->model('Teamtable');
2022-02-14 01:52:59 +00:00
2022-03-07 06:13:17 +00:00
// item is NULL if not set
if ($item !== NULL)
2022-02-14 10:23:05 +00:00
{
2022-03-07 06:13:17 +00:00
// check that team exists
$team = $model->get($item);
if (!$team)
2022-02-14 10:23:05 +00:00
{
2022-03-07 06:13:17 +00:00
// team does not exist
$app->session->flash('Kunne ikke endre lag: Lag finnes ikke', 'danger');
$app->redirect('index.php');
2022-02-14 10:23:05 +00:00
}
}
2022-02-14 01:52:59 +00:00
2022-03-07 06:13:17 +00:00
// lets create a team
2022-02-14 01:52:59 +00:00
$app->view('template/header', ['title' => 'Endre lagdetaljer']);
2022-03-07 06:13:17 +00:00
$app->view('pages/teamtable/edit/update', ["team" => new Team]);
2022-02-14 01:52:59 +00:00
$app->view('template/footer');