Exemplo n.º 1
0
        DealCatalogHTML::addproductslistingdeals();
        break;
    case 'listdealsave':
        listdealsave();
        break;
    case 'myproductslisting':
        DealCatalogHTML::myproductslisting();
        break;
    case 'editproductlisting':
        DealCatalogHTML::editproductlisting();
        break;
    case 'listingsave':
        listingsave();
        break;
    case 'coupons':
        DealCatalogHTML::coupons();
        break;
    case 'merchantregister':
        DealCatalogHTML::merchantregister();
        break;
    case 'merchantsave':
        merchantsave();
        break;
    case 'merchantsuccess':
        merchantsuccess();
        break;
}
function coupon_email()
{
    $action = $_POST['action'];
    $customername = $_POST['customername'];
Exemplo n.º 2
0
function coupons()
{
    global $mainframe;
    $db =& JFactory::getDBO();
    $filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'id', 'cmd');
    $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
    $filter_state = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'word');
    $search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');
    $search = JString::strtolower($search);
    $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
    $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
    $where = array();
    if ($search) {
        $where[] = 'product_name LIKE "%' . $db->getEscaped($search) . '%"';
    }
    $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
    if ($filter_order == 'id') {
        $orderby = ' ORDER BY id';
    } else {
        $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . ', id';
    }
    // get the total number of records
    $query = 'SELECT COUNT(*)' . ' FROM #__deal_coupons' . $where;
    $db->setQuery($query);
    $total = $db->loadResult();
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    $query = "SELECT * FROM #__deal_coupons" . $where . $orderby;
    $db->setQuery($query, $pageNav->limitstart, $pageNav->limit);
    $rows = $db->loadObjectList();
    if ($db->getErrorNum()) {
        echo $db->stderr();
        return false;
    }
    // table ordering
    $lists['order_Dir'] = $filter_order_Dir;
    $lists['order'] = $filter_order;
    // search filter
    $lists['search'] = $search;
    DealCatalogHTML::coupons(&$rows, &$pageNav, &$lists);
    // Calling the products listing in html
}