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


PHP FrontController::pagination方法代码示例

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


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

示例1: process

 public function process()
 {
     global $cookie;
     parent::process();
     $roomtype_list = RoomPlan::getRoomTypeList();
     $roomtype_form_list = array();
     $search_form = array();
     // get contient code
     self::$cookie->UserID;
     $continentCode = Tools::getUserContinentCode(self::$cookie->CompanyID);
     if (Tools::isSubmit("search")) {
         $search_form = Tools::element_copy($_REQUEST, 'CityId', 'AreaId', 'CheckIn', 'CheckOut', 'Nights', 'HotelClassId', 'HotelName', 'SortBy', 'SortOrder');
         if (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) {
             $search_form['ContinentCode'] = $continentCode;
             $search_form['HideRQ'] = @$_REQUEST['HideRQ'];
             $search_form['Role'] = 'Agent';
         }
         foreach ($roomtype_list as $roomtype) {
             $roomTypeId = $roomtype['RoomTypeId'];
             $roomtype_form_list[$roomTypeId] = $_REQUEST['RoomType_' . $roomTypeId];
         }
         $search_form['RoomTypeVals'] = $roomtype_form_list;
         if (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3 || $search_form['CheckIn'] && $search_form['CheckOut']) {
             $search_form['Role'] = 'Agent';
             $hotel_roomplan_count = RoomPlan::searchHotelRoomPlanCount($search_form);
             parent::pagination($hotel_roomplan_count);
             $hotel_roomplan_list = RoomPlan::searchHotelRoomPlan($search_form, $this->p, $this->n);
         } else {
             $hotel_roomplan_count = HotelDetail::getHotelByAreaCityCount($search_form);
             parent::pagination($hotel_roomplan_count);
             $hotel_roomplan_list = HotelDetail::getHotelByAreaCity($search_form, $this->p, $this->n);
         }
     } else {
         // redirect
         Tools::redirect('index.php');
     }
     self::$smarty->assign("hotel_roomplan_list", $hotel_roomplan_list);
     self::$smarty->assign("hotel_roomplan_count", $hotel_roomplan_count);
     self::$smarty->assign("search_form", $search_form);
     self::$smarty->assign("search_city_name", Tools::getCityName($search_form['CityId']));
     self::$smarty->assign("search_area_name", Tools::getAreaName($search_form['AreaId']));
     self::$smarty->assign("roomTypeList", $roomtype_list);
     self::$smarty->assign("classList", Tools::getAllHotelClasses());
     self::$smarty->assign("areaList", Tools::getJapanAreas());
 }
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:45,代码来源:SearchHotelController.php

示例2: FrontController

<?php

/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2012 PrestaShop SA
*  @version  Release: $Revision: 14007 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/
$controller = new FrontController();
$controller->pagination();
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:29,代码来源:pagination.php

