</div>'; break; /** EDIT CATEGORY */ /** EDIT CATEGORY */ case 'edit': if (!ab_to(array('categories' => 'edit'))) { die; } $csrf = \site\utils::str_random(10); echo '<div class="title"> <h2>' . $LANG['categories_edit_title'] . '</h2> <div style="float:right; margin: 0 2px 0 0;">'; if (isset($_GET['id']) && ($category_exists = \query\main::category_exists($_GET['id']))) { $info = \query\main::category_infos($_GET['id']); $ab_del = ab_to(array('categories' => 'delete')); if ($ab_del) { echo '<div class="options"> <a href="#" class="btn">' . $LANG['options'] . '</a> <ul>'; if ($ab_del) { echo '<li><a href="?route=categories.php&action=delete&id=' . $_GET['id'] . '&token=' . $csrf . '" data-delete-msg="' . $LANG['delete_msg'] . '">' . $LANG['delete'] . '</a></li>'; } echo '</ul> </div>'; } } echo '<a href="?route=categories.php&action=list" class="btn">' . $LANG['categories_view'] . '</a> </div>';
} else { echo '<div class="a-error">' . $LANG['msg_error'] . '</div>'; } } } } } echo '<a href="#" class="btn" onclick="window.history.go(-2)">' . $LANG['back'] . '</a>'; break; /** IMPORT STORES */ /** IMPORT STORES */ case 'import_stores': if (!ab_to(array('feed' => 'import'))) { die; } if (!isset($_GET['category']) || !\query\main::category_exists($_GET['category'])) { echo '<div class="a-error">' . $LANG['msg_category_dontexist'] . '</div>'; echo '<a href="#" class="btn" onclick="window.history.go(-1)">' . $LANG['back'] . '</a>'; } else { if (!isset($_GET['id']) || empty($_GET['id'])) { echo '<div class="a-error">' . $LANG['msg_feed_seltoimp'] . '</div>'; echo '<a href="#" class="btn" onclick="window.history.go(-1)">' . $LANG['back'] . '</a>'; } else { if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['token']) && check_csrf($_POST['token'], 'feed_import_csrf')) { include 'includes/feed.php'; try { $feed = new feed(\query\main::get_option('feedserver_ID'), \query\main::get_option('feedserver_secret')); $ssuc = $csuc = $serr = $cerr = 0; try { $stores = $feed->stores($store_ids = array('ids' => implode(',', array_keys($_GET['id'])))); if (!empty($stores['Count'])) {
/* SHOWING COUPONS OR PRODUCTS */ function searched_type() { if (isset($_GET['type']) && strtolower($_GET['type']) === 'products') { return 'products'; } return 'coupons'; } /* PUT THE OBJECT INTO A GLOBAL VARIABLE */ $GLOBALS['searched_type'] = searched_type(); $GLOBALS['item'] = \query\main::category_infos(); $GLOBALS['exists'] = \query\main::category_exists(); /* CHECK IF CATEGORY EXISTS */ function exists() { return $GLOBALS['exists']; } /* INFORMATIONS ABOUT CATEGORY */ function the_item() { return $GLOBALS['item']; } /*