当前位置: 首页>>代码示例>>PHP>>正文


PHP Paging::getPosition方法代码示例

本文整理汇总了PHP中Paging::getPosition方法的典型用法代码示例。如果您正苦于以下问题:PHP Paging::getPosition方法的具体用法?PHP Paging::getPosition怎么用?PHP Paging::getPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paging的用法示例。


在下文中一共展示了Paging::getPosition方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: view_product_overview


//.........这里部分代码省略.........
     // any case, methinks!
     if ($category_id > 0 && $term == '') {
         $flagSpecialoffer = false;
         $pagingCatId = "&catId={$category_id}";
     }
     if ($manufacturer_id > 0) {
         $flagSpecialoffer = false;
         $pagingManId = "&manufacturer_id={$manufacturer_id}";
     }
     if ($term != '') {
         $flagSpecialoffer = false;
         $pagingTerm = '&term=' . htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET);
     }
     // The Product count is passed by reference and set to the total
     // number of records, though only as many as specified by the core
     // paging limit are returned in the array.
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_products_per_page_frontend', 'Shop');
     //\DBG::activate(DBG_ERROR_FIREPHP);
     // Use Sorting class for the Product order
     $uri = \Html::getRelativeUri_entities();
     $arrOrder = array('product.ord' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_ORD'], 'name' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_TITLE'], 'code' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_CODE'], 'price' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_PRICE'], 'id' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_DATE'], 'bestseller' => $_ARRAYLANG['TXT_SHOP_ORDER_PRODUCT_BESTSELLER']);
     $defaultOrder = \Sorting::getFieldindex(Products::$arrProductOrder[\Cx\Core\Setting\Controller\Setting::getValue('product_sorting', 'Shop')]);
     $objSorting = new \Sorting($uri, $arrOrder, true, 'shop_order_products', $defaultOrder);
     //\DBG::log("Sorting headers: ".var_export($objSorting->getHeaderArray(), true));
     $count = $limit;
     $arrProduct = array();
     if ($product_ids) {
         $arrProduct = self::getValidProducts($product_ids);
         $product_id = null;
         // Suppress meta title from single Product
     } elseif ($product_id) {
         $arrProduct = self::getValidProducts(array($product_id));
     } else {
         $arrProduct = Products::getByShopParams($count, \Paging::getPosition(), $product_id, $category_id, $manufacturer_id, $term, $flagSpecialoffer, $flagLastFive, $objSorting->getOrder(), self::$objCustomer && self::$objCustomer->is_reseller());
     }
     // Only show sorting when there's enough to be sorted
     if ($count > 1) {
         $objSorting->parseHeaders(self::$objTemplate, 'shop_product_order');
     }
     if ($count == 0 && !ShopCategories::getChildCategoryIdArray($category_id)) {
         //if ($term != '' || $manufacturer_id != 0 || $flagSpecialoffer) {
         if (self::$objTemplate->blockExists('no_product')) {
             self::$objTemplate->touchBlock('no_product');
         }
         return true;
     }
     if ($objCategory) {
         // Only indicate the category name when there are products
         if ($count) {
             self::$objTemplate->setVariable(array('SHOP_CATEGORY_CURRENT_NAME' => contrexx_raw2xhtml($objCategory->name()), 'SHOP_PRODUCTS_IN_CATEGORY' => sprintf($_ARRAYLANG['TXT_SHOP_PRODUCTS_IN_CATEGORY'], contrexx_raw2xhtml($objCategory->name()))));
         }
     } else {
         // TODO: There are other cases of flag combinations that are not indivuidually
         // handled here yet.
         if ($term == '') {
             if ($flagSpecialoffer == Products::DEFAULT_VIEW_DISCOUNTS) {
                 self::$objTemplate->setVariable('SHOP_PRODUCTS_IN_CATEGORY', $_ARRAYLANG['TXT_SHOP_PRODUCTS_SPECIAL_OFFER']);
             } else {
                 if (self::$objTemplate->blockExists('products_in_category')) {
                     self::$objTemplate->hideBlock('products_in_category');
                 }
             }
         } else {
             self::$objTemplate->setVariable('SHOP_PRODUCTS_IN_CATEGORY', sprintf($_ARRAYLANG['TXT_SHOP_PRODUCTS_SEARCH_RESULTS'], contrexx_raw2xhtml($term)));
         }
     }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:67,代码来源:Shop.class.php