示例3: process

 public function process()
 {
     parent::process();
     global $cookie;
     $iso = Language::getIsoById((int) $cookie->LanguageID);
     $mid = $this->mid;
     //Tools::getValue("mid")!="" ? Tools::getValue("mid") : ((self::$cookie->RoleID==1) ? self::$cookie->HotelID : "");
     $hotel = new HotelDetail($mid);
     $HotelNameKey = 'HotelName_' . $iso;
     $hotel->HotelName = $hotel->{$HotelNameKey};
     $HotelAddressKey = 'HotelAddress_' . $iso;
     $hotel->HotelAddress = $hotel->{$HotelAddressKey};
     $HotelDescriptionKey = 'HotelDescription_' . $iso;
     $hotel->HotelDescription = $hotel->{$HotelDescriptionKey};
     $HotelPoliciesKey = 'HotelPolicies_' . $iso;
     $hotel->HotelPolicies = $hotel->{$HotelPoliciesKey};
     $UsefulInformationKey = 'UsefulInformation_' . $iso;
     $hotel->UsefulInformation = $hotel->{$UsefulInformationKey};
     $continentCode = Tools::getUserContinentCode(self::$cookie->CompanyID);
     // get CityName and AreaName of Hotel
     $hotel->HotelAreaName = Tools::getAreaName($hotel->HotelArea);
     $hotel->HotelCityName = Tools::getCityName($hotel->HotelCity);
     $hotel->HotelClassName = $hotel->getClassName();
     $number_star = 0;
     if ($hotel->HotelClass == 1 || $hotel->HotelClass == 4 || $hotel->HotelClass == 7) {
         $number_star = 5;
     } elseif ($hotel->HotelClass == 2 || $hotel->HotelClass == 5 || $hotel->HotelClass == 8) {
         $number_star = 4;
     } elseif ($hotel->HotelClass == 3 || $hotel->HotelClass == 6 || $hotel->HotelClass == 9) {
         $number_star = 3;
     }
     $isOnsen = 0;
     $isResort = 0;
     if ($hotel->HotelClass == 4 || $hotel->HotelClass == 5 || $hotel->HotelClass == 6) {
         $isOnsen = 1;
     } elseif ($hotel->HotelClass == 9 || $hotel->HotelClass == 8 || $hotel->HotelClass == 7) {
         $isResort = 1;
     }
     self::$smarty->assign("number_star", $number_star);
     self::$smarty->assign("isOnsen", $isOnsen);
     self::$smarty->assign("isResort", $isResort);
     self::$smarty->assign("hotel", $hotel);
     self::$smarty->assign("featureList", $hotel->getAllFeatures());
     $photoList = HotelDetail::getAllHotelFiles($hotel->HotelId);
     foreach ($photoList as $key => $var) {
         $iso_name = 'HotelFileName_' . $iso;
         $photoList[$key]['HotelFileName'] = $photoList[$key][$iso_name];
         //d($photoList[$key]);
     }
     self::$smarty->assign("photoList", $photoList);
     self::$smarty->assign("photoCount", sizeof($photoList));
     self::$smarty->assign("mid", $mid);
     // Get Similar Hotel List
     $simList = $hotel->getSimilarHotelList();
     $similarList = array();
     foreach ($simList as $similar) {
         $image = HotelDetail::getFirstFileOfHotel($similar['HotelId'], 145, 145);
         if (is_file(_TAS_ROOT_DIR_ . "/asset/" . $image['w5_path'])) {
             $similar['HotelFilePath'] = $image['w5_path'];
             $similar['w5'] = $image['w5'];
             $similar['h5'] = $image['h5'];
         }
         $similar['LowestPrice'] = HotelDetail::getLowestPriceOfHotel($similar['HotelId']);
         $similar['AreaName'] = Tools::getAreaName($similar['HotelArea']);
         $HotelNameKey = 'HotelName_' . $iso;
         $similar['HotelName'] = $similar[$HotelNameKey];
         $similarList[] = $similar;
     }
     self::$smarty->assign("similarList", $similarList);
     $roomtype_list = RoomPlan::getRoomTypeList();
     $roomtype_form_list = array();
     if (Tools::isSubmit("search")) {
         // search result
         $search_form = Tools::element_copy($_REQUEST, 'CheckIn', 'CheckOut', 'Nights', 'SortBy', 'SortOrder');
         $search_form['HotelId'] = $mid;
         foreach ($roomtype_list as $roomtype) {
             $roomTypeId = $roomtype['RoomTypeId'];
             $roomtype_form_list[$roomTypeId] = $_REQUEST['RoomType_' . $roomTypeId];
         }
         $search_form['RoomTypeVals'] = $roomtype_form_list;
         if (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) {
             $search_form['ContinentCode'] = $continentCode;
             $search_form['Role'] = 'Agent';
         }
         $hotel_roomplan_count = RoomPlan::searchHotelRoomPlanCount($search_form);
         parent::pagination($hotel_roomplan_count);
         $hotel_roomplan_list = RoomPlan::searchHotelRoomPlan($search_form, $this->p, $this->n);
         // print_r($hotel_roomplan_list);
         self::$smarty->assign("hotel_roomplan_list", $hotel_roomplan_list);
         self::$smarty->assign("hotel_roomplan_count", $hotel_roomplan_count);
         self::$smarty->assign("search_form", $search_form);
     } else {
         $search_form = array();
         $search_form['CityId'] = 0;
         $search_form['AreaId'] = 0;
         if (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) {
             $search_form['Role'] = 'Agent';
             $search_form['CheckIn'] = Tools::get_default_val($_REQUEST['CheckIn'], date('Y-m-d', strtotime(date('Y-m-d') . " + 5 days")));
             $search_form['Nights'] = Tools::get_default_val($_REQUEST['Nights'], 1);
             $search_form['CheckOut'] = date('Y-m-d', strtotime($search_form['CheckIn'] . " + {$search_form['Nights']} days"));
//.........这里部分代码省略.........
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:101,代码来源:HotelPageController.php

示例4: hookProductTabContent

 public function hookProductTabContent($params)
 {
     global $smarty, $cookie, $link, $isBetaUser;
     $id_guest = !($id_customer = (int) $cookie->id_customer) ? (int) $cookie->id_guest : false;
     $customerComment = ProductComment::getByCustomer((int) Tools::getValue('id_product'), (int) $cookie->id_customer, true, (int) $id_guest);
     $averages = ProductComment::getAveragesByProduct((int) Tools::getValue('id_product'), (int) $cookie->id_lang);
     $averageTotal = 0;
     foreach ($averages as $average) {
         $averageTotal += (double) $average;
     }
     $averageTotal = count($averages) ? $averageTotal / count($averages) : 0;
     //'too_early' => ($customerComment AND (strtotime($customerComment['date_add']) + Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')) > time()),
     $too_early = $customerComment;
     $smarty->assign(array('logged' => (int) $cookie->id_customer, 'action_url' => '', 'comments' => ProductComment::getByProduct((int) Tools::getValue('id_product')), 'criterions' => ProductCommentCriterion::getByProduct((int) Tools::getValue('id_product'), (int) $cookie->id_lang), 'averages' => $averages, 'product_comment_path' => $this->_path, 'averageTotal' => $averageTotal, 'allow_guests' => (int) Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'), 'too_early' => $too_early, 'delay' => Configuration::get('PRODUCT_COMMENTS_MINIMAL_TIME')));
     $controller = new FrontController();
     $controller->pagination((int) ProductComment::getCommentNumber((int) Tools::getValue('id_product')));
     if ($isBetaUser) {
         return $this->display(__FILE__, 'beta/productcomments.tpl');
     } else {
         return $this->display(__FILE__, '/productcomments.tpl');
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:22,代码来源:productcomments.php


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