Fibinger Ádám
2019-11-27 c5946f44341c29594803c5b2ca64dcaf335fbca3
form.php
@@ -7,24 +7,24 @@
    $s->loadFromArray($_POST['stripe']);
    if (!empty($s->getState())) {
        file_put_contents($last_json, $s->getJson());
        file_put_contents(STRIPE_JSON, $s->getJson());
    }
    $s->setClass('simple');
    $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]);
    $html_content = $twig->render('overlays/stripe.twig', ['stripe' => $s]);
    file_put_contents(OVERLAY_DIR . 'simple.html', $html_content);
    $s->setClass('team');
    $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]);
    $html_content = $twig->render('overlays/stripe.twig', ['stripe' => $s]);
    file_put_contents(OVERLAY_DIR . 'team.html', $html_content);
    $s->setClass('team-ban');
    $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]);
    $html_content = $twig->render('overlays/stripe.twig', ['stripe' => $s]);
    file_put_contents(OVERLAY_DIR . 'team-ban.html', $html_content);
} else {
    if (file_exists($last_json)) {
        $raw_json = file_get_contents($last_json);
    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);
@@ -34,8 +34,8 @@
$teams = new \EOG\Models\TeamList();
if (file_exists(OVERLAY_DIR . 'teams.json')) {
    var_dump($teams->fromJson(file_get_contents(OVERLAY_DIR . 'teams.json')));
if (file_exists(TEAMS_JSON)) {
    $teams->fromJson(file_get_contents(TEAMS_JSON));
}
$var = [
@@ -45,5 +45,5 @@
    'post' => !empty($_POST['stripe'])
];
echo $twig->render('templates/admin/stripe-form.twig', $var);
echo $twig->render('admin/stripe-form.twig', $var);