Esempio n. 1
0
                echo '<li><a href="?route=coupons.php&amp;action=list&amp;type=publish&amp;id=' . $_GET['id'] . '&amp;token=' . $csrf . '">' . $LANG['publish'] . '</a></li>';
            }
            echo '</ul>
</div>';
        }
        echo '<a href="?route=coupons.php&amp;action=list" class="btn">' . $LANG['coupons_view'] . '</a>

</div>';
        if (!empty($LANG['coupons_edit_subtitle'])) {
            echo '<span>' . $LANG['coupons_edit_subtitle'] . '</span>';
        }
        echo '</div>';
        if ($item_exists) {
            if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['csrf']) && check_csrf($_POST['csrf'], 'coupons_csrf')) {
                if (isset($_POST['store']) && isset($_POST['category']) && isset($_POST['name']) && isset($_POST['code']) && isset($_POST['description']) && isset($_POST['tags']) && isset($_POST['reward_points']) && isset($_POST['start']) && isset($_POST['end']) && isset($_POST['meta_title']) && isset($_POST['meta_desc'])) {
                    if (actions::edit_item($_GET['id'], array('store' => $_POST['store'], 'category' => $_POST['category'], 'popular' => isset($_POST['popular']) ? 1 : 0, 'exclusive' => isset($_POST['exclusive']) ? 1 : 0, 'name' => $_POST['name'], 'link' => !isset($_POST['coupon_ownlink']) && isset($_POST['link']) && filter_var($_POST['link'], FILTER_VALIDATE_URL) ? $_POST['link'] : '', 'code' => $_POST['code'], 'description' => $_POST['description'], 'tags' => $_POST['tags'], 'cashback' => $_POST['reward_points'], 'start' => $_POST['start']['date'] . ', ' . $_POST['start']['hour'], 'end' => $_POST['end']['date'] . ', ' . $_POST['end']['hour'], 'publish' => isset($_POST['publish']) ? 1 : 0, 'meta_title' => $_POST['meta_title'], 'meta_desc' => $_POST['meta_desc']))) {
                        $info = \query\main::item_infos($_GET['id']);
                        echo '<div class="a-success">' . $LANG['msg_saved'] . '</div>';
                    } else {
                        echo '<div class="a-error">' . $LANG['msg_error'] . '</div>';
                    }
                }
            }
            $_SESSION['coupons_csrf'] = $csrf;
            echo '<div class="form-table">

<form action="#" method="POST" autocomplete="off">

<div class="row"><span>' . $LANG['form_store_id'] . ':</span><div data-search="store"><input type="text" name="store" value="' . $info->storeID . '" required /><a href="#">S</a></div></div>

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