Exemplo n.º 1
0
function have_coupons($category = array())
{
    if (!$GLOBALS['me']) {
        return false;
    }
    return \query\main::have_items(array_merge($category, array('user' => $GLOBALS['me']->ID)));
}
Exemplo n.º 2
0
function have_items($category = array())
{
    if ($GLOBALS['searched_type'] === 'products') {
        $GLOBALS['have_items'] = \query\main::have_products($category, 'category');
    } else {
        $GLOBALS['have_items'] = \query\main::have_items($category, 'category');
    }
    /*
    ACTIVATE PAGES INFORMATIONS IF FUNCTION have_items() IS CALLED
    */
    /*
    NUMBER OF RESULTS
    */
    function results()
    {
        return $GLOBALS['have_items']['results'];
    }
    /*
    THIS PAGE IS
    */
    function page()
    {
        return $GLOBALS['have_items']['page'];
    }
    /*
    NUMBER OF PAGES
    */
    function pages()
    {
        return $GLOBALS['have_items']['pages'];
    }
    /*
    NEXT PAGE
    */
    function next_page()
    {
        if (!empty($GLOBALS['have_items']['next_page'])) {
            return $GLOBALS['have_items']['next_page'];
        }
        return false;
    }
    /*
    PREVIEW PAGE
    */
    function prev_page()
    {
        if (!empty($GLOBALS['have_items']['prev_page'])) {
            return $GLOBALS['have_items']['prev_page'];
        }
        return false;
    }
    return $GLOBALS['have_items']['results'];
}
Exemplo n.º 3
0
function have_items_custom($category = array())
{
    return \query\main::have_items($category);
}
Exemplo n.º 4
0
 public static function coupons($categories = array())
 {
     return \query\main::have_items($categories, '', array('only_count' => ''));
 }
Exemplo n.º 5
0
<form action="#" method="GET" autocomplete="off">
<input type="hidden" name="route" value="coupons.php" />
<input type="hidden" name="action" value="list" />';
        if (isset($_GET['orderby'])) {
            echo '<input type="hidden" name="orderby" value="' . htmlspecialchars($_GET['orderby']) . '" />';
        }
        if (isset($_GET['category'])) {
            echo '<input type="hidden" name="category" value="' . htmlspecialchars($_GET['category']) . '" />';
        }
        echo '<input type="search" name="search" value="' . (isset($_GET['search']) ? htmlspecialchars($_GET['search']) : '') . '" placeholder="' . $LANG['coupons_search_input'] . '" />
<button class="btn">' . $LANG['search'] . '</button>
</form>

</div>';
        $p = \query\main::have_items($options = array('per_page' => 10, 'store' => isset($_GET['store']) ? $_GET['store'] : '', 'user' => isset($_GET['user']) ? $_GET['user'] : '', 'categories' => isset($_GET['category']) ? $_GET['category'] : '', 'show' => isset($_GET['view']) ? $_GET['view'] : 'all', 'search' => isset($_GET['search']) ? urldecode($_GET['search']) : ''));
        echo '<div class="results">' . ((int) $p['results'] === 1 ? sprintf($LANG['result'], $p['results']) : sprintf($LANG['results'], $p['results']));
        if (!empty($_GET['store']) || !empty($_GET['user']) || !empty($_GET['category']) || !empty($_GET['view']) || !empty($_GET['search'])) {
            echo ' / <a href="?route=coupons.php&amp;action=list">' . $LANG['reset_view'] . '</a>';
        }
        echo '</div>';
        if ($p['results']) {
            echo '<form action="?route=coupons.php&amp;action=list" method="POST">

<ul class="elements-list">

<li class="head"><input type="checkbox" checkall /> ' . $LANG['name'] . '</li>';
            $ab_edt = ab_to(array('coupons' => 'edit'));
            $ab_del = ab_to(array('coupons' => 'delete'));
            if ($ab_del) {
                echo '<div class="bulk_options">';