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


PHP BFCHelper::getStartDate方法代码示例

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


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

示例1: getCheckAvailabilityCalendarFromService

 public function getCheckAvailabilityCalendarFromService($resourcesId = null, $checkIn = null, $checkOut = null)
 {
     $resultCheck = '';
     if ($resourcesId == null || $checkIn == null || $checkOut == null) {
         return $resultCheck;
     }
     if ($checkIn == null) {
         $defaultDate = DateTime::createFromFormat('d/m/Y', BFCHelper::getStartDate());
         $checkIn = BFCHelper::getStayParam('checkin', $defaultDate);
     }
     if ($checkOut == null) {
         $checkOut = BFCHelper::getStayParam('checkout', $checkIn->modify(BFCHelper::$defaultDaysSpan));
     }
     //calcolo le settimane necessarie
     //$ci = $params['checkin'];
     $options = array('path' => $this->urlCheckAvailabilityCalendar, 'data' => array('resourcesId' => BFCHelper::getQuotedString($resourcesId), 'checkin' => '\'' . $checkIn->format('Ymd') . '\'', 'checkout' => '\'' . $checkOut->format('Ymd') . '\'', '$format' => 'json'));
     $url = $this->helper->getQuery($options);
     $r = $this->helper->executeQuery($url);
     if (isset($r)) {
         $res = json_decode($r);
         $checkDate = $res->d->results ?: $res->d;
         $resultCheck = $checkDate->CheckAvailabilityCalendarByIdList;
     }
     return $resultCheck;
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:25,代码来源:resources.php

示例2: populateState

 protected function populateState($ordering = NULL, $direction = NULL)
 {
     $session = JFactory::getSession();
     $searchseed = $session->get('searchseed', rand(), 'com_bookingforconnector');
     if (!$session->has('searchseed', 'com_bookingforconnector')) {
         $session->set('searchseed', $searchseed, 'com_bookingforconnector');
     }
     if (!isset($defaultDate)) {
         $defaultDate = DateTime::createFromFormat('d/m/Y', BFCHelper::getStartDate());
     }
     $ci = clone BFCHelper::getStayParam('checkin', $defaultDate);
     $this->setState('params', array('merchantId' => JRequest::getInt('merchantId'), 'offerId' => JRequest::getInt('offerId'), 'packageid' => JRequest::getInt('packageId'), 'onSellUnitId' => JRequest::getInt('onsellunitid'), 'searchseed' => $searchseed, 'filters' => JRequest::getVar('filters'), 'checkin' => BFCHelper::getStayParam('checkin', $defaultDate), 'checkout' => BFCHelper::getStayParam('checkout', $ci->modify(BFCHelper::$defaultDaysSpan)), 'duration' => BFCHelper::getStayParam('duration'), 'paxages' => BFCHelper::getStayParam('paxages'), 'paxes' => count(BFCHelper::getStayParam('paxes'))));
     return parent::populateState($ordering, $direction);
 }
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:14,代码来源:merchantdetails.php

示例3: date

$checkoutspan = '+1 day';
$pars = BFCHelper::getSearchParamsSession();
//Recupero date dal modello resource per avere la prima  e l'utima data disponibile
$checkoutspan = '+1 day';
//$startDate = DateTime::createFromFormat('d/m/Y',BFCHelper::getStartDate());
//$endDate = DateTime::createFromFormat('d/m/Y',BFCHelper::getEndDate());
//$startDate2 = clone $startDate;
//$startDate2->modify($checkoutspan);
// recupero solo il primo sabato disponibile
$strStartdate = $params->get('startdate');
$strEnddate = $params->get('enddate');
$condominiumsResults = $params->get('groupbycondominium');
if (!empty($strStartdate)) {
    $startDate = DateTime::createFromFormat('d-m-Y', $strStartdate);
} else {
    $startDate = DateTime::createFromFormat('d/m/Y', BFCHelper::getStartDate());
}
if (!empty($strStartdate)) {
    $endDate = DateTime::createFromFormat('d-m-Y', $strEnddate);
} else {
    $endDate = DateTime::createFromFormat('d/m/Y', BFCHelper::getEndDate());
}
//if($groupbycondominium){
////echo "<pre> groupbycondominium :";
////echo $groupbycondominium;
////echo "</pre>";
//}
/* script per aggiornare a data odierna */
//$today=DateTime::createFromFormat('d-m-Y',date('d-m-Y',strtotime(date('d-m-Y'). ' + 1 days')));
$today = DateTime::createFromFormat('d-m-Y', date('d-m-Y', strtotime(date('d-m-Y'))));
if ($today >= $startDate) {
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:31,代码来源:default.php

示例4: populateState

 protected function populateState($ordering = NULL, $direction = NULL)
 {
     //$ci = clone BFCHelper::getStayParam('checkin', new DateTime());
     //recupero la prima data disponibile per la risorsa se riesco altrimenti recupero la prima data disponibile
     $resourceId = JRequest::getInt('resourceId');
     if (isset($resourceId)) {
         $dates = $this->getCheckInDatesFromService($resourceId, null);
         if (($pos = strpos($dates, ',')) !== false) {
             $dates = explode(",", $dates);
         }
         if (is_array($dates)) {
             $tmpDate1 = array_values($dates);
             $tmpDate = array_shift($tmpDate1);
             $defaultDate = DateTime::createFromFormat('Ymd', $tmpDate);
             //				$defaultDate = DateTime::createFromFormat('Ymd',array_shift(array_values($dates)));
         } elseif ($dates != '') {
             $defaultDate = DateTime::createFromFormat('Ymd', $dates);
         }
     }
     if (!isset($defaultDate)) {
         $defaultDate = DateTime::createFromFormat('d/m/Y', BFCHelper::getStartDate());
     }
     $ci = clone BFCHelper::getStayParam('checkin', $defaultDate);
     $defaultRequest = array('resourceId' => JRequest::getInt('resourceId'), 'checkin' => BFCHelper::getStayParam('checkin', $defaultDate), 'checkout' => BFCHelper::getStayParam('checkout', $ci->modify(BFCHelper::$defaultDaysSpan)), 'duration' => BFCHelper::getStayParam('duration'), 'paxages' => BFCHelper::getStayParam('paxages'), 'extras' => BFCHelper::getStayParam('extras'), 'packages' => BFCHelper::getStayParam('packages'), 'pricetype' => BFCHelper::getStayParam('pricetype'), 'rateplanId' => BFCHelper::getStayParam('rateplanId'), 'variationPlanId' => BFCHelper::getStayParam('variationPlanId'), 'state' => BFCHelper::getStayParam('state'), 'gotCalculator' => JRequest::getBool('calculate'));
     //		echo "<pre>defaultRequest";
     //		echo print_r($defaultRequest);
     //		echo "</pre>";
     $stayrequest = JRequest::getVar('stayrequest');
     // support for rsforms!
     if ($stayrequest == null || $stayrequest == '') {
         $form = JRequest::getVar('form');
         $stayrequest = htmlspecialchars_decode($form['stayrequest'], ENT_COMPAT);
     }
     if ($stayrequest != null && $stayrequest != '') {
         try {
             $params = json_decode($stayrequest);
             $defaultRequest = array('resourceId' => $params->resourceId, 'checkin' => DateTime::createFromFormat('d/m/Y', $params->checkin), 'checkout' => DateTime::createFromFormat('d/m/Y', $params->checkout), 'duration' => $params->duration, 'paxages' => $params->paxages, 'extras' => $params->extras, 'packages' => $params->packages, 'pricetype' => $params->pricetype, 'rateplanId' => $params->rateplanId, 'variationPlanId' => $params->variationPlanId, 'state' => $params->state, 'gotCalculator' => false, 'fromExtForm' => true, 'hasRateplans' => false);
         } catch (Exception $e) {
         }
     }
     //echo var_dump($defaultRequest);die();
     $this->setState('params', $defaultRequest);
     return parent::populateState();
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:44,代码来源:resource.php


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