本文整理汇总了PHP中Sessions::getOnlinePaymentRate方法的典型用法代码示例。如果您正苦于以下问题:PHP Sessions::getOnlinePaymentRate方法的具体用法?PHP Sessions::getOnlinePaymentRate怎么用?PHP Sessions::getOnlinePaymentRate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sessions
的用法示例。
在下文中一共展示了Sessions::getOnlinePaymentRate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validOffers
public function validOffers($from, $to, $room_type, $bed, $meal, $no_of_rooms)
{
$off_array = array();
$offerAvailable = false;
$customOffer = false;
$custom_cus_array=array();
$custom_cus_array1=array();
$tot_pay = 0;
$tot_pay_lkr = 0;
$offerAmount = 0;
$tot_pay = Sessions::getOnlinePaymentRate();
$discount_fixed = 0;
$discount_percentage = 0;
$discount_freeN = 0;
$discount_price = 0;
$discounted_total=0;
$discounted_total_lkr=0;
$custom = '';
$from = date('Y-m-d', strtotime($from));
$to = date('Y-m-d', strtotime($to));
$startTime = strtotime($from);
$endTime = strtotime($to);
$numDays = round(($endTime - $startTime) / 86400);
//get offers between from and to dates - check if any rooms available to date range
$this->setFromDate($from);
$this->setToDate($to);
$this->setRoomType($room_type);
$off_data = $this->getOffersToDates(); //checking if any
for ($x = 0; $x < count($off_data); $x++) {
$this->extractor($off_data, $x);
$f_id = $this->id();
$f_from = $this->fromDate();
$f_to = $this->toDate();
$f_type = $this->disType();
$f_validity = $this->dateValidity();
$f_min_n = $this->minNights();
$f_free_n = $this->freeNights();
$f_roomtype = $this->roomType();
$f_bedtype = $this->bedType();
$f_mealtype = $this->mealType();
$f_amount = $this->amount();
$room_list = array_filter(explode(':', $f_roomtype));
$bed_list = array_filter(explode(':', $f_bedtype));
$meal_list = array_filter(explode(':', $f_mealtype));
if (in_array($room_type, $room_list)) { //check room type availabe in offer
if ((($f_bedtype == "") || (in_array($bed, $bed_list))) && (($f_mealtype == "") || (in_array($meal, $meal_list)))) {
//$off_array[] = $f_id;
$out_date = $f_min_n + $f_free_n;
$offer_start_date = strtotime($f_from);
$startTime = strtotime($from);
$offer_end_date = strtotime($f_to);
$endTime = strtotime($to);
if ($offer_start_date >= $startTime) {
$my_start_date = $f_from;
} else {
$my_start_date = $from;
}
if ($offer_end_date >= $endTime) {
$my_end_date = $to;
} else {
$my_end_date = $f_to;
}
//Fixed
if ($this->disType() == "0") {
$normal_rate = 0;
$offer_rate = 0;
if ((($f_min_n != "0" || $f_min_n != "") && $numDays >= $f_min_n) || $f_min_n == "0" || $f_min_n == "") {
$allotment = new HotelRoomRates();
$dates_array = $allotment->getDatesBetween2Dates($from, $to);
$dates_arrayOffer = $allotment->getDatesBetween2DatesOffer($my_start_date, $my_end_date);
for ($y = 0; $y < count($dates_array); $y++) {
if (in_array($dates_array[$y], $dates_arrayOffer)) {
$rate = new HotelRoomRates();
$rate->setHotelRoomTypeId($room_type);
$rate_data = $rate->getRoomRatesForDatesAndRoomId($dates_array[$y], $bed, $meal);
$normal_rate += $rate_data;
$offer_rate += $f_amount;
}
}
if ($f_validity == "on") {
$discount_fixed = ($tot_pay - ($normal_rate * $no_of_rooms)) + ($offer_rate * $no_of_rooms);
} else {
$discount_fixed = count($dates_array) * ($f_amount * $no_of_rooms);
}
//Convert Currency
if ($_SESSION['display_rate_in'] == "LKR") {
$discount_fixed = Common::currencyConvert("USD", $_SESSION['display_rate_in'], $discount_fixed);
} else {
$discount_fixed = $discount_fixed;
}
if ($discount_fixed > 0) {
$offerAvailable = true;
}
$offerAmount = $discount_fixed;
//.........这里部分代码省略.........
示例2: onlinePayment
function onlinePayment()
{
$reservation = new Reservations();
$reservation->setReservationClientId(Sessions::getClientId());
$reservation->setReservationHotelId(Sessions::getOnlinePaymentHotelId());
$reservation->setReservationHotelRoomTypeId(Sessions::getOnlinePaymentRoomTypeId());
$reservation->setReservationBedType(Sessions::getOnlinePaymentBedType());
$reservation->setReservationMealType(Sessions::getOnlinePaymentMealType());
$reservation->setReservationNoOfRoom(Sessions::getOnlinePaymentRoomCount());
$reservation->setReservationTotalPrice(Sessions::getOnlinePaymentRate());
//$reservation->setCurrencyType(Sessions::currSuffix());
$reservation->setCurrencyType(Sessions::getDisplayRatesIn());
$reservation->setReservationCheckInDate(Sessions::getOnlinePaymentCheckin());
$reservation->setReservationCheckOutDate(Sessions::getOnlinePaymentCheckout());
$reservation->setReservationOfferAvailable(Sessions::getOnlinePaymentOfferAvailable());
$reservation->setReservationOfferData(Sessions::getOnlinePaymentOfferData());
//$reservation_id = $reservation->newReservations();
if ($reservation->newReservations()) {
$reservation_id = mysql_insert_id();
Sessions::setOnlinePaymentReservationId($reservation_id);
$client_name = "";
$client_email = "";
$client_contact = "";
$client = new Clients();
$client->setClientId(Sessions::getClientId());
$client->extractor($client->getClientFromId());
$client_name = $client->clientFirstName() . ' ' . $client->clientLastName();
$client_email = $client->clientEmail();
$client_contact = $client->clientPhoneFixed();
$hotels_name = "";
$hotels = new Hotels();
$hotels->setHotelId(Sessions::getOnlinePaymentHotelId());
$hotels->extractor($hotels->getHotelFromId());
$hotels_name = $hotels->hotelName();
$hotel_room_type = "";
$room = new HotelRoomType();
$room->setRoomTypeId(Sessions::getOnlinePaymentRoomTypeId());
$room->extractor($room->getHotelRoomTypeFromId());
$hotel_room_type = $room->roomTypeName();
$bed_type = Sessions::getOnlinePaymentBedType();
$meal_type = Sessions::getOnlinePaymentMealType();
$room_count = Sessions::getOnlinePaymentRoomCount();
$room_rate = Sessions::getOnlinePaymentRate() . ' ' . Sessions::currSuffix();
$check_in = Sessions::getOnlinePaymentCheckin();
$check_out = Sessions::getOnlinePaymentCheckout();
$mail_tmp = '<table width="560" border="0" align="center">
<tr>
<td width="173" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Reservation Id </td>
<td width="377" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $reservation_id . ' </td>
</tr>
<tr>
<td width="173" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Hotel </td>
<td width="377" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $hotels_name . ' </td>
</tr>
<tr>
<td width="173" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Customer’ Name </td>
<td width="377" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $client_name . ' </td>
</tr>
<tr>
<td width="173" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Customer’ E-mail </td>
<td width="377" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $client_email . ' </td>
</tr>
<tr>
<td width="173" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Customer’ Contact </td>
<td width="377" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $client_contact . ' </td>
</tr>
<tr>
<td style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Room Type </td>
<td style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $hotel_room_type . ' </td>
</tr>
<tr>
<td style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Bed Type</td>
<td style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> :' . $bed_type . ' </td>
</tr>
<tr>
<td height="26" valign="top" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Meal Type </td>
<td valign="top" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px; height:auto !important; min-height:10px; height:auto;"> :' . $meal_type . ' </td>
</tr>
<tr>
<td height="26" valign="top" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> No of Rooms </td>
<td valign="top" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px; height:auto !important; min-height:10px; height:auto;"> :' . $room_count . ' </td>
</tr>
<tr>
<td height="26" valign="top" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Total </td>
<td valign="top" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px; height:auto !important; min-height:10px; height:auto;"> :' . $room_rate . ' </td>
</tr>
<tr>
<td height="26" valign="top" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Check In </td>
<td valign="top" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px; height:auto !important; min-height:10px; height:auto;"> :' . $check_in . ' </td>
</tr>
<tr>
<td height="26" valign="top" style="font-weight:bold; font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px;"> Check Out </td>
<td valign="top" style="font-size:12px; text-align: left; font-family: Arial, Helvetica, sans-serif; color:#60919f; line-height: 19px; margin: 0 0 12px; padding: 4px 3px; height:auto !important; min-height:10px; height:auto;"> :' . $check_out . ' </td>
</tr>
</table>';
$subject = "Reservation Details Roomista.com";
//.........这里部分代码省略.........