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

---
 common/history-base.php |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/common/history-base.php b/common/history-base.php
new file mode 100644
index 0000000..67b6547
--- /dev/null
+++ b/common/history-base.php
@@ -0,0 +1,22 @@
+<?php
+include_once "common/base.php";
+
+$s = new \EOG\Models\Stripe();
+
+if (file_exists(STRIPE_JSON)) {
+    $raw_json = file_get_contents(STRIPE_JSON);
+    $stateArray = json_decode($raw_json, true);
+    if (is_array($stateArray)) {
+        $s->loadFromArray($stateArray);
+    }
+}
+
+$history = new \EOG\Models\MatchHistory();
+
+if (file_exists(HISTORY_JSON)) {
+    $raw_json = file_get_contents(HISTORY_JSON);
+    $stateArray = json_decode($raw_json, true);
+    if (is_array($stateArray)) {
+        $history->loadState($stateArray);
+    }
+}
\ No newline at end of file

--
Gitblit v1.8.0