<?php 
        }
        ?>
						<div class="com_bookingforconnector_merchantdetails-resource-stay-price">
							<?php 
        if ($totalDiscounted < $total) {
            ?>
								<span class="com_bookingforconnector_merchantdetails-resource-stay-discount">&euro; <?php 
            echo BFCHelper::priceFormat($total);
            ?>
</span>
							<?php 
        }
        ?>
							&euro; <span class="com_bookingforconnector_merchantdetails-resource-stay-total"><?php 
        echo BFCHelper::priceFormat($totalDiscounted);
        ?>
</span>
						</div>
					</div>
<!-- bottone Continua -->
					<div>
						<a class="btn btn-info" href="javascript:void(0);" onclick="showOptionalPackages(jQuery);return false;"><?php 
        echo JTEXT::_('COM_BOOKINGFORCONNECTOR_RESOURCE_VIEW_CALCULATOR_CONTINUE');
        ?>
</a>
					</div>
				</div>
				<?php 
    } else {
        ?>
Пример #2
0
function pushStay($arr, $resourceid, $resStay, $defaultResource = null, &$staysuggesteds)
{
    $selected = array_values(array_filter($arr, function ($itm) use($resourceid) {
        return $itm->ResourceId == $resourceid;
    }));
    $index = 0;
    if (count($selected) == 0) {
        $obj = new stdClass();
        $obj->ResourceId = $resourceid;
        if (isset($defaultResource) && $defaultResource->ResourceId == $resourceid) {
            $obj->MinCapacityPaxes = $defaultResource->MinCapacityPaxes;
            $obj->MaxCapacityPaxes = $defaultResource->MaxCapacityPaxes;
            $obj->Name = $defaultResource->Name;
            $obj->ImageUrl = $defaultResource->ImageUrl;
            $obj->Availability = $defaultResource->Availability;
            $obj->Policy = $resStay->Policy;
        } else {
            $obj->MinCapacityPaxes = $resStay->MinCapacityPaxes;
            $obj->MaxCapacityPaxes = $resStay->MaxCapacityPaxes;
            $obj->Availability = $resStay->Availability;
            $obj->Name = $resStay->ResName;
            $obj->ImageUrl = $resStay->ImageUrl;
            $obj->Policy = $resStay->Policy;
        }
        $obj->RatePlans = array();
        //$obj->Policy = $completestay->Policy;
        //$obj->Description = $singleRateplan->Description;
        $arr[] = $obj;
        $index = count($arr) - 1;
    } else {
        $index = array_search($selected[0], $arr);
        //$obj = $selected[0];
    }
    $rt = new stdClass();
    $rt->RatePlanId = $resStay->RatePlanId;
    $rt->Name = $resStay->Name;
    $rt->PercentVariation = $resStay->PercentVariation;
    $rt->TotalPrice = 0;
    $rt->TotalPriceString = "";
    $rt->Days = 0;
    $rt->BookingType = $resStay->BookingType;
    $rt->IsBase = $resStay->IsBase;
    $rt->CalculatedPricesDetails = $resStay->CalculatedPricesDetails;
    $rt->SelectablePrices = $resStay->SelectablePrices;
    $rt->Variations = $resStay->Variations;
    $rt->SimpleDiscountIds = implode(',', $resStay->SimpleDiscountIds);
    if (!empty($resStay->SuggestedStay->DiscountedPrice)) {
        $rt->TotalPrice = (double) $resStay->SuggestedStay->TotalPrice;
        $rt->TotalPriceString = BFCHelper::priceFormat((double) $resStay->SuggestedStay->TotalPrice);
        $rt->Days = $resStay->SuggestedStay->Days;
        $rt->DiscountedPriceString = BFCHelper::priceFormat((double) $resStay->SuggestedStay->DiscountedPrice);
        $rt->DiscountedPrice = (double) $resStay->SuggestedStay->DiscountedPrice;
    }
    //	$rt->SuggestedStay = $resStay->SuggestedStay;
    $rt->originalStay = $resStay;
    $rt->DiscountVariation = $resStay->DiscountVariation;
    $rt->SupplementVariation = $resStay->SupplementVariation;
    $arr[$index]->RatePlans[] = $rt;
    $currstaysuggested = "";
    if (!empty($resStay->SuggestedStay)) {
        $tmpcurrstay = $resStay->SuggestedStay;
        $tmpcurrstay->DiscountedPrice = (double) $resStay->SuggestedStay->DiscountedPrice;
        $tmpcurrstay->RatePlanStay = $resStay;
        unset($tmpcurrstay->RatePlanStay->SuggestedStay);
        $tmpcurrstay->CalculatedPricesDetails = $resStay->CalculatedPricesDetails;
        //	$tmpcurrstay->Variations = $selVariation;
        $tmpcurrstay->DiscountVariation = $resStay->DiscountVariation;
        $tmpcurrstay->SupplementVariation = $resStay->SupplementVariation;
        $currstaysuggested = htmlspecialchars(json_encode($tmpcurrstay), ENT_COMPAT, 'UTF-8');
    }
    //echo "<pre>currstaysuggested:<br />";
    //echo print_r($currstaysuggested);
    //echo "</pre>";
    $staysuggesteds[$resStay->BookingType] = $currstaysuggested;
    return $arr;
}
function pushStay($arr, $resourceid, $resStay, $defaultResource = null)
{
    $selected = array_values(array_filter($arr, function ($itm) use($resourceid) {
        return $itm->ResourceId == $resourceid;
    }));
    $index = 0;
    if (count($selected) == 0) {
        $obj = new stdClass();
        $obj->ResourceId = $resourceid;
        if (isset($defaultResource) && $defaultResource->ResourceId == $resourceid) {
            $obj->MerchantName = $defaultResource->MerchantName;
            $obj->MinCapacityPaxes = $defaultResource->MinCapacityPaxes;
            $obj->MaxCapacityPaxes = $defaultResource->MaxCapacityPaxes;
            $obj->Name = $defaultResource->Name;
            $obj->MrcCategoryName = $defaultResource->MerchantCategoryName;
            $obj->ImageUrl = $defaultResource->ImageUrl;
            $obj->Availability = $defaultResource->Availability;
            $obj->Policy = $resStay->Policy;
        } else {
            $obj->MerchantName = $resStay->MrcName;
            $obj->MinCapacityPaxes = $resStay->MinCapacityPaxes;
            $obj->MaxCapacityPaxes = $resStay->MaxCapacityPaxes;
            $obj->Availability = $resStay->Availability;
            $obj->Name = $resStay->ResName;
            $obj->MrcCategoryName = $resStay->MrcCategoryName;
            $obj->ImageUrl = $resStay->ImageUrl;
            $obj->Policy = $resStay->Policy;
        }
        $obj->RatePlans = array();
        //$obj->Policy = $completestay->Policy;
        //$obj->Description = $singleRateplan->Description;
        $arr[] = $obj;
        $index = count($arr) - 1;
    } else {
        $index = array_search($selected[0], $arr);
        //$obj = $selected[0];
    }
    $rt = new stdClass();
    $rt->RatePlanId = $resStay->RatePlanId;
    $rt->Name = $resStay->Name;
    $rt->RatePlanRefId = isset($resStay->RefId) ? $resStay->RefId : "";
    $rt->PercentVariation = $resStay->PercentVariation;
    $rt->TotalPrice = 0;
    $rt->TotalPriceString = "";
    $rt->Days = 0;
    $rt->BookingType = $resStay->BookingType;
    $rt->IsBookable = $resStay->IsBookable;
    $rt->CheckIn = BFCHelper::parseJsonDate($resStay->CheckIn);
    $rt->CheckOut = BFCHelper::parseJsonDate($resStay->CheckOut);
    $rt->CalculatedPricesDetails = $resStay->CalculatedPricesDetails;
    $rt->SelectablePrices = $resStay->SelectablePrices;
    $rt->Variations = $resStay->Variations;
    $rt->SimpleDiscountIds = implode(',', $resStay->SimpleDiscountIds);
    if (!empty($resStay->SuggestedStay->DiscountedPrice)) {
        $rt->TotalPrice = (double) $resStay->SuggestedStay->TotalPrice;
        $rt->TotalPriceString = BFCHelper::priceFormat((double) $resStay->SuggestedStay->TotalPrice);
        $rt->Days = $resStay->SuggestedStay->Days;
        $rt->DiscountedPriceString = BFCHelper::priceFormat((double) $resStay->SuggestedStay->DiscountedPrice);
        $rt->DiscountedPrice = (double) $resStay->SuggestedStay->DiscountedPrice;
    }
    $arr[$index]->RatePlans[] = $rt;
    return $arr;
}
            }
            ?>
																													</div>
																												<?php 
        } else {
            ?>
																													<div class="com_bookingforconnector-gray-highlight">
																														<span class="com_bookingforconnector-item-secondary-stay-total">&euro; <?php 
            echo BFCHelper::priceFormat($totalDiscounted);
            ?>
</span>
																														<?php 
            if ($totalDiscounted < $total) {
                ?>
																															<span class="com_bookingforconnector_strikethrough">&euro; <?php 
                echo BFCHelper::priceFormat($total);
                ?>
</span>
																														<?php 
            }
            ?>
																													</div>
																													<div class="clearboth"></div>
																												<?php 
        }
        ?>
						
						<?php 
    }
    ?>
					</div>
    if ($stays->RatePlanId == $active_plan_id) {
        $selected = ' selected';
    }
    $price_type_options_string = $price_type_options_string . '<option' . $selected . ' value="' . $stays->RatePlanId . '">' . $stays->Name . '</option>';
}
$price_string = '';
$discount_id = '';
if (isset($price_types[$active_plan_id])) {
    $active_plan = $price_types[$active_plan_id];
    $suggested_stay = $active_plan->SuggestedStay;
    unset($active_plan->SuggestedStay);
    $suggested_stay->RatePlanStay = $active_plan;
    $suggested_day_json = json_encode($suggested_stay);
    $_SESSION['search.params']['suggestedstay'] = $suggested_day_json;
    $total = $price_final = BFCHelper::priceFormat($active_plan->TotalAmount);
    $total_discounted = BFCHelper::priceFormat($active_plan->TotalDiscounted);
    $_SESSION['search.params']['totalDiscounted'] = $active_plan->TotalDiscounted;
    $is_discounted = FALSE;
    if ($total != $total_discounted) {
        $is_discounted = TRUE;
        //$discount_name = $active_plan->Discount->Name;
        //$discount_id = $active_plan->Discount->VariationPlanId;
        if (!empty($active_plan->Variations)) {
            $discount_name = $active_plan->Variations[0]->Name;
            $discount_id = $active_plan->Variations[0]->VariationPlanId;
        }
        $price_string = $price_string . '<span class="com_bookingforconnector_merchantdetails-resource-stay-discount">€' . $total . '</span>';
    }
    $price_string = $price_string . '<span class="com_bookingforconnector_merchantdetails-resource-stay-total">€' . $total_discounted . '</span>';
}
//echo isset($_SESSION['search.params']['suggestedstay']);
Пример #6
0
        </div>
