本文整理汇总了PHP中Paging::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP Paging::reset方法的具体用法?PHP Paging::reset怎么用?PHP Paging::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paging
的用法示例。
在下文中一共展示了Paging::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view_list
//.........这里部分代码省略.........
$filter['status'] = array_keys($arrStatus);
}
//DBG::log("Orders::view_list(): URI for Sorting: $uri, decoded ".html_entity_decode($uri));
$arrSorting = array('id' => $_ARRAYLANG['TXT_SHOP_ID'], 'date_time' => $_ARRAYLANG['TXT_SHOP_ORDER_DATE'], 'customer_name' => $_ARRAYLANG['TXT_SHOP_CUSTOMER'], 'sum' => $_ARRAYLANG['TXT_SHOP_ORDER_SUM'], 'status' => $_ARRAYLANG['TXT_SHOP_ORDER_STATUS']);
$objSorting = new \Sorting($uri, $arrSorting, false, 'order_shop_orders');
$uri_search = $uri;
\Html::stripUriParam($uri_search, 'searchterm');
\Html::stripUriParam($uri_search, 'customer_type');
\Html::stripUriParam($uri_search, 'status');
\Html::stripUriParam($uri_search, 'show_pending_orders');
$objTemplate->setGlobalVariable($_ARRAYLANG);
if ($backend) {
$txt_order_complete = sprintf($_ARRAYLANG['TXT_SEND_TEMPLATE_TO_CUSTOMER'], $_ARRAYLANG['TXT_ORDER_COMPLETE']);
$objTemplate->setVariable(array('SHOP_SEND_TEMPLATE_TO_CUSTOMER' => $txt_order_complete, 'SHOP_CUSTOMER_TYPE_MENUOPTIONS' => Customers::getTypeMenuoptions($customer_type, true), 'SHOP_CUSTOMER_SORT_MENUOPTIONS' => Customers::getSortMenuoptions($objSorting->getOrderField()), 'SHOP_SHOW_PENDING_ORDERS_CHECKED' => $show_pending_orders ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_ORDER_STATUS_MENUOPTIONS' => self::getStatusMenuoptions($status, true)));
}
//DBG::log("Orders::view_list(): Order complete: $txt_order_complete");
//DBG::log("Orders::view_list(): URI: $uri");
$objTemplate->setGlobalVariable(array('SHOP_SEARCH_TERM' => isset($filter['term']) ? $filter['term'] : '', 'SHOP_ORDERS_ORDER_NAME' => $objSorting->getOrderParameterName(), 'SHOP_ORDERS_ORDER_VALUE' => $objSorting->getOrderUriEncoded(), 'SHOP_ACTION_URI_SEARCH_ENCODED' => $uri_search, 'SHOP_ACTION_URI_ENCODED' => $uri, 'SHOP_ACTION_URI' => html_entity_decode($uri), 'SHOP_CURRENCY', Currency::getDefaultCurrencySymbol()));
$count = 0;
$limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_orders_per_page_backend', 'Shop');
// TODO: Obsolete ASAP
if (!$limit) {
ShopSettings::errorHandler();
$limit = 25;
}
$tries = 2;
$arrOrders = null;
//\DBG::activate(DBG_DB_FIREPHP);
while ($tries-- && $count == 0) {
$arrOrders = self::getArray($count, $objSorting->getOrder(), $filter, \Paging::getPosition(), $limit);
if ($count > 0) {
break;
}
\Paging::reset();
}
//DBG::deactivate(DBG_DB);
//\DBG::log("Orders: ".count($arrOrders));
$paging = \Paging::get($uri, $_ARRAYLANG['TXT_ORDERS'], $count, $limit, $count > 0);
$objTemplate->setVariable(array('SHOP_ORDER_PAGING' => $paging, 'SHOP_CUSTOMER_LISTLETTER' => isset($filter['letter']) ? $filter['letter'] : '', 'SHOP_HEADER_ID' => $objSorting->getHeaderForField('id'), 'SHOP_HEADER_DATE_TIME' => $objSorting->getHeaderForField('date_time'), 'SHOP_HEADER_STATUS' => $objSorting->getHeaderForField('status'), 'SHOP_HEADER_CUSTOMER_NAME' => $objSorting->getHeaderForField('customer_name'), 'SHOP_HEADER_NOTES' => $_ARRAYLANG['TXT_SHOP_ORDER_NOTES'], 'SHOP_HEADER_SUM' => $objSorting->getHeaderForField('sum'), 'SHOP_LISTLETTER_LINKS' => self::getListletterLinks(isset($filter['letter']) ? $filter['letter'] : NULL)));
if (empty($arrOrders)) {
// $objTemplate->hideBlock('orderTable');
$objTemplate->setVariable('SHOP_ORDER_NONE_FOUND', $_ARRAYLANG['TXT_SHOP_ORDERS_NONE_FOUND']);
//\DBG::log("NO Orders!");
return true;
}
$i = 0;
// TODO: For Order export
/* $min_date = '9999-00-00 00:00:00';
$max_date = '0000-00-00 00:00:00';
$min_id = 1e10;
$max_id = 0;*/
foreach ($arrOrders as $objOrder) {
$order_id = $objOrder->id();
// Custom order ID may be created and used as account name.
// Adapt the method as needed.
// $order_id_custom = ShopLibrary::getCustomOrderId(
// $order_id, $objOrder->date_time()
// );
// Take billing address from the Order.
// No need to load the Customer.
$customer_name = '';
$company = $objOrder->billing_company();
$customer_name = $company ? $company : $objOrder->billing_lastname() . ' ' . $objOrder->billing_firstname();
$tipNote = $objOrder->note();
$tipLink = empty($tipNote) ? '' : '<span class="tooltip-trigger icon-comment"></span>' . '<span class="tooltip-message">' . preg_replace('/[\\n\\r]+/', '<br />', nl2br(contrexx_raw2xhtml($tipNote))) . '</span>';
$status = $objOrder->status();
示例2: view_product_overview
/**
* Show Products
*/
function view_product_overview()
{
global $_ARRAYLANG;
if (isset($_POST['bsubmit'])) {
$this->update_products();
}
if (isset($_POST['multi_action'])) {
if ($_POST['multi_action'] == 'activate') {
Products::set_active($_POST['selectedProductId'], true);
} elseif ($_POST['multi_action'] == 'deactivate') {
Products::set_active($_POST['selectedProductId'], false);
}
}
self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_product_catalog.html');
self::$objTemplate->setGlobalVariable($_ARRAYLANG);
$category_id = empty($_REQUEST['category_id']) ? null : intval($_REQUEST['category_id']);
//DBG::log("Requested Category ID: $category_id");
$manufacturer_id = empty($_REQUEST['manufacturer_id']) ? null : intval($_REQUEST['manufacturer_id']);
$flagSpecialoffer = isset($_REQUEST['specialoffer']);
$searchTerm = empty($_REQUEST['searchterm']) ? null : trim(contrexx_input2raw($_REQUEST['searchterm']));
$url = \Html::getRelativeUri();
// TODO: Strip URL parameters: Which?
// \Html::stripUriParam($url, '');
$arrSorting = array('`product`.`id`' => $_ARRAYLANG['TXT_SHOP_ID'], '`product`.`active`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_ACTIVE'], '`product`.`ord`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_ORDER'], 'name' => $_ARRAYLANG['TXT_SHOP_PRODUCT_NAME'], 'code' => $_ARRAYLANG['TXT_SHOP_PRODUCT_CODE'], '`product`.`discountprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_DISCOUNTPRICE'], '`product`.`normalprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_NORMALPRICE'], '`product`.`resellerprice`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_RESELLERPRICE'], '`product`.`distribution`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_DISTRIBUTION'], '`product`.`stock`' => $_ARRAYLANG['TXT_SHOP_PRODUCT_STOCK']);
$objSorting = new \Sorting($url, $arrSorting, false, 'order_shop_product');
$limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_products_per_page_backend', 'Shop');
$tries = 2;
while ($tries--) {
// have to set $count again because it will be set to 0 in Products::getByShopParams
$count = $limit;
// Mind that $count is handed over by reference.
$arrProducts = Products::getByShopParams($count, \Paging::getPosition(), 0, $category_id, $manufacturer_id, $searchTerm, $flagSpecialoffer, false, $objSorting->getOrder(), null, true);
if (count($arrProducts) > 0 || \Paging::getPosition() == 0) {
break;
}
\Paging::reset();
}
self::$objTemplate->setVariable(array('SHOP_CATEGORY_MENU' => \Html::getSelect('category_id', array(0 => $_ARRAYLANG['TXT_ALL_PRODUCT_GROUPS']) + ShopCategories::getNameArray(), $category_id), 'SHOP_SEARCH_TERM' => $searchTerm, 'SHOP_PRODUCT_TOTAL' => $count));
if (empty($arrProducts)) {
self::$objTemplate->touchBlock('no_product');
return true;
}
self::$objTemplate->setVariable(array('SHOP_PRODUCT_PAGING' => \Paging::get($url, '<b>' . $_ARRAYLANG['TXT_PRODUCTS'] . '</b>', $count, $limit, true), 'SHOP_HEADING_PRODUCT_ID' => $objSorting->getHeaderForField('`product`.`id`'), 'SHOP_HEADING_PRODUCT_ACTIVE' => $objSorting->getHeaderForField('`product`.`active`'), 'SHOP_HEADING_PRODUCT_ORD' => $objSorting->getHeaderForField('`product`.`ord`'), 'SHOP_HEADING_PRODUCT_NAME' => $objSorting->getHeaderForField('name'), 'SHOP_HEADING_PRODUCT_CODE' => $objSorting->getHeaderForField('code'), 'SHOP_HEADING_PRODUCT_DISCOUNTPRICE' => $objSorting->getHeaderForField('`product`.`discountprice`'), 'SHOP_HEADING_PRODUCT_NORMALPRICE' => $objSorting->getHeaderForField('`product`.`normalprice`'), 'SHOP_HEADING_PRODUCT_RESELLERPRICE' => $objSorting->getHeaderForField('`product`.`resellerprice`'), 'SHOP_HEADING_PRODUCT_DISTRIBUTION' => $objSorting->getHeaderForField('`product`.`distribution`'), 'SHOP_HEADING_PRODUCT_STOCK' => $objSorting->getHeaderForField('`product`.`stock`')));
$arrLanguages = \FWLanguage::getActiveFrontendLanguages();
// Intended to show an edit link for all active frontend languages.
// However, the design doesn't like it. Limit to the current one.
$arrLanguages = array(FRONTEND_LANG_ID => $arrLanguages[FRONTEND_LANG_ID]);
$i = 0;
foreach ($arrProducts as $objProduct) {
$productStatus = '';
$productStatusValue = '';
$productStatusPicture = 'status_red.gif';
if ($objProduct->active()) {
$productStatus = \Html::ATTRIBUTE_CHECKED;
$productStatusValue = 1;
$productStatusPicture = 'status_green.gif';
}
$discount_active = '';
$specialOfferValue = '';
if ($objProduct->discount_active()) {
$discount_active = \Html::ATTRIBUTE_CHECKED;
$specialOfferValue = 1;
}
self::$objTemplate->setGlobalVariable(array('SHOP_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_PRODUCT_ID' => $objProduct->id(), 'SHOP_PRODUCT_CODE' => $objProduct->code(), 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name()), 'SHOP_PRODUCT_PRICE1' => Currency::formatPrice($objProduct->price()), 'SHOP_PRODUCT_PRICE2' => Currency::formatPrice($objProduct->resellerprice()), 'SHOP_PRODUCT_DISCOUNT' => Currency::formatPrice($objProduct->discountprice()), 'SHOP_PRODUCT_SPECIAL_OFFER' => $discount_active, 'SHOP_SPECIAL_OFFER_VALUE_OLD' => $specialOfferValue, 'SHOP_PRODUCT_VAT_MENU' => Vat::getShortMenuString($objProduct->vat_id(), 'taxId[' . $objProduct->id() . ']'), 'SHOP_PRODUCT_VAT_ID' => $objProduct->vat_id() ? $objProduct->vat_id() : 'NULL', 'SHOP_PRODUCT_DISTRIBUTION' => $objProduct->distribution(), 'SHOP_PRODUCT_STOCK' => $objProduct->stock(), 'SHOP_PRODUCT_SHORT_DESC' => $objProduct->short(), 'SHOP_PRODUCT_STATUS' => $productStatus, 'SHOP_PRODUCT_STATUS_PICTURE' => $productStatusPicture, 'SHOP_ACTIVE_VALUE_OLD' => $productStatusValue, 'SHOP_SORT_ORDER' => $objProduct->ord(), 'SHOP_DISTRIBUTION' => $_ARRAYLANG['TXT_DISTRIBUTION_' . strtoupper($objProduct->distribution())], 'SHOP_SHOW_PRODUCT_ON_START_PAGE_CHECKED' => $objProduct->shown_on_startpage() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_SHOW_PRODUCT_ON_START_PAGE_OLD' => $objProduct->shown_on_startpage() ? '1' : '', 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name())));
// All languages active
foreach ($arrLanguages as $lang_id => $arrLanguage) {
self::$objTemplate->setVariable(array('SHOP_PRODUCT_LANGUAGE_ID' => $lang_id, 'SHOP_PRODUCT_LANGUAGE_EDIT' => sprintf($_ARRAYLANG['TXT_SHOP_PRODUCT_LANGUAGE_EDIT'], $lang_id, $arrLanguage['lang'], $arrLanguage['name'])));
self::$objTemplate->parse('product_language');
}
self::$objTemplate->touchBlock('productRow');
self::$objTemplate->parse('productRow');
}
return true;
}