示例2: edit

 /**
  * Edit coupons
  * @param   \Cx\Core\Html\Sigma   $objTemplate    The Template
  */
 static function edit($objTemplate)
 {
     global $_ARRAYLANG;
     //DBG::activate(DBG_ADODB|DBG_LOG_FIREPHP|DBG_PHP);
     $result = true;
     if (isset($_GET['delete'])) {
         list($code, $customer_id) = explode('-', $_GET['delete']);
         $result &= self::delete(contrexx_input2raw($code), intval($customer_id));
     }
     $edit = isset($_REQUEST['edit']) ? contrexx_input2raw($_REQUEST['edit']) : null;
     //DBG::log("Edit: ".($edit ? $edit : 'NULL'));
     $code = isset($_POST['code']) ? contrexx_input2raw($_POST['code']) : null;
     $payment_id = empty($_POST['payment_id']) ? 0 : intval($_POST['payment_id']);
     $start_time = empty($_POST['start_date']) ? 0 : strtotime(contrexx_input2raw($_POST['start_date']));
     $end_time = empty($_POST['end_date_unlimited']) ? empty($_POST['end_date']) ? 0 : strtotime(contrexx_input2raw($_POST['end_date'])) : 0;
     $coupon_type = empty($_POST['coupon_type']) ? null : contrexx_input2raw($_POST['coupon_type']);
     $discount_rate = intval(empty($_POST['discount_rate']) ? 0 : floatval($_POST['discount_rate']));
     $discount_amount = Currency::formatPrice(empty($_POST['discount_amount']) ? 0 : floatval($_POST['discount_amount']));
     if ($coupon_type == 'rate') {
         $discount_amount = 0;
     }
     if ($coupon_type == 'amount') {
         $discount_rate = 0;
     }
     $minimum_amount = Currency::formatPrice(empty($_POST['minimum_amount']) ? 0 : floatval($_POST['minimum_amount']));
     $uses = empty($_POST['unlimited']) ? empty($_POST['uses']) ? 1 : intval($_POST['uses']) : self::USES_UNLIMITED;
     $customer_id = empty($_POST['customer_id']) ? 0 : intval($_POST['customer_id']);
     $product_id = empty($_POST['product_id']) ? 0 : intval($_POST['product_id']);
     $global = !empty($_POST['global_or_customer']);
     //DBG::log("code $code, start_time $start_time, end_time $end_time, minimum amount $minimum_amount, discount_rate $discount_rate, discount_amount $discount_amount, uses $uses, customer_id $customer_id");
     if (isset($code)) {
         $result &= self::storeCode($code, $payment_id, $minimum_amount, $discount_rate, $discount_amount, $start_time, $end_time, $uses, $global, $customer_id, $product_id, $edit);
         if ($result) {
             $code = $edit = null;
         } else {
             if (empty($edit)) {
                 $edit = "{$code}-{$customer_id}";
             }
         }
     }
     // Reset the end time if it's in the past
     if ($end_time < time()) {
         $end_time = 0;
     }
     $uri = \Html::getRelativeUri();
     \Html::stripUriParam($uri, 'view');
     \Html::stripUriParam($uri, 'edit');
     \Html::stripUriParam($uri, 'order_coupon');
     $arrSortingFields = array('code' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODE'], 'start_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_START_TIME'], 'end_time' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME'], 'minimum_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'discount_rate' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_RATE'], 'discount_amount' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'uses' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES'], 'global' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_SCOPE'], 'customer_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CUSTOMER'], 'product_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT'], 'payment_id' => $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT']);
     $objSorting = new \Sorting($uri, $arrSortingFields, true, 'order_coupon');
     $objTemplate->setGlobalVariable($_ARRAYLANG + array('TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_AMOUNT_FORMAT'], Currency::getDefaultCurrencyCode()), 'TXT_SHOP_DISCOUNT_COUPON_ADD_OR_EDIT' => $_ARRAYLANG[$edit ? 'TXT_SHOP_DISCOUNT_COUPON_EDIT' : 'TXT_SHOP_DISCOUNT_COUPON_ADD'], 'SHOP_DISCOUNT_COUPON_VIEW_ACTIVE' => $edit ? '' : 'active', 'SHOP_DISCOUNT_COUPON_EDIT_ACTIVE' => $edit ? 'active' : '', 'SHOP_DISCOUNT_COUPON_VIEW_DISPLAY' => $edit ? 'none' : 'block', 'SHOP_DISCOUNT_COUPON_EDIT_DISPLAY' => $edit ? 'block' : 'none', 'HEADER_SHOP_DISCOUNT_COUPON_CODE' => $objSorting->getHeaderForField('code'), 'HEADER_SHOP_DISCOUNT_COUPON_START_TIME' => $objSorting->getHeaderForField('start_time'), 'HEADER_SHOP_DISCOUNT_COUPON_END_TIME' => $objSorting->getHeaderForField('end_time'), 'HEADER_SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('minimum_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_RATE' => $objSorting->getHeaderForField('discount_rate'), 'HEADER_SHOP_DISCOUNT_COUPON_AMOUNT_CURRENCY' => $objSorting->getHeaderForField('discount_amount'), 'HEADER_SHOP_DISCOUNT_COUPON_USES' => $objSorting->getHeaderForField('uses'), 'HEADER_SHOP_DISCOUNT_COUPON_SCOPE' => $objSorting->getHeaderForField('global'), 'HEADER_SHOP_DISCOUNT_COUPON_CUSTOMER' => $objSorting->getHeaderForField('customer_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PRODUCT' => $objSorting->getHeaderForField('product_id'), 'HEADER_SHOP_DISCOUNT_COUPON_PAYMENT' => $objSorting->getHeaderForField('payment_id')));
     $count = 0;
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_coupon_per_page_backend', 'Shop');
     if (empty($limit)) {
         self::errorHandler();
     }
     $arrCoupons = self::getArray(\Paging::getPosition(), $limit, $count, $objSorting->getOrder());
     $arrProductName = Products::getNameArray(true, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_FORMAT']);
     $arrPaymentName = Payment::getNameArray();
     $i = 0;
     $row = 0;
     $objCouponEdit = new Coupon();
     $objCouponEdit->code($code);
     $objCouponEdit->payment_id($payment_id);
     $objCouponEdit->minimum_amount($minimum_amount);
     $objCouponEdit->discount_rate($discount_rate);
     $objCouponEdit->discount_amount($discount_amount);
     $objCouponEdit->start_time($start_time);
     $objCouponEdit->end_time($end_time);
     $objCouponEdit->uses($uses);
     $objCouponEdit->is_global($global);
     $objCouponEdit->customer_id($customer_id);
     $objCouponEdit->product_id($product_id);
     global $_CONFIG;
     foreach ($arrCoupons as $index => $objCoupon) {
         $coupon_uri_id = 'coupon_uri_' . $index;
         $objTemplate->setVariable(array('SHOP_ROWCLASS' => 'row' . (++$row % 2 + 1), 'SHOP_DISCOUNT_COUPON_CODE' => $objCoupon->code, 'SHOP_DISCOUNT_COUPON_URI_ICON' => '<div class="icon_url"' . '>&nbsp;</div>', 'SHOP_DISCOUNT_COUPON_URI_INPUT' => '<div class="layer_url" id="' . $coupon_uri_id . '">' . \Html::getInputText('dummy', 'http://' . $_CONFIG['domainUrl'] . \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Shop' . MODULE_INDEX . '&coupon_code=' . $objCoupon->code, false, 'readonly="readonly"' . ' style="width: 200px;"' . ' onfocus="this.select();"' . ' onblur="cx.jQuery(\'#' . $coupon_uri_id . '\').hide();"') . '</div>', 'SHOP_DISCOUNT_COUPON_START_TIME' => $objCoupon->start_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->start_time) : $_ARRAYLANG['TXT_SHOP_DATE_NONE'], 'SHOP_DISCOUNT_COUPON_END_TIME' => $objCoupon->end_time ? date(ASCMS_DATE_FORMAT_DATE, $objCoupon->end_time) : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_END_TIME_UNLIMITED'], 'SHOP_DISCOUNT_COUPON_MINIMUM_AMOUNT' => $objCoupon->minimum_amount > 0 ? $objCoupon->minimum_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_RATE' => $objCoupon->discount_rate > 0 ? $objCoupon->discount_rate : $_ARRAYLANG['TXT_SHOP_RATE_NONE'], 'SHOP_DISCOUNT_COUPON_AMOUNT' => $objCoupon->discount_amount > 0 ? $objCoupon->discount_amount : $_ARRAYLANG['TXT_SHOP_AMOUNT_NONE'], 'SHOP_DISCOUNT_COUPON_USES' => sprintf($_ARRAYLANG['TXT_SHOP_COUPON_USES_FORMAT'], $objCoupon->used, $objCoupon->uses < 1000000000.0 ? $objCoupon->uses : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_USES_UNLIMITED']), 'SHOP_DISCOUNT_COUPON_SCOPE' => $objCoupon->global ? $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_GLOBALLY'] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PER_CUSTOMER'], 'SHOP_DISCOUNT_COUPON_PER_CUSTOMER' => !$objCoupon->global ? \Html::getRadio('foo_' . ++$i, '', false, true, '', \Html::ATTRIBUTE_DISABLED) : '&nbsp;', 'SHOP_DISCOUNT_COUPON_CUSTOMER' => $objCoupon->customer_id ? Customers::getNameById($objCoupon->customer_id, '%4$s (%3$u)') : $_ARRAYLANG['TXT_SHOP_CUSTOMER_ANY'], 'SHOP_DISCOUNT_COUPON_PRODUCT' => $objCoupon->product_id ? isset($arrProductName[$objCoupon->product_id]) ? $arrProductName[$objCoupon->product_id] : $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PRODUCT_INVALID'] : $_ARRAYLANG['TXT_SHOP_PRODUCT_ANY'], 'SHOP_DISCOUNT_COUPON_PAYMENT' => $objCoupon->payment_id ? sprintf($_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_PAYMENT_FORMAT'], $objCoupon->payment_id, $arrPaymentName[$objCoupon->payment_id]) : $_ARRAYLANG['TXT_SHOP_PAYMENT_ANY'], 'SHOP_DISCOUNT_COUPON_FUNCTIONS' => \Html::getBackendFunctions(array('edit' => ADMIN_SCRIPT_PATH . '?cmd=Shop&amp;act=settings&amp;tpl=coupon&amp;edit=' . urlencode($index), 'delete' => "javascript:delete_coupon('" . urlencode($index) . "');"))));
         $objTemplate->parse('shopDiscountCouponView');
         if ($index === $edit) {
             $objCouponEdit = $objCoupon;
         }
     }
     $objTemplate->replaceBlock('shopDiscountCouponView', '', true);
     $paging = \Paging::get($uri, $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_CODES'], $count, $limit);
     //DBG::log("Paging: $paging");
     $objTemplate->setVariable('SHOP_PAGING', $paging);
     $attribute_code = 'style="width: 230px; text-align: left;" maxlength="20"';
     $attribute_time = 'style="width: 230px; text-align: left;" maxlength="10"';
     $attribute_discount_rate = 'style="width: 230px; text-align: right;" maxlength="3"';
     $attribute_discount_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_minimum_amount = 'style="width: 230px; text-align: right;" maxlength="9"';
     $attribute_uses = 'style="width: 230px; text-align: right;" maxlength="6"';
     // Superseded by the widget, see below
     //        $attribute_customer = 'style="width: 230px;"';
     $attribute_product = 'style="width: 230px;"';
     $attribute_payment = 'style="width: 230px;"';
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:Coupon.class.php

示例3: view_list


//.........这里部分代码省略.........
             \Html::replaceUriParameter($uri, 'show_pending_orders=1');
         }
     }
     if ($arrStatus) {
         $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();
开发者ID:Niggu,项目名称:cloudrexx,代码行数:67,代码来源:Orders.class.php

示例4: settings

 /**
  * Sets up the Country settings page
  * @return  string          The page content
  */
 static function settings()
 {
     global $_CORELANG;
     $objTemplateCountry = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/Country/View/Template/Generic');
     $objTemplateCountry->loadTemplateFile('Overview.html');
     // Adds messages
     self::storeSettings();
     self::storeFromPost();
     $uri = \Html::getRelativeUri();
     // Let all links in this tab point here again
     \Html::replaceUriParameter($uri, 'active_tab=' . \Cx\Core\Setting\Controller\Setting::tab_index());
     // Create a copy of the URI for the Paging, as this is passed by
     // reference and modified
     $uri_paging = $uri;
     //DBG::log("URI: $uri");
     $objSorting = new Sorting($uri, array('id' => $_CORELANG['TXT_CORE_COUNTRY_ID'], 'active' => $_CORELANG['TXT_CORE_COUNTRY_ACTIVE'], 'ord' => $_CORELANG['TXT_CORE_COUNTRY_ORD'], 'name' => $_CORELANG['TXT_CORE_COUNTRY_NAME'], 'alpha2' => $_CORELANG['TXT_CORE_COUNTRY_ISO2'], 'alpha3' => $_CORELANG['TXT_CORE_COUNTRY_ISO3']), true, 'order_country');
     \Cx\Core\Setting\Controller\Setting::init('core', 'country');
     $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_countries_per_page_backend', 'core');
     $count = 0;
     $arrCountries = self::getArray($count, null, $limit, \Paging::getPosition(), $objSorting->getOrder());
     if ($arrCountries === false) {
         return \Message::error($_CORELANG['TXT_CORE_COUNTRY_ERROR_INITIALIZING']);
     }
     $objTemplateCountry->setGlobalVariable($_CORELANG + array('CORE_COUNTRY' => $_CORELANG['TXT_CORE_COUNTRY'] . ' ' . sprintf($_CORELANG['TXT_CORE_TOTAL'], $count), 'HEAD_SETTINGS_COUNTRY_ID' => $objSorting->getHeaderForField('id'), 'HEAD_SETTINGS_COUNTRY_ACTIVE' => $objSorting->getHeaderForField('active'), 'HEAD_SETTINGS_COUNTRY_ORD' => $objSorting->getHeaderForField('ord'), 'HEAD_SETTINGS_COUNTRY_NAME' => $objSorting->getHeaderForField('name'), 'HEAD_SETTINGS_COUNTRY_ISO2' => $objSorting->getHeaderForField('alpha2'), 'HEAD_SETTINGS_COUNTRY_ISO3' => $objSorting->getHeaderForField('alpha3'), 'CORE_SETTING_TAB_INDEX' => \Cx\Core\Setting\Controller\Setting::tab_index(), 'SETTINGS_COUNTRY_PAGING' => \Paging::get($uri_paging, '', $count, $limit, true)));
     // Note:  Optionally disable the block 'settings_country_submit'
     // to disable storing changes
     $i = 0;
     foreach ($arrCountries as $country_id => $arrCountry) {
         $objTemplateCountry->setVariable(array('SETTINGS_COUNTRY_ROWCLASS' => ++$i % 2 + 1, 'SETTINGS_COUNTRY_ID' => $country_id, 'SETTINGS_COUNTRY_ACTIVE' => $arrCountry['active'] ? \Html::ATTRIBUTE_CHECKED : '', 'SETTINGS_COUNTRY_ORD' => $arrCountry['ord'], 'SETTINGS_COUNTRY_NAME' => $arrCountry['name'], 'SETTINGS_COUNTRY_ISO2' => $arrCountry['alpha2'], 'SETTINGS_COUNTRY_ISO3' => $arrCountry['alpha3'], 'SETTINGS_FUNCTIONS' => \Html::getBackendFunctions(array('delete' => 'delete_country_id=' . $country_id), array('delete' => $_CORELANG['TXT_CORE_COUNTRY_CONFIRM_DELETE'] . "\\n" . $_CORELANG['TXT_ACTION_IS_IRREVERSIBLE']))));
         $objTemplateCountry->parse('settings_country_row');
     }
     $objTemplateSetting = null;
     \Cx\Core\Setting\Controller\Setting::show_external($objTemplateSetting, $_CORELANG['TXT_CORE_COUNTRY_EDIT'], $objTemplateCountry->get());
     \Cx\Core\Setting\Controller\Setting::show($objTemplateSetting, $uri, $_CORELANG['TXT_CORE_COUNTRY_SETTINGS'], $_CORELANG['TXT_CORE_COUNTRY_SETTINGS']);
     return $objTemplateSetting->get();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:40,代码来源:Country.class.php

示例5: 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;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:77,代码来源:ShopManager.class.php

示例6: overview

 /**
  * Show on overview of the mail templates for the given section and group
  *
  * If empty, the $limit defaults to the
  * "numof_mailtemplate_per_page_backend" setting for the given section
  * and group.
  * @param   string    $section      The section
  * @param   string    $group        The group
  * @param   integer   $limit        The optional limit for the number
  *                                  of templates to be shown
  * @param   string   $act           The action of the mail template
  *                                  default set to mailtemplate_overview
  * @return  \Cx\Core\Html\Sigma     The template object
  */
 static function overview($section, $group, $limit = 0, $useDefaultActs = true, $act = 'mailtemplate_edit')
 {
     global $_CORELANG;
     $objTemplateLocal = new \Cx\Core\Html\Sigma(\Env::get('cx')->getCodeBaseCorePath() . '/MailTemplate/View/Template/Generic');
     $objTemplateLocal->setErrorHandling(PEAR_ERROR_DIE);
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTemplateLocal);
     if (!$objTemplateLocal->loadTemplateFile('Overview.html')) {
         die("Failed to load template Overview.html");
     }
     if (empty($section) || empty($group)) {
         \Message::error($_CORELANG['TXT_CORE_MAILTEMPLATE_ERROR_NO_SECTION_OR_GROUP']);
         return false;
     }
     if (empty($limit)) {
         \Cx\Core\Setting\Controller\Setting::init($section, $group);
         $limit = \Cx\Core\Setting\Controller\Setting::getValue('numof_mailtemplate_per_page_backend', $section);
         // TODO: TEMPORARY
         if (is_null($limit)) {
             $limit = 25;
             \Cx\Core\Setting\Controller\Setting::add('numof_mailtemplate_per_page_backend', $limit, 1001, 'text', '', $group);
         }
     }
     $uri = \Html::getRelativeUri_entities();
     $tab_index = \Cx\Core\Setting\Controller\Setting::tab_index();
     \Html::replaceUriParameter($uri, 'active_tab=' . $tab_index);
     \Html::replaceUriParameter($uri, 'userFrontendLangId=' . FRONTEND_LANG_ID);
     //echo("Made uri for sorting: ".htmlentities($uri)."<br />");
     \Html::stripUriParam($uri, 'key');
     \Html::stripUriParam($uri, 'delete_mailtemplate_key');
     $uri_edit = $uri_overview = $uri;
     //echo("Made uri for sorting: ".htmlentities($uri)."<br />");
     if ($useDefaultActs) {
         \Html::stripUriParam($uri, 'act');
         \Html::replaceUriParameter($uri_edit, 'act=mailtemplate_edit');
         \Html::replaceUriParameter($uri_overview, 'act=mailtemplate_overview');
     }
     $objSorting = new \Sorting($uri_overview, array('name' => $_CORELANG['TXT_CORE_MAILTEMPLATE_NAME'], 'key' => $_CORELANG['TXT_CORE_MAILTEMPLATE_KEY'], 'html' => $_CORELANG['TXT_CORE_MAILTEMPLATE_IS_HTML'], 'protected' => $_CORELANG['TXT_CORE_MAILTEMPLATE_PROTECTED']), true, 'order_mailtemplate');
     $count = 0;
     // Template titles are shown in the current language only, no need
     // (and no way either) to load them all.  Names are shown in the
     // currently active frontend language only.
     $pagingParameterName = $section . '_' . $group;
     $arrTemplates = self::getArray($section, FRONTEND_LANG_ID, $objSorting->getOrder(), \Paging::getPosition($pagingParameterName), $limit, $count);
     $arrLanguageName = \FWLanguage::getNameArray();
     $objTemplateLocal->setGlobalVariable($_CORELANG + array('CORE_MAILTEMPLATE_NAME' => $objSorting->getHeaderForField('name'), 'CORE_MAILTEMPLATE_KEY' => $objSorting->getHeaderForField('key'), 'CORE_MAILTEMPLATE_HTML' => $objSorting->getHeaderForField('html'), 'CORE_MAILTEMPLATE_PROTECTED' => $objSorting->getHeaderForField('protected'), 'PAGING' => \Paging::get($uri_overview, $_CORELANG['TXT_CORE_MAILTEMPLATE_PAGING'], $count, $limit, true, null, $pagingParameterName), 'URI_BASE' => $uri, 'URI_EDIT' => $uri_edit, 'CORE_MAILTEMPLATE_COLSPAN' => 5 + count($arrLanguageName)));
     foreach ($arrLanguageName as $language_name) {
         $objTemplateLocal->setVariable('MAILTEMPLATE_LANGUAGE_HEADER', $language_name);
         $objTemplateLocal->parse('core_mailtemplate_language_header');
     }
     if (empty($arrTemplates)) {
         \Message::information($_CORELANG['TXT_CORE_MAILTEMPLATE_WARNING_NONE']);
         $arrTemplates = array();
     }
     // Load *all* templates and languages
     self::init($section);
     $i = 0;
     foreach ($arrTemplates as $arrTemplate) {
         $key = $arrTemplate['key'];
         $objTemplateLocal->setVariable(array('MAILTEMPLATE_ROWCLASS' => ++$i % 2 + 1, 'MAILTEMPLATE_PROTECTED' => \Html::getCheckmark($arrTemplate['protected']), 'MAILTEMPLATE_HTML' => \Html::getCheckmark($arrTemplate['html']), 'MAILTEMPLATE_NAME' => '<a href="' . $uri_edit . '&amp;key=' . urlencode($key) . '">' . contrexx_raw2xhtml($arrTemplate['name']) . '</a>', 'MAILTEMPLATE_KEY' => $arrTemplate['key'], 'MAILTEMPLATE_FUNCTIONS' => \Html::getBackendFunctions(array('copy' => $uri_edit . '&amp;copy=1&amp;key=' . $arrTemplate['key'], 'edit' => $uri_edit . '&amp;key=' . $arrTemplate['key'], 'delete' => $arrTemplate['protected'] ? '' : $uri_overview . '&amp;delete_mailtemplate_key=' . $arrTemplate['key'] . '&amp;csrf=' . \Cx\Core\Csrf\Controller\Csrf::code()), array('delete' => $_CORELANG['TXT_CORE_MAILTEMPLATE_DELETE_CONFIRM']))));
         foreach (array_keys($arrLanguageName) as $lang_id) {
             $available = isset(self::$arrTemplates[$lang_id][$key]) && self::$arrTemplates[$lang_id][$key]['available'];
             $title = $available ? $_CORELANG['TXT_CORE_MAILTEMPLATE_EDIT'] : $_CORELANG['TXT_CORE_MAILTEMPLATE_NEW'];
             $icon = '<a href="' . CONTREXX_DIRECTORY_INDEX . "?cmd={$section}&amp;act=" . $act . '&amp;key=' . $key . '&amp;userFrontendLangId=' . $lang_id . '"' . ' title="' . $title . '">' . '<img src="../core/Core/View/Media/icons/' . ($available ? 'edit.gif' : 'add.png') . '"' . ' width="16" height="16" alt="' . $title . '" border="0" /></a>';
             $objTemplateLocal->setVariable('MAILTEMPLATE_LANGUAGE', $icon);
             $objTemplateLocal->parse('core_mailtemplate_language_column');
         }
         $objTemplateLocal->parse('core_mailtemplate_row');
     }
     return $objTemplateLocal;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:84,代码来源:MailTemplate.class.php


注:本文中的Paging::getPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。