From a4186ab0762833a4c4dd741e6dd112185efc2272 Mon Sep 17 00:00:00 2001
From: Fibinger Ádám <adam.fibinger@wup.hu>
Date: Thu, 17 Oct 2019 16:51:42 +0200
Subject: [PATCH] History felület alapok és némi refaktor

---
 save-teams.php |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/save-teams.php b/save-teams.php
new file mode 100644
index 0000000..0d2fde4
--- /dev/null
+++ b/save-teams.php
@@ -0,0 +1,20 @@
+<?php
+
+include_once "common/base.php";
+
+if (empty($_POST['json'])) {
+    header('Location: /generator/form.php', true, 302);
+}
+$teams = new \EOG\Models\TeamList();
+
+$success = false;
+
+if ($teams->fromJson($_POST['json'])) {
+    $success = file_put_contents(OVERLAY_DIR . 'teams.json', $teams->getJson());
+}
+
+if ($success) {
+    header('Location: /generator/form.php', true, 302);
+} else {
+    echo "Szar van a palacsintában";
+}

--
Gitblit v1.8.0