</div>
		<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
?>
" id="totaldepositrequested">
            <div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
?>
12">
              <br>
              <?php 
_e('Total deposit : €', 'bfi');
?>
			  <span class="totaldeposit" id="totaldeposit"><?php 
echo BFCHelper::priceFormat($deposit);
?>
</span> 
            </div>
        </div>
	<div style="display:none;" id="ccInformations">
		<br><hr>
		<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW;
?>
">   
			<div class="<?php 
echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
?>
8" style="border-right:1px solid #cccccc">
				<?php 
										<?php 
                    echo sprintf(JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_RESOURCE_TOTALDAYS'), $rateplan->SuggestedStay->Days);
                    ?>
										<div class="com_bookingforconnector_merchantdetails-resource-stay-price">
											<?php 
                    if ($rateplan->SuggestedStay->DiscountedPrice < $rateplan->SuggestedStay->TotalPrice) {
                        ?>
												<span class="com_bookingforconnector_merchantdetails-resource-stay-discount">&euro; <?php 
                        echo BFCHelper::priceFormat($rateplan->SuggestedStay->TotalPrice);
                        ?>
</span>
											<?php 
                    }
                    ?>
											&euro; <span class="com_bookingforconnector_merchantdetails-resource-stay-total"><?php 
                    echo BFCHelper::priceFormat($rateplan->SuggestedStay->DiscountedPrice);
                    ?>
</span>
										</div>
									</div>
									<div class="<?php 
                    echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL;
                    ?>
2 alignvertical">
										<a class="btn btn-success " href="<?php 
                    echo $resourceRoute;
                    ?>
?pricetype=<?php 
                    echo $rateplan->RatePlanId;
                    ?>
"><?php