Fibinger Ádám
2019-10-17 b40e9386fb4253a5866b8e4cdcda0c2023783856
commit | author | age
b40e93 1 <?php
2
3 include_once "common/base.php";
4
5 if (empty($_POST['json'])) {
6     header('Location: /generator/form.php', true, 302);
7 }
8 $teams = new \EOG\Models\TeamList();
9
10 $success = false;
11
12 if ($teams->fromJson($_POST['json'])) {
13     $success = file_put_contents(OVERLAY_DIR . 'teams.json', $teams->getJson());
14 }
15
16 if ($success) {
17     header('Location: /generator/form.php', true, 302);
18 } else {
19     echo "Szar van a palacsintában";
20 }