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


PHP JHotelUtil::getNumberOfDays方法代码示例

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


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

示例1:

															<?php 
                    }
                    ?>
														</select>
													<?php 
                }
                ?>
													<br/>
													<?php 
                if ($item->is_per_day == 1 || $item->is_per_day == 2) {
                    ?>
														<?php 
                    echo $item->is_per_day == 1 ? JText::_('LNG_NUMBER_OF_DAYS', true) : JText::_('LNG_NUMBER_OF_NIGHTS', true);
                    ?>
														<?php 
                    $nrDays = JHotelUtil::getNumberOfDays($this->item->reservationData->userData->start_date, $this->item->reservationData->userData->end_date);
                    ?>
														<select id="days-<?php 
                    echo $item->id;
                    ?>
" name="extra-option-days-<?php 
                    echo $item->id;
                    ?>
"  <?php 
                    echo $item->map_per_length_of_stay == 1 ? 'onfocus="this.oldvalue=this.value;this.blur();" onchange="this.value=this.oldvalue;"' : '';
                    ?>
 >
															<?php 
                    for ($i = 1; $i < 21; $i++) {
                        ?>
																<option value="<?php 
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:31,代码来源:edit.php

示例2: getReservationDetailsExcursions

    public function getReservationDetailsExcursions($resevation, $excursions, $currency)
    {
        $result = array();
        $nr_days_except_offers = 0;
        $index = 0;
        foreach ($excursions as $excursion) {
            $index++;
            $showExcursionDescription = true;
            $excursionInfo = new stdClass();
            $totalExcursionPrice = 0;
            $dayCounter = 0;
            $showPricePerDay = true;
            if (isset($excursion->price_type_day) && $excursion->price_type_day == 1) {
                $showPricePerDay = false;
            }
            ob_start();
            foreach ($excursion->daily as $day) {
                $price_day = $day['price_final'];
                if (isset($excursion->customPrices) && isset($excursion->customPrices[$day["date"]])) {
                    $price_day = $excursion->customPrices[$day["date"]];
                }
                $price_day *= $excursion->nrItemsBooked;
                $info_discount = '';
                $dayCounter++;
                foreach ($day['discounts'] as $d) {
                    if (strlen($info_discount) > 0) {
                        $info_discount .= '<BR>';
                    }
                    $info_discount .= $d->discount_name . ' ' . JHotelUtil::fmt(-1 * $d->discount_value) . '' . ($d->percent == 1 ? "%" : " " . $currency->symbol);
                }
                if (strlen($info_discount) > 0) {
                    $info_discount = "<div class='discount_info'>" . $info_discount . '</div>';
                }
                ?>
					
					<tr class='rsv_dtls_excursion_info'>
						<?php 
                if ($showExcursionDescription) {
                    ?>
							<td colspan=5 align="left" valign="top" style="border-top:solid 1px grey;padding: 3px 9px;"	rowspan='<?php 
                    echo !$showPricePerDay ? 1 : count($excursion->daily);
                    ?>
'>
								
								<?php 
                    if (count($excursions) > 1) {
                        ?>
									<strong>#<?php 
                        echo $index;
                        ?>
</strong>
								<?php 
                    }
                    ?>
								<?php 
                    echo '<strong>' . $excursion->excursion_name . '</strong>' . ' (' . JText::_('LNG_FOR', true) . ' ' . $excursion->nrItemsBooked . ')';
                    ?>
							</td>
							<?php 
                    $showExcursionDescription = false;
                }
                ?>
						
					<?php 
                $totalExcursionPrice += $price_day;
                ?>
					
					<td align="left" valign="top" style="border-top:solid  1px grey;padding: 3px 9px;" nowrap="nowrap">
							
							<?php 
                if (isset($excursion->price_type_day) && $excursion->price_type_day == 1) {
                    $nrDays = JHotelUtil::getNumberOfDays($resevation->start_date, $resevation->end_date);
                    //TODO - get nr Days
                    echo $nrDays . " " . strtolower(JText::_("LNG_NIGHTS"));
                } else {
                    echo JHotelUtil::getDateGeneralFormat($day['date']);
                }
                echo $info_discount;
                ?>
						</td>
						<td align="right" valign="top" style="border-top:solid  1px grey;padding: 3px 9px;">
							&nbsp;
							<?php 
                echo JHotelUtil::fmt($showPricePerDay ? $price_day : $totalExcursionPrice, 2);
                ?>
						</td>
						
						
					</tr>
					
					<?php 
                if (isset($excursion->price_type_day) && $excursion->price_type_day == 1) {
                    break;
                }
            }
            ?>
				
					<?php 
            $excursionInfo->name = $excursion->excursion_name;
            $excursionInfo->excursionDescription = ob_get_contents();
//.........这里部分代码省略.........
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:101,代码来源:ReservationService(original).php

示例3: getHotelOffers


//.........这里部分代码省略.........
                 $string_price = "price_" . $weekDay;
                 $dayPrice = $offer->{$string_price};
                 $childPrice = $offer->child_price;
                 $extraPersonPrice = $offer->extra_pers_price;
                 //dmp($extraPersonPrice);
                 //check if there is a custom price set
                 if (count($offerRateDetails)) {
                     foreach ($offerRateDetails as $offerRateDetail) {
                         if ($offerRateDetail->date == $dayString) {
                             $dayPrice = $offerRateDetail->price;
                             $extraPersonPrice = $offerRateDetail->extra_pers_price;
                             $childPrice = $offerRateDetail->child_price;
                             //	dmp($dayString . ": ". $dayPrice);
                         }
                     }
                 }
                 //dmp($extraPersonPrice);
                 //dmp($dayPrice);
                 //check if we have an extra night
                 $isExtraNight = false;
                 if ($offer_max_nights <= 0) {
                     $dayPrice = $offer->extra_night_price;
                     $isExtraNight = true;
                     //dmp("extra price: ".$offer->extra_night_price);
                 }
                 if ($offer->price_type == 1) {
                     $totalAdults = $adults <= $offer->base_adults ? $adults : $offer->base_adults;
                     $dayPrice = $dayPrice * $totalAdults + $childPrice * $children;
                 }
                 //add extra person cost - if it is the case
                 if ($adults > $offer->base_adults) {
                     $dayPrice += ($adults - $offer->base_adults) * $extraPersonPrice;
                 }
                 $nrDays = JHotelUtil::getNumberOfDays($startDate, $endDate);
                 //dmp($nrDays);
                 if ($offer->offer_min_nights > $nrDays) {
                     $offer->is_disabled = true;
                 }
                 //for single use
                 //if the price is per person apply single supplement , if is for room apply discount
                 if ($adults == 1 && $children == 0) {
                     if (!$isExtraNight) {
                         if ($offer->price_type == 1) {
                             $dayPrice = $dayPrice + $offer->single_balancing;
                             //dmp("add balancing: ".$offer->single_balancing." -> ".$dayPrice);
                         } else {
                             $dayPrice = $dayPrice - $offer->single_balancing;
                         }
                     } else {
                         if ($offer->price_type_day == 1) {
                             if ($offer->price_type == 1) {
                                 $dayPrice = $dayPrice + $offer->single_balancing / $offer->offer_min_nights;
                             } else {
                                 $dayPrice = $dayPrice - $offer->single_balancing / $offer->offer_min_nights;
                             }
                         } else {
                             if ($offer->price_type_day == 0) {
                                 if ($offer->price_type == 1) {
                                     $dayPrice = $dayPrice + $offer->single_balancing;
                                 } else {
                                     $dayPrice = $dayPrice - $offer->single_balancing;
                                 }
                             }
                         }
                     }
                 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:67,代码来源:HotelService(original).php

示例4: displayTableRow

 function displayTableRow($room, $row)
 {
     //dmp("R: ". $row);
     $startDate = $this->state->get('filter.start_date');
     $endDate = $this->state->get('filter.end_date');
     echo "<td class='td_color_fundal_1'></td>";
     for ($d = strtotime($startDate); $d <= strtotime($endDate);) {
         $dayString = date('d-m-Y', $d);
         $class = "";
         if ($d == strtotime(date('d-m-Y') . ' -1 day')) {
             $class = 'td_color_fundal_crt_day_1';
         } else {
             $class = 'td_color_fundal_1';
         }
         $class2 = "";
         if ($d == strtotime(date('d-m-Y'))) {
             $class2 = 'td_color_fundal_crt_day_2';
         } else {
             $class2 = 'td_color_fundal_2';
         }
         $showBooking = false;
         if (isset($this->availabilityReport[$room->room_id])) {
             foreach ($this->availabilityReport[$room->room_id][$row] as $booking) {
                 if (strtotime($booking->start_date) < strtotime($startDate)) {
                     $booking->start_date = $startDate;
                 }
                 if (strtotime($booking->start_date) == $d) {
                     $stayPeriod = JHotelUtil::getNumberOfDays($booking->start_date, $booking->end_date);
                     $colSpan = $stayPeriod * 2;
                     echo "<td class='td_color_fundal_1' colspan='{$colSpan}'>";
                     echo "\t<div class='reseravation_box reserved_details_" . strtolower(str_replace(' ', '_', $booking->status_reservation_name)) . "'>" . "<a class='client' href='#dialog_" . $booking->confirmation_id . "' name='modal'>" . $booking->last_name . ' ' . $booking->first_name . "</a>" . "</div>" . "<div id='dialog_" . $booking->confirmation_id . "' class='window'>" . "<div class='info'>" . "<SPAN class='title_ID'>" . JText::_('LNG_RESERVATION', true) . ' : ' . JHotelUtil::getStringIDConfirmation($booking->confirmation_id) . "</SPAN>" . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' value='Close it' class='close'/>" . $booking->confirmation_details . "</div>" . "</div>";
                     echo "</td>";
                     $showBooking = true;
                     $d = strtotime(date('d-m-Y', $d) . ' + ' . $stayPeriod . ' day ');
                     break;
                 }
             }
             //echo "<td  class='td_color_fundal_1'></td>";
         }
         if (!$showBooking) {
             echo "<td  class='{$class2}'></td>";
             if ($d != strtotime($endDate)) {
                 echo "<td class='{$class}'></td>";
             }
         } else {
             continue;
         }
         $d = strtotime(date('d-m-Y', $d) . ' + 1 day ');
     }
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:50,代码来源:view.html.php


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