本文整理汇总了PHP中BFCHelper::getSearchParamsSession方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::getSearchParamsSession方法的具体用法?PHP BFCHelper::getSearchParamsSession怎么用?PHP BFCHelper::getSearchParamsSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::getSearchParamsSession方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
// setting per slider prezzi
$priceScaleMin = 0;
$priceScaleMax = 300;
$priceScaleStep = 50;
//zone...
$locationZones = BFCHelper::getLocationZones();
$masterTypologies = BFCHelper::getMasterTypologies();
// elenco ulteriore filtri possibili
$merchantGroups = BFCHelper::getTags($language, "1,4");
$bookingTypes = array();
//$bookingTypes[0] = JTEXT::_('MOD_BOOKINGFORSEARCHFILTER_BOOKINGTYPES_REQUEST');
$bookingTypes[1] = JTEXT::_('MOD_BOOKINGFORSEARCHFILTER_BOOKINGTYPES_BOOK');
$offers = array();
$offers[1] = JTEXT::_('MOD_BOOKINGFORSEARCHFILTER_OFFERS_OFFER');
$pars = BFCHelper::getSearchParamsSession();
// se passo questi dati è una nuova ricerca
$masterTypeId = $pars['masterTypeId'];
$merchantCategoryId = $pars['merchantCategoryId'];
// TODO: SUSPENDED
//if (!empty($merchantCategoryId)) {
//
//// $singeMerchantCategory = BFCHelper::getMerchantCategory($merchantCategoryId);
//// $services = $singeMerchantCategory->Services;
// $services = BFCHelper::getServicesByMerchantsCategoryId($merchantCategoryId,$language);
//}else{
// $services = BFCHelper::getServicesForSearch($language);
//
//}
$services = BFCHelper::getServicesForSearch($language);
$duration = 1;
示例2: populateState
protected function populateState($ordering = NULL, $direction = NULL)
{
//(in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), true))
$ci = BFCHelper::getStayParam('checkin', new DateTime());
// $isMerchantResults = false;
// if( (in_array(JRequest::getInt('masterTypeId'), BFCHelper::getTypologiesMerchantResults(), true) || (in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(), true))){
// $isMerchantResults = true;
// }
// if (JRequest::getInt('masterTypeId') > 0 || JRequest::getInt('merchantCategoryId') > 0) {
// $condominiumsResults = JRequest::getVar('condominiumsResults');
// $merchantResults = (in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), false));
// if ($condominiumsResults) {
// $merchantResults = false;
// }
if (JRequest::getInt('newsearch') == 1) {
$condominiumsResults = JRequest::getVar('condominiumsResults');
$merchantResults = in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), false);
if ($condominiumsResults) {
$merchantResults = false;
}
$filtersservices = JRequest::getVar('filtersservices');
$bookableonly = JRequest::getVar('bookableonly');
$filters = JRequest::getVar('filters');
if (empty($filters)) {
$filters = array();
}
if (!empty($bookableonly)) {
$filters['bookingtypes'] = $bookableonly;
}
if (!empty($filtersservices)) {
if (empty($filters['services'])) {
$filters['services'] = $filtersservices;
} else {
$filters['services'] .= ',' . $filtersservices;
}
}
$currParam = array('searchid' => "booking", 'checkin' => BFCHelper::getStayParam('checkin', new DateTime()), 'checkout' => BFCHelper::getStayParam('checkout', $ci->modify(BFCHelper::$defaultDaysSpan)), 'duration' => BFCHelper::getStayParam('duration'), 'paxages' => BFCHelper::getStayParam('paxages'), 'masterTypeId' => JRequest::getInt('masterTypeId'), 'merchantResults' => $merchantResults, 'merchantCategoryId' => JRequest::getInt('merchantCategoryId'), 'merchantId' => JRequest::getInt('merchantId', 0), 'zoneId' => JRequest::getInt('locationzone', 0), 'locationzone' => JRequest::getInt('locationzone', 0), 'cultureCode' => JRequest::getVar('cultureCode'), 'paxes' => JRequest::getInt('persons'), 'resourceName' => JRequest::getVar('resourceName', ""), 'refid' => JRequest::getVar('refid', ""), 'condominiumsResults' => $condominiumsResults, 'pricerange' => JRequest::getVar('pricerange'), 'onlystay' => JRequest::getVar('onlystay'), 'tags' => JRequest::getVar('tags'), 'filters' => $filters, 'bookableonly' => JRequest::getVar('bookableonly'), 'newsearch' => 1);
$this->setState('params', $currParam);
} else {
// try to get params from session
$pars = BFCHelper::getSearchParamsSession();
try {
$tags = JRequest::getVar('tags');
if (isset($pars['tags']) && empty($tags)) {
$tags = $pars['tags'];
}
$currParam = array('searchid' => "booking", 'checkin' => $pars['checkin'], 'checkout' => $pars['checkout'], 'duration' => $pars['duration'], 'masterTypeId' => $pars['masterTypeId'], 'merchantResults' => $pars['merchantResults'], 'merchantCategoryId' => $pars['merchantCategoryId'], 'merchantId' => $pars['merchantId'], 'paxes' => $pars['paxes'], 'paxages' => $pars['paxages'], 'locationzone' => $pars['zoneId'], 'cultureCode' => $pars['cultureCode'], 'resourceName' => $pars['resourceName'], 'refid' => $pars['refid'], 'condominiumsResults' => $pars['condominiumsResults'], 'pricerange' => $pars['pricerange'], 'onlystay' => JRequest::getVar('onlystay', $pars['onlystay']), 'filters' => JRequest::getVar('filters', $pars['filters']), 'bookableonly' => JRequest::getVar('bookableonly', $pars['bookableonly']), 'tags' => $tags, 'newsearch' => JRequest::getVar('newsearch', "0"));
} catch (Exception $e) {
$condominiumsResults = JRequest::getVar('condominiumsResults');
$merchantResults = in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), false);
if ($condominiumsResults) {
$merchantResults = false;
}
$filtersservices = JRequest::getVar('filtersservices');
$bookableonly = JRequest::getVar('bookableonly');
$filters = JRequest::getVar('filters');
if (empty($filters)) {
$filters = array();
}
if (!empty($bookableonly)) {
$filters['bookingtypes'] = $bookableonly;
}
if (!empty($filtersservices)) {
if (empty($filters['services'])) {
$filters['services'] = $filtersservices;
} else {
$filters['services'] .= ',' . $filtersservices;
}
}
$currParam = array('searchid' => "booking", 'checkin' => BFCHelper::getStayParam('checkin', new DateTime()), 'checkout' => BFCHelper::getStayParam('checkout', $ci->modify(BFCHelper::$defaultDaysSpan)), 'duration' => BFCHelper::getStayParam('duration'), 'paxages' => BFCHelper::getStayParam('paxages'), 'masterTypeId' => JRequest::getInt('masterTypeId'), 'merchantResults' => $merchantResults, 'merchantCategoryId' => JRequest::getInt('merchantCategoryId'), 'merchantId' => JRequest::getInt('merchantId', 0), 'zoneId' => JRequest::getInt('locationzone', 0), 'locationzone' => JRequest::getInt('locationzone', 0), 'cultureCode' => JRequest::getVar('cultureCode'), 'paxes' => JRequest::getInt('persons'), 'resourceName' => JRequest::getVar('resourceName', ""), 'refid' => JRequest::getVar('refid', ""), 'condominiumsResults' => $condominiumsResults, 'pricerange' => JRequest::getVar('pricerange'), 'onlystay' => JRequest::getVar('onlystay'), 'tags' => JRequest::getVar('tags'), 'filters' => $filters, 'bookableonly' => JRequest::getVar('bookableonly'), 'newsearch' => 1);
}
$this->setState('params', $currParam);
}
// $filter_order = JRequest::getCmd('filter_order','stay');
// $filter_order_Dir = JRequest::getCmd('filter_order_Dir','asc');
$filter_order = JRequest::getCmd('filter_order');
$filter_order_Dir = JRequest::getCmd('filter_order_Dir');
// return parent::populateState($filter_order, $filter_order_Dir);
parent::populateState($filter_order, $filter_order_Dir);
}
示例3: applyDefaultFilter
public function applyDefaultFilter(&$options)
{
$params = BFCHelper::getSearchParamsSession();
$masterTypeId = $params['masterTypeId'];
$checkin = $params['checkin'];
$checkout = $params['checkout'];
$duration = $params['duration'];
$persons = $params['paxes'];
$merchantCategoryId = $params['merchantCategoryId'];
$paxages = $params['paxages'];
$merchantId = $params['merchantId'];
$cultureCode = $params['cultureCode'];
$filter = '';
$resourceName = $params['resourceName'] . '';
$refid = $params['refid'] . '';
$onlystay = $params['onlystay'];
if (isset($onlystay) && $onlystay != "false") {
// solo se è calcolato allora faccio una ricerca con i parametri altrimenti non li passo
if (isset($params['locationzone'])) {
$locationzone = $params['locationzone'];
}
if (isset($masterTypeId) && $masterTypeId > 0) {
$options['data']['masterTypeId'] = $masterTypeId;
}
if (isset($merchantCategoryId) && $merchantCategoryId > 0) {
$options['data']['merchantCategoryId'] = $merchantCategoryId;
}
if (isset($checkin) && (isset($duration) && $duration > 0)) {
$options['data']['checkin'] = '\'' . $checkin->format('Ymd') . '\'';
$options['data']['duration'] = $duration;
}
if (isset($persons) && $persons > 0) {
$options['data']['paxes'] = $persons;
if (isset($paxages)) {
$options['data']['paxages'] = '\'' . implode('|', $paxages) . '\'';
} else {
$px = array_fill(0, $persons, BFCHelper::$defaultAdultsAge);
$options['data']['paxages'] = '\'' . implode('|', $px) . '\'';
}
}
$options['data']['pricetype'] = '\'' . 'rateplan' . '\'';
if (isset($locationzone) && $locationzone > 0) {
$options['data']['zoneId'] = $locationzone;
}
} else {
if (isset($refid) && $refid != "") {
$options['data']['refId'] = '\'' . $refid . '\'';
}
if (isset($resourceName) && $resourceName != "") {
$options['data']['resourceName'] = '\'' . $resourceName . '\'';
}
}
if (isset($cultureCode) && $cultureCode != '') {
$options['data']['cultureCode'] = '\'' . $cultureCode . '\'';
}
if (isset($merchantId) && $merchantId > 0) {
$options['data']['merchantid'] = $merchantId;
}
if ($filter != '') {
$options['data']['$filter'] = $filter;
}
/*if (count($categoryIds) > 0)
$options['data']['categoryIds'] = '\''.implode('|',$categoryIds).'\'';*/
}
示例4: populateState
protected function populateState($ordering = NULL, $direction = NULL)
{
//(in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), true))
$ci = BFCHelper::getStayParam('checkin', new DateTime());
// $isMerchantResults = false;
// if( (in_array(JRequest::getInt('masterTypeId'), BFCHelper::getTypologiesMerchantResults(), true) || (in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(), true))){
// $isMerchantResults = true;
// }
// if (JRequest::getInt('masterTypeId') > 0 || JRequest::getInt('merchantCategoryId') > 0) {
if (JRequest::getInt('newsearch') == 1) {
$currParam = array('searchid' => "booking", 'checkin' => BFCHelper::getStayParam('checkin', new DateTime()), 'checkout' => BFCHelper::getStayParam('checkout', $ci->modify(BFCHelper::$defaultDaysSpan)), 'duration' => BFCHelper::getStayParam('duration'), 'paxages' => BFCHelper::getStayParam('paxages'), 'masterTypeId' => JRequest::getInt('masterTypeId'), 'merchantResults' => in_array(JRequest::getInt('merchantCategoryId'), BFCHelper::getCategoryMerchantResults(JRequest::getVar('cultureCode')), true), 'merchantCategoryId' => JRequest::getInt('merchantCategoryId'), 'merchantId' => JRequest::getInt('merchantId', 0), 'zoneId' => JRequest::getInt('locationzone', 0), 'locationzone' => JRequest::getInt('locationzone', 0), 'cultureCode' => JRequest::getVar('cultureCode'), 'paxes' => JRequest::getInt('persons'), 'resourceName' => JRequest::getVar('resourceName', ""), 'refid' => JRequest::getVar('refid', ""), 'condominiumsResults' => JRequest::getVar('condominiumsResults'), 'pricerange' => JRequest::getVar('pricerange'), 'onlystay' => JRequest::getVar('onlystay'), 'newsearch' => 1);
$this->setState('params', $currParam);
} else {
// try to get params from session
$pars = BFCHelper::getSearchParamsSession();
//$filterpost = FormHelper::getOptionsFromSelect($_POST, 'filters');
// $filterpost = JRequest::getVar('filters', $pars['filters']);
// echo "<pre>_POST:";
// echo print_r($_POST);
// echo "</pre>";
// echo "<pre>filters:";
// echo print_r($filterpost);
// echo "</pre>";
// if (!isset($filterpost)) {
// $filterpost = $pars['filters'];
// }
$currParam = array('searchid' => "booking", 'checkin' => $pars['checkin'], 'checkout' => $pars['checkout'], 'duration' => $pars['duration'], 'masterTypeId' => $pars['masterTypeId'], 'merchantResults' => $pars['merchantResults'], 'merchantCategoryId' => $pars['merchantCategoryId'], 'merchantId' => $pars['merchantId'], 'paxes' => $pars['paxes'], 'paxages' => $pars['paxages'], 'locationzone' => $pars['zoneId'], 'cultureCode' => $pars['cultureCode'], 'resourceName' => $pars['resourceName'], 'refid' => $pars['refid'], 'condominiumsResults' => $pars['condominiumsResults'], 'pricerange' => $pars['pricerange'], 'onlystay' => JRequest::getVar('onlystay', $pars['onlystay']), 'filters' => JRequest::getVar('filters', $pars['filters']), 'newsearch' => JRequest::getVar('newsearch', "0"));
$this->setState('params', $currParam);
}
// $filter_order = JRequest::getCmd('filter_order','stay');
// $filter_order_Dir = JRequest::getCmd('filter_order_Dir','asc');
$filter_order = JRequest::getCmd('filter_order');
$filter_order_Dir = JRequest::getCmd('filter_order_Dir');
return parent::populateState($filter_order, $filter_order_Dir);
}