本文整理汇总了PHP中Sessions::setOnlinePaymentRateWithCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP Sessions::setOnlinePaymentRateWithCurrency方法的具体用法?PHP Sessions::setOnlinePaymentRateWithCurrency怎么用?PHP Sessions::setOnlinePaymentRateWithCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sessions
的用法示例。
在下文中一共展示了Sessions::setOnlinePaymentRateWithCurrency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBookingRoomRatesOnBookings
function getBookingRoomRatesOnBookings()
{
$total = 0;
$total_lkr = 0;
$price_tag = 0;
$room_rate = 0;
$rate = 0;
$zeroRateDetected = false;
$roomTypeId = $_REQUEST['roomTypeId'];
$room_bed_type = $_REQUEST['room_bed_type'];
$room_meal_type = $_REQUEST['room_meal_type'];
$room_count = $_REQUEST['room_count'];
$display_rate_in = $_REQUEST['display_rate_in'];
$_SESSION['display_rate_in'] = $display_rate_in;
$day = 86400;
$startTime = strtotime($_SESSION['check_in_date']);
$endTime = strtotime($_SESSION['check_out_date']);
$numDays = round(($endTime - $startTime) / $day);
$hotelRoomRates = new HotelRoomRates();
$hotelRoomRates->setHotelRoomTypeId($roomTypeId);
//$room_rate = $hotelRoomRates->getRateInRoomType($room_bed_type, $room_meal_type);
foreach (Common::createDateRangeArray($_SESSION['check_in_date'], date("Y-m-d", strtotime("-1 days", strtotime($_SESSION['check_out_date'])))) as $key => $value) {
$rate = $hotelRoomRates->getRateInRoomTypeForDate($room_bed_type, $room_meal_type, $value);
if ($rate > 0) {
$room_rate = $room_rate + $rate;
} else {
$zeroRateDetected = true;
}
}
if ($zeroRateDetected == false && $room_rate > 0) {
//if ($room_rate > 0) {
// replace LKR with current currency session
if ($display_rate_in == "LKR") {
$converted_rate = Common::currencyConvert("USD", $display_rate_in, $room_rate);
} else {
$converted_rate = $room_rate;
}
$total = $room_rate * $room_count;
// * $numDays;
$total_lkr = $converted_rate * $room_count;
// * $numDays;
} else {
$total = 0;
$total_lkr = 0;
}
if ($display_rate_in == "LKR") {
Sessions::setOnlinePaymentRateWithCurrency($total_lkr, $display_rate_in);
$price_tag = number_format($total_lkr, 2) . " " . $display_rate_in;
} else {
Sessions::setOnlinePaymentRateWithCurrency($total, $display_rate_in);
$price_tag = number_format($total, 2) . " " . $display_rate_in;
}
$_final = array("total" => number_format($total, 2), "total_lkr" => $total_lkr, "display_rate_in" => $display_rate_in, "price_tag" => $price_tag);
echo json_encode($_final);
}