Esempio n. 1
0
        }
        echo '<div class="title">

<h2>' . $LANG['coupons_import_title'] . '</h2>

<div style="float:right; margin: 0 2px 0 0;">
<a href="?route=coupons.php&amp;action=list" class="btn">' . $LANG['coupons_view'] . '</a>
</div>';
        if (!empty($LANG['coupons_import_subtitle'])) {
            echo '<span>' . $LANG['coupons_import_subtitle'] . '</span>';
        }
        echo '</div>';
        echo '<div id="upload-theme-form">';
        if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'coupons_csrf')) {
            if (isset($_POST['category']) && isset($_FILES['file'])) {
                if ($import = actions::import_items(array('category' => $_POST['category'], 'file' => $_FILES['file'], 'omit_first_line' => isset($_POST['omitfirst']) ? 1 : 0))) {
                    echo '<div class="a-success">' . sprintf($LANG['msg_couponsimported'], $import[0], $import[1]) . '</div>';
                } else {
                    echo '<div class="a-error">' . $LANG['msg_error'] . '</div>';
                }
            }
        } else {
            echo '<div class="a-alert">' . $LANG['msg_import_coupons'] . '</div>';
            echo '<div class="a-message">' . $LANG['msg_import_coupons_n'] . '</div>';
        }
        $csrf = $_SESSION['coupons_csrf'] = \site\utils::str_random(10);
        echo '<div class="form-table">

<form action="#" method="POST" enctype="multipart/form-data">

<div class="row"><span>' . $LANG['form_in_category'] . ':</span>