removed unnecessary fucntions from guest registration class, added image to optional section, restructured variables assigned to smarty
Co-authored-by: Name <sumit201@webkul.in>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3.0-php
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3.0-php Open Software License version 3.0
|
||||
*}
|
||||
|
||||
<div class="modal fade" id="guestRegPreviewModal" tabindex="-1" role="dialog" aria-labelledby="guestRegPreviewModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="guestRegPreviewModalLabel">{$guest_reg_preview_title|escape:'html':'UTF-8'}</h4>
|
||||
</div>
|
||||
<div class="modal-body text-center">
|
||||
<img src="{$guest_reg_preview_img_url|escape:'html':'UTF-8'}" alt="{$guest_reg_preview_title|escape:'html':'UTF-8'}" class="img-responsive" style="max-width:100%;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
var confKey = '{$guest_reg_conf_key|escape:'javascript'}';
|
||||
var selectedSections = {$guest_reg_selected_sections|json_encode};
|
||||
var previewBtnTitle = '{$guest_reg_preview_btn_title|escape:'javascript'}';
|
||||
|
||||
$(document).ready(function () {
|
||||
// Inject eye-icon preview button next to the "Optional sections" label
|
||||
var $label = $('label[for="' + confKey + '"], .form-group').filter(function () {
|
||||
return $(this).find('input[name^="' + confKey + '"]').length > 0;
|
||||
}).first().find('label').first();
|
||||
|
||||
if (!$label.length) {
|
||||
// Fallback: find the form-group that contains our checkboxes
|
||||
$label = $('input[name^="' + confKey + '"]').closest('.form-group').find('label').first();
|
||||
}
|
||||
|
||||
if ($label.length && !$label.find('.guest-reg-preview-btn').length) {
|
||||
$label.append(
|
||||
' <a href="#" class="guest-reg-preview-btn" title="' + previewBtnTitle + '" data-toggle="modal" data-target="#guestRegPreviewModal" style="margin-left:6px;">' +
|
||||
'<i class="icon-eye"></i>' +
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
|
||||
// Rename checkboxes: QloApps renders them as confKey_0, confKey_1 etc.
|
||||
// but the controller expects confKey[] array. Remap so the POST key is array-style.
|
||||
$('input[type="checkbox"][name^="' + confKey + '"]').each(function () {
|
||||
var sectionId = $(this).val();
|
||||
if (sectionId === undefined || sectionId === '') {
|
||||
// Extract numeric suffix from name like QLO_GUEST_REG_OPTIONAL_SECTIONS_2
|
||||
var match = this.name.match(/_(\d+)$/);
|
||||
if (match) {
|
||||
sectionId = match[1];
|
||||
}
|
||||
}
|
||||
$(this).attr('name', confKey + '[]');
|
||||
if (sectionId !== undefined && sectionId !== '') {
|
||||
$(this).val(sectionId);
|
||||
}
|
||||
});
|
||||
|
||||
// Restore saved selections
|
||||
if (selectedSections && selectedSections.length) {
|
||||
$('input[type="checkbox"][name="' + confKey + '[]"]').each(function () {
|
||||
$(this).prop('checked', $.inArray(parseInt($(this).val(), 10), selectedSections) !== -1);
|
||||
});
|
||||
}
|
||||
|
||||
// Prevent modal link from triggering form submit or nav
|
||||
$(document).on('click', '.guest-reg-preview-btn', function (e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
}(jQuery));
|
||||
</script>
|
||||
35
cache/smarty/cache/index.php
vendored
35
cache/smarty/cache/index.php
vendored
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
@@ -1,11 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* https://opensource.org/license/osl-3.0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
@@ -18,14 +19,13 @@
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
* @license https://opensource.org/license/osl-3.0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
{
|
||||
public $order;
|
||||
public $available_in_your_account = false;
|
||||
protected $id_hotel = 0;
|
||||
protected $id_hotel_booking_detail = null;
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,6 @@ class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
{
|
||||
$this->order = $objOrder;
|
||||
$this->smarty = $smarty;
|
||||
// Grab the ID directly from the URL parameters
|
||||
$this->id_hotel_booking_detail = (int)Tools::getValue('id_hotel_booking_detail');
|
||||
$this->date = Tools::displayDate($objOrder->date_add);
|
||||
$this->title = $objOrder->getUniqReference();
|
||||
@@ -50,7 +49,7 @@ class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
*/
|
||||
public function getHeader()
|
||||
{
|
||||
if ($this->isPdfHeaderEnabled()) {
|
||||
if ((bool)Configuration::get('QLO_GUEST_REG_ENABLE_HEADER')) {
|
||||
return parent::getHeader();
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
|
||||
public function requestMinimalMargins()
|
||||
{
|
||||
return !$this->isPdfHeaderEnabled();
|
||||
return !(bool)Configuration::get('QLO_GUEST_REG_ENABLE_HEADER');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,34 +68,180 @@ class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
$objCustomer = new Customer((int)$this->order->id_customer);
|
||||
$idLang = (int)$this->order->id_lang;
|
||||
$idHotel = (int)HotelBookingDetail::getIdHotelByIdOrder($this->order->id);
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
$hotelBookingDetails = $objHotelBookingDetail->getBookingDataByOrderId($this->order->id);
|
||||
|
||||
// Filter booking details if room_id is provided
|
||||
if ($this->id_hotel_booking_detail) {
|
||||
$hotelBookingDetails = array_filter($hotelBookingDetails, function($detail) {
|
||||
$hotelBookingDetails = array_filter($hotelBookingDetails, function ($detail) {
|
||||
return $detail['id'] == $this->id_hotel_booking_detail;
|
||||
});
|
||||
}
|
||||
|
||||
$this->id_hotel = (int)HotelBookingDetail::getIdHotelByIdOrder($this->order->id);
|
||||
|
||||
$data = array(
|
||||
'order' => $this->order,
|
||||
'registration_form' => array(
|
||||
'guest' => $this->getGuestData($objCustomer),
|
||||
'hotel' => $this->getHotelData($hotelBookingDetails),
|
||||
'stay' => $this->getStayData($hotelBookingDetails),
|
||||
'property' => $this->getPropertyData($hotelBookingDetails),
|
||||
'config' => $this->getRegistrationConfig(),
|
||||
'dynamic_fields' => $this->getDynamicFields(),
|
||||
),
|
||||
);
|
||||
// Hotel info from HotelBranchInformation (authoritative)
|
||||
$hotelName = '';
|
||||
$hotelCheckInTime = '';
|
||||
$hotelCheckOutTime = '';
|
||||
$hotelPolicies = '';
|
||||
$hotelCity = '';
|
||||
$hotelCountry = '';
|
||||
|
||||
if ($idHotel) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $idLang);
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
$hotelName = $objHotelBranchInformation->hotel_name;
|
||||
$hotelCity = (string)$objHotelBranchInformation->city;
|
||||
$policies = $objHotelBranchInformation->policies;
|
||||
$hotelPolicies = is_array($policies) ? '' : (string)$policies;
|
||||
|
||||
$checkIn = $objHotelBranchInformation->check_in;
|
||||
$hotelCheckInTime = ($checkIn && $checkIn != '00:00:00') ? date('h:i a', strtotime($checkIn)) : '';
|
||||
|
||||
$checkOut = $objHotelBranchInformation->check_out;
|
||||
$hotelCheckOutTime = ($checkOut && $checkOut != '00:00:00') ? date('h:i a', strtotime($checkOut)) : '';
|
||||
|
||||
if ($objHotelBranchInformation->id_country) {
|
||||
$objCountry = new Country((int)$objHotelBranchInformation->id_country, $idLang);
|
||||
if (Validate::isLoadedObject($objCountry)) {
|
||||
$hotelCountry = (string)$objCountry->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to booking detail row for name/city/country if branch info unavailable
|
||||
if ((!$hotelName || !$hotelCity || !$hotelCountry) && !empty($hotelBookingDetails)) {
|
||||
$firstDetail = reset($hotelBookingDetails);
|
||||
if (!$hotelName) {
|
||||
$hotelName = $firstDetail['hotel_name'];
|
||||
}
|
||||
if (!$hotelCity) {
|
||||
$hotelCity = $firstDetail['city'];
|
||||
}
|
||||
if (!$hotelCountry) {
|
||||
$hotelCountry = $firstDetail['country'];
|
||||
}
|
||||
}
|
||||
|
||||
// Property logo: hotel image first, then shop logo
|
||||
$propertyLogoPath = '';
|
||||
if ($idHotel && ($cover = HotelImage::getCover($idHotel))) {
|
||||
$imgPath = rtrim(_PS_HOTEL_IMG_DIR_, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.(int)$idHotel.DIRECTORY_SEPARATOR.(int)$cover['id'].'.jpg';
|
||||
if (file_exists($imgPath)) {
|
||||
$propertyLogoPath = $imgPath;
|
||||
}
|
||||
}
|
||||
if (!$propertyLogoPath) {
|
||||
$propertyLogoPath = (string)$this->getLogo();
|
||||
}
|
||||
|
||||
// Stay data: dates, rooms, guests, rate
|
||||
$arrivalDate = '';
|
||||
$departureDate = '';
|
||||
$roomNumbers = array();
|
||||
$roomTypes = array();
|
||||
$adults = 0;
|
||||
$children = 0;
|
||||
$ratePerNight = '';
|
||||
$arrivalDateTime = '';
|
||||
$departureDateTime = '';
|
||||
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$currency = new Currency((int)$this->order->id_currency);
|
||||
$totalRate = 0;
|
||||
$totalRateCount = 0;
|
||||
foreach ($hotelBookingDetails as $detail) {
|
||||
if (!$arrivalDate || strtotime($detail['date_from']) < strtotime($arrivalDate)) {
|
||||
$arrivalDate = $detail['date_from'];
|
||||
}
|
||||
if (!$departureDate || strtotime($detail['date_to']) > strtotime($departureDate)) {
|
||||
$departureDate = $detail['date_to'];
|
||||
}
|
||||
if (!empty($detail['room_num'])) {
|
||||
$roomNumbers[] = $detail['room_num'];
|
||||
}
|
||||
if (!empty($detail['room_type_name'])) {
|
||||
$roomTypes[] = $detail['room_type_name'];
|
||||
}
|
||||
$adults += (int)$detail['adults'];
|
||||
$children += (int)$detail['children'];
|
||||
$nights = (int)HotelHelper::getNumberOfDays($detail['date_from'], $detail['date_to']);
|
||||
if ($nights > 0) {
|
||||
$totalRate += ((float)$detail['total_price_tax_incl'] / $nights);
|
||||
++$totalRateCount;
|
||||
}
|
||||
}
|
||||
|
||||
if ($totalRateCount) {
|
||||
$ratePerNight = Tools::displayPrice($totalRate / $totalRateCount, $currency, false);
|
||||
}
|
||||
|
||||
$arrivalDateTime = $arrivalDate ? Tools::displayDate($arrivalDate) : '';
|
||||
$departureDateTime = $departureDate ? Tools::displayDate($departureDate) : '';
|
||||
if ($arrivalDateTime && $hotelCheckInTime) {
|
||||
$arrivalDateTime .= ' '.$hotelCheckInTime;
|
||||
}
|
||||
if ($departureDateTime && $hotelCheckOutTime) {
|
||||
$departureDateTime .= ' '.$hotelCheckOutTime;
|
||||
}
|
||||
}
|
||||
|
||||
// Additional guests rows based on max_guests of the room type
|
||||
$additionalGuestsRows = 0;
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$idProducts = array_unique(array_filter(array_map('intval', array_column($hotelBookingDetails, 'id_product'))));
|
||||
if (!empty($idProducts)) {
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypeDetails = $objHotelRoomType->getRoomTypeDetailByRoomTypeIds(implode(',', $idProducts), false);
|
||||
if (!empty($roomTypeDetails) && isset($roomTypeDetails[0]['max_guests'])) {
|
||||
$maxGuests = (int)$roomTypeDetails[0]['max_guests'];
|
||||
$additionalGuestsRows = ($maxGuests > 1) ? ($maxGuests - 1) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Optional sections
|
||||
$sectionsValue = Configuration::get('QLO_GUEST_REG_OPTIONAL_SECTIONS');
|
||||
if ($sectionsValue === false || $sectionsValue === '') {
|
||||
$selectedSections = array(1, 2, 3, 4, 5, 6);
|
||||
} else {
|
||||
$decoded = Tools::jsonDecode($sectionsValue, true);
|
||||
$selectedSections = is_array($decoded) ? array_map('intval', $decoded) : array();
|
||||
}
|
||||
|
||||
$this->smarty->assign($data);
|
||||
$this->smarty->assign(array(
|
||||
'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
|
||||
'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')),
|
||||
// Hotel / property header
|
||||
'hotel_name' => $hotelName,
|
||||
'property_logo_path' => $propertyLogoPath,
|
||||
'property_city_country' => implode(', ', array_filter(array($hotelCity, $hotelCountry))),
|
||||
// Booking stay info
|
||||
'booking_reference' => $this->order->getUniqReference(),
|
||||
'arrival_date_time' => $arrivalDateTime,
|
||||
'departure_date_time' => $departureDateTime,
|
||||
'room_type' => implode(', ', array_unique($roomTypes)),
|
||||
'room_number' => implode(', ', array_unique($roomNumbers)),
|
||||
'adults' => $adults,
|
||||
'children' => $children,
|
||||
'rate_per_night' => $ratePerNight,
|
||||
// Property regulations section
|
||||
'hotel_check_in_time' => $hotelCheckInTime,
|
||||
'hotel_check_out_time' => $hotelCheckOutTime,
|
||||
'hotel_policies' => $hotelPolicies,
|
||||
// Additional guests table
|
||||
'additional_guests_rows' => $additionalGuestsRows,
|
||||
// Dynamic field options
|
||||
'purpose_of_visit_options' => GuestRegPurpose::getActiveOptions($idLang),
|
||||
'identity_proof_options' => GuestRegIdProof::getActiveOptions($idLang),
|
||||
'payment_method_options' => GuestRegPaymentMethod::getActiveOptions($idLang),
|
||||
// Optional section visibility flags
|
||||
'show_property_logo' => in_array(1, $selectedSections),
|
||||
'show_additional_guests' => in_array(2, $selectedSections),
|
||||
'show_billing_corporate_details' => in_array(3, $selectedSections),
|
||||
'show_payment_deposit' => in_array(4, $selectedSections),
|
||||
'show_property_regulations' => in_array(5, $selectedSections),
|
||||
'show_office_use_only' => in_array(6, $selectedSections),
|
||||
));
|
||||
|
||||
return $this->smarty->fetch($this->getTemplate('registration-form'));
|
||||
@@ -123,390 +268,7 @@ class HTMLTemplateRegistrationFormCore extends HTMLTemplate
|
||||
if ($this->id_hotel_booking_detail) {
|
||||
$filename .= '-room-'.$this->id_hotel_booking_detail;
|
||||
}
|
||||
|
||||
return $filename.'.pdf';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Customer $objCustomer
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getGuestData(Customer $objCustomer)
|
||||
{
|
||||
$idGender = (int)$objCustomer->id_gender;
|
||||
$guestFullName = trim($objCustomer->firstname.' '.$objCustomer->lastname);
|
||||
$guestEmail = $objCustomer->email;
|
||||
$guestPhone = '';
|
||||
$guestAddress = '';
|
||||
$guestCityCountry = '';
|
||||
$guestPostcode = '';
|
||||
|
||||
if ($this->order->id_address_invoice
|
||||
&& Validate::isLoadedObject($objGuestAddress = new Address((int)$this->order->id_address_invoice))
|
||||
) {
|
||||
if ($objGuestAddress->firstname || $objGuestAddress->lastname) {
|
||||
$guestFullName = trim($objGuestAddress->firstname.' '.$objGuestAddress->lastname);
|
||||
}
|
||||
|
||||
if ($objGuestAddress->phone_mobile) {
|
||||
$guestPhone = $objGuestAddress->phone_mobile;
|
||||
} elseif ($objGuestAddress->phone) {
|
||||
$guestPhone = $objGuestAddress->phone;
|
||||
}
|
||||
|
||||
$guestAddress = $objGuestAddress->address1;
|
||||
if (!empty($objGuestAddress->address2)) {
|
||||
$guestAddress .= ', ' . $objGuestAddress->address2;
|
||||
}
|
||||
|
||||
$guestPostcode = (string)$objGuestAddress->postcode;
|
||||
$guestCityCountryParts = array();
|
||||
if ($objGuestAddress->city) {
|
||||
$guestCityCountryParts[] = $objGuestAddress->city;
|
||||
}
|
||||
if ($objGuestAddress->id_country && Validate::isLoadedObject($objCountry = new Country((int)$objGuestAddress->id_country, (int)$this->order->id_lang))) {
|
||||
$guestCityCountryParts[] = $objCountry->name;
|
||||
}
|
||||
$guestCityCountry = implode(', ', array_filter($guestCityCountryParts));
|
||||
}
|
||||
|
||||
if ($id_order_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($this->order->id)) {
|
||||
if (Validate::isLoadedObject(
|
||||
$objOrderCustomerGuestDetail = new OrderCustomerGuestDetail((int)$id_order_customer_guest_detail)
|
||||
)) {
|
||||
$guestFullName = trim($objOrderCustomerGuestDetail->firstname.' '.$objOrderCustomerGuestDetail->lastname);
|
||||
$guestEmail = $objOrderCustomerGuestDetail->email;
|
||||
$guestPhone = $objOrderCustomerGuestDetail->phone;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'id_gender' => $idGender,
|
||||
'full_name' => $guestFullName,
|
||||
'email' => $guestEmail,
|
||||
'mobile' => $guestPhone,
|
||||
'address' => $guestAddress,
|
||||
'city_country' => $guestCityCountry,
|
||||
'postcode' => $guestPostcode,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $hotelBookingDetails
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getHotelData($hotelBookingDetails)
|
||||
{
|
||||
$hotelName = '';
|
||||
$hotelAddress = '';
|
||||
$hotelEmail = '';
|
||||
$hotelPhone = '';
|
||||
$checkInTime = '';
|
||||
$checkOutTime = '';
|
||||
$hotelPolicies = '';
|
||||
$hotelCity = '';
|
||||
$hotelCountry = '';
|
||||
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$hotelBookingDetail = reset($hotelBookingDetails);
|
||||
$hotelName = $hotelBookingDetail['hotel_name'];
|
||||
$hotelEmail = $hotelBookingDetail['email'];
|
||||
$hotelPhone = $hotelBookingDetail['phone'];
|
||||
$checkInTime = $this->formatHotelTime($hotelBookingDetail['check_in_time']);
|
||||
$checkOutTime = $this->formatHotelTime($hotelBookingDetail['check_out_time']);
|
||||
$hotelCity = $hotelBookingDetail['city'];
|
||||
$hotelCountry = $hotelBookingDetail['country'];
|
||||
}
|
||||
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($this->order->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation((int)$idHotel, (int)$this->order->id_lang);
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
$hotelName = $objHotelBranchInformation->hotel_name;
|
||||
$hotelEmail = $objHotelBranchInformation->email;
|
||||
$hotelPhone = $objHotelBranchInformation->phone;
|
||||
$checkInTime = $this->formatHotelTime($objHotelBranchInformation->check_in);
|
||||
$checkOutTime = $this->formatHotelTime($objHotelBranchInformation->check_out);
|
||||
$hotelPolicies = (string)$objHotelBranchInformation->policies;
|
||||
$hotelCity = (string)$objHotelBranchInformation->city;
|
||||
if ($objHotelBranchInformation->id_country && Validate::isLoadedObject($objCountry = new Country((int)$objHotelBranchInformation->id_country, (int)$this->order->id_lang))) {
|
||||
$hotelCountry = (string)$objCountry->name;
|
||||
}
|
||||
|
||||
if ($idHotelAddress = $objHotelBranchInformation->getHotelIdAddress()) {
|
||||
if (Validate::isLoadedObject($objHotelAddress = new Address((int)$idHotelAddress))) {
|
||||
$objHotelAddress->firstname = $hotelName;
|
||||
$objHotelAddress->lastname = '';
|
||||
$hotelAddress = AddressFormat::generateAddress($objHotelAddress, array(), '<br />', ' ');
|
||||
if (!$hotelCity && $objHotelAddress->city) {
|
||||
$hotelCity = (string)$objHotelAddress->city;
|
||||
}
|
||||
if (!$hotelCountry && $objHotelAddress->id_country && Validate::isLoadedObject($objCountry = new Country((int)$objHotelAddress->id_country, (int)$this->order->id_lang))) {
|
||||
$hotelCountry = (string)$objCountry->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$hotelAddress && !empty($hotelBookingDetails)) {
|
||||
$hotelBookingDetail = reset($hotelBookingDetails);
|
||||
$hotelAddressParts = array(
|
||||
$hotelBookingDetail['hotel_name'],
|
||||
$hotelBookingDetail['city'],
|
||||
$hotelBookingDetail['state'],
|
||||
$hotelBookingDetail['country'],
|
||||
$hotelBookingDetail['zipcode'],
|
||||
);
|
||||
$hotelAddress = implode(', ', array_filter($hotelAddressParts));
|
||||
}
|
||||
|
||||
return array(
|
||||
'name' => $hotelName,
|
||||
'address' => $hotelAddress,
|
||||
'email' => $hotelEmail,
|
||||
'phone' => $hotelPhone,
|
||||
'check_in_time' => $checkInTime,
|
||||
'check_out_time' => $checkOutTime,
|
||||
'policies' => $hotelPolicies,
|
||||
'city' => $hotelCity,
|
||||
'country' => $hotelCountry,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $hotelBookingDetails
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getStayData($hotelBookingDetails)
|
||||
{
|
||||
$arrivalDate = '';
|
||||
$departureDate = '';
|
||||
$roomNumbers = array();
|
||||
$roomTypes = array();
|
||||
$adults = 0;
|
||||
$children = 0;
|
||||
$ratePerNight = '';
|
||||
$arrivalDateTime = '';
|
||||
$departureDateTime = '';
|
||||
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$currency = new Currency((int)$this->order->id_currency);
|
||||
$totalRate = 0;
|
||||
$totalRateCount = 0;
|
||||
foreach ($hotelBookingDetails as $hotelBookingDetail) {
|
||||
if (!$arrivalDate || strtotime($hotelBookingDetail['date_from']) < strtotime($arrivalDate)) {
|
||||
$arrivalDate = $hotelBookingDetail['date_from'];
|
||||
}
|
||||
|
||||
if (!$departureDate || strtotime($hotelBookingDetail['date_to']) > strtotime($departureDate)) {
|
||||
$departureDate = $hotelBookingDetail['date_to'];
|
||||
}
|
||||
|
||||
if (!empty($hotelBookingDetail['room_num'])) {
|
||||
$roomNumbers[] = $hotelBookingDetail['room_num'];
|
||||
}
|
||||
|
||||
if (!empty($hotelBookingDetail['room_type_name'])) {
|
||||
$roomTypes[] = $hotelBookingDetail['room_type_name'];
|
||||
}
|
||||
|
||||
$adults += (int)$hotelBookingDetail['adults'];
|
||||
$children += (int)$hotelBookingDetail['children'];
|
||||
|
||||
$nights = (int)HotelHelper::getNumberOfDays($hotelBookingDetail['date_from'], $hotelBookingDetail['date_to']);
|
||||
if ($nights > 0) {
|
||||
$totalRate += ((float)$hotelBookingDetail['total_price_tax_incl'] / $nights);
|
||||
++$totalRateCount;
|
||||
}
|
||||
}
|
||||
|
||||
if ($totalRateCount) {
|
||||
$avgRate = $totalRate / $totalRateCount;
|
||||
$ratePerNight = Tools::displayPrice($avgRate, $currency, false);
|
||||
}
|
||||
|
||||
$firstBookingDetail = reset($hotelBookingDetails);
|
||||
$checkInTime = isset($firstBookingDetail['check_in_time']) ? $this->formatHotelTime($firstBookingDetail['check_in_time']) : '';
|
||||
$checkOutTime = isset($firstBookingDetail['check_out_time']) ? $this->formatHotelTime($firstBookingDetail['check_out_time']) : '';
|
||||
$arrivalDateTime = $arrivalDate ? Tools::displayDate($arrivalDate) : '';
|
||||
$departureDateTime = $departureDate ? Tools::displayDate($departureDate) : '';
|
||||
if ($arrivalDateTime && $checkInTime) {
|
||||
$arrivalDateTime .= ' '.$checkInTime;
|
||||
}
|
||||
if ($departureDateTime && $checkOutTime) {
|
||||
$departureDateTime .= ' '.$checkOutTime;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'arrival_date' => $arrivalDate ? Tools::displayDate($arrivalDate) : '',
|
||||
'departure_date' => $departureDate ? Tools::displayDate($departureDate) : '',
|
||||
'arrival_date_time' => $arrivalDateTime,
|
||||
'departure_date_time' => $departureDateTime,
|
||||
'room_number' => implode(', ', array_unique($roomNumbers)),
|
||||
'room_type' => implode(', ', array_unique($roomTypes)),
|
||||
'booking_reference' => $this->order->getUniqReference(),
|
||||
'adults' => $adults,
|
||||
'children' => $children,
|
||||
'rate_per_night' => $ratePerNight,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $hotelBookingDetails
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getPropertyData($hotelBookingDetails)
|
||||
{
|
||||
$propertyLogo = '';
|
||||
if ($this->id_hotel) {
|
||||
$propertyLogo = $this->getHotelLogoPath($this->id_hotel);
|
||||
}
|
||||
if (!$propertyLogo) {
|
||||
$propertyLogo = (string)$this->getLogo();
|
||||
}
|
||||
|
||||
$cityCountry = '';
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$hotelBookingDetail = reset($hotelBookingDetails);
|
||||
$cityCountry = implode(', ', array_filter(array($hotelBookingDetail['city'], $hotelBookingDetail['country'])));
|
||||
}
|
||||
if (!$cityCountry) {
|
||||
$hotelData = $this->getHotelData($hotelBookingDetails);
|
||||
$cityCountry = implode(', ', array_filter(array($hotelData['city'], $hotelData['country'])));
|
||||
}
|
||||
|
||||
$website = '';
|
||||
if (method_exists('Tools', 'getShopDomainSsl')) {
|
||||
$website = Tools::getShopDomainSsl(true, true);
|
||||
} else {
|
||||
$website = Tools::getHttpHost(true);
|
||||
}
|
||||
$website .= __PS_BASE_URI__;
|
||||
|
||||
$additionalGuestsRows = 0;
|
||||
if (!empty($hotelBookingDetails)) {
|
||||
$idProducts = array();
|
||||
foreach ($hotelBookingDetails as $hotelBookingDetail) {
|
||||
if (!empty($hotelBookingDetail['id_product'])) {
|
||||
$idProducts[] = (int)$hotelBookingDetail['id_product'];
|
||||
}
|
||||
}
|
||||
$idProducts = array_unique($idProducts);
|
||||
if (!empty($idProducts)) {
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$roomTypes = $objHotelRoomType->getRoomTypeDetailByRoomTypeIds(implode(',', $idProducts), false);
|
||||
if (!empty($roomTypes) && isset($roomTypes[0]['max_guests'])) {
|
||||
$maxGuests = (int)$roomTypes[0]['max_guests'];
|
||||
$additionalGuestsRows = ($maxGuests > 1) ? ($maxGuests - 1) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'logo_path' => $propertyLogo,
|
||||
'city_country' => $cityCountry,
|
||||
'website' => $website,
|
||||
'additional_guests_rows' => (int)$additionalGuestsRows,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $idHotel
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getHotelLogoPath($idHotel)
|
||||
{
|
||||
if (!$idHotel) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($cover = HotelImage::getCover((int)$idHotel)) {
|
||||
$imgPath = rtrim(_PS_HOTEL_IMG_DIR_, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.(int)$idHotel.DIRECTORY_SEPARATOR.(int)$cover['id'].'.jpg';
|
||||
if (file_exists($imgPath)) {
|
||||
return $imgPath;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function isPdfHeaderEnabled()
|
||||
{
|
||||
return (bool)Configuration::get('QLO_GUEST_REG_ENABLE_HEADER');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getRegistrationConfig()
|
||||
{
|
||||
$selectedSections = $this->getSelectedOptionalSections();
|
||||
|
||||
return array(
|
||||
'show_header' => $this->isPdfHeaderEnabled(),
|
||||
'show_additional_guests' => in_array(1, $selectedSections),
|
||||
'show_billing_corporate_details' => in_array(2, $selectedSections),
|
||||
'show_payment_deposit' => in_array(3, $selectedSections),
|
||||
'show_property_regulations' => in_array(4, $selectedSections),
|
||||
'show_office_use_only' => in_array(5, $selectedSections),
|
||||
'show_property_logo' => in_array(6, $selectedSections),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getDynamicFields()
|
||||
{
|
||||
$idLang = (int)$this->order->id_lang;
|
||||
|
||||
return array(
|
||||
'purpose_of_visit' => GuestRegPurpose::getActiveOptions($idLang),
|
||||
'identity_proof' => GuestRegIdProof::getActiveOptions($idLang),
|
||||
'payment_method' => GuestRegPaymentMethod::getActiveOptions($idLang),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getSelectedOptionalSections()
|
||||
{
|
||||
$value = Configuration::get('QLO_GUEST_REG_OPTIONAL_SECTIONS');
|
||||
|
||||
if ($value === false || $value === '') {
|
||||
return array(1, 2, 3, 4, 5, 6);
|
||||
}
|
||||
|
||||
$value = Tools::jsonDecode($value, true);
|
||||
|
||||
if (!is_array($value)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
return array_map('intval', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hotelTime
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function formatHotelTime($hotelTime)
|
||||
{
|
||||
if (!$hotelTime || $hotelTime == '00:00:00') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return date('h:i a', strtotime($hotelTime));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3.0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3.0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
class AdminGuestRegistrationControllerCore extends AdminController
|
||||
{
|
||||
@@ -97,7 +95,6 @@ class AdminGuestRegistrationControllerCore extends AdminController
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
// ddd(Tools::getAllValues());
|
||||
if (Tools::isSubmit('submitBulkGuestRegistrationValues')) {
|
||||
$this->processBulkDynamicFieldSave();
|
||||
|
||||
@@ -116,21 +113,16 @@ class AdminGuestRegistrationControllerCore extends AdminController
|
||||
$this->fields_options['general']['fields'][self::CONF_OPTIONAL_SECTIONS]['value'] = '';
|
||||
|
||||
$html = parent::renderOptions();
|
||||
$selectedSections = Tools::jsonEncode($this->getSelectedOptionalSections());
|
||||
|
||||
$html .= '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var selectedSections = '.$selectedSections.';
|
||||
$("input[name=\"'.self::CONF_OPTIONAL_SECTIONS.'\"]").each(function() {
|
||||
var checkboxValue = parseInt($(this).val(), 10);
|
||||
$(this).attr("name", "'.self::CONF_OPTIONAL_SECTIONS.'[]");
|
||||
if ($.inArray(checkboxValue, selectedSections) !== -1) {
|
||||
$(this).prop("checked", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$this->context->smarty->assign(array(
|
||||
'guest_reg_preview_img_url' => $this->context->link->getBaseLink().'img/admin/guest_registration_preview.jpg',
|
||||
'guest_reg_selected_sections' => $this->getSelectedOptionalSections(),
|
||||
'guest_reg_conf_key' => self::CONF_OPTIONAL_SECTIONS,
|
||||
'guest_reg_preview_title' => $this->l('Guest Registration Card Preview'),
|
||||
'guest_reg_preview_btn_title' => $this->l('Preview'),
|
||||
));
|
||||
|
||||
$html .= $this->createTemplate('preview_modal.tpl')->fetch();
|
||||
|
||||
return $html;
|
||||
}
|
||||
@@ -432,12 +424,12 @@ class AdminGuestRegistrationControllerCore extends AdminController
|
||||
protected function getOptionalSectionChoices()
|
||||
{
|
||||
return array(
|
||||
1 => $this->l('Additional Guests'),
|
||||
2 => $this->l('Billing & Corporate Details'),
|
||||
3 => $this->l('Payment & Deposit'),
|
||||
4 => $this->l('Property Regulations'),
|
||||
5 => $this->l('For Office Use Only'),
|
||||
6 => $this->l('Property Logo'),
|
||||
1 => $this->l('Property Logo'),
|
||||
2 => $this->l('Additional Guests'),
|
||||
3 => $this->l('Billing & Corporate Details'),
|
||||
4 => $this->l('Payment & Deposit'),
|
||||
5 => $this->l('Property Regulations'),
|
||||
6 => $this->l('For Office Use Only'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
BIN
img/admin/guest_registration_preview.jpg
Normal file
BIN
img/admin/guest_registration_preview.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
@@ -28,11 +28,11 @@
|
||||
{l s='GUEST REGISTRATION CARD' pdf='true'}
|
||||
</td>
|
||||
</tr>
|
||||
{if $registration_form.config.show_property_logo}
|
||||
{if $show_property_logo}
|
||||
<tr>
|
||||
<td width="100%" class="center">
|
||||
{if $registration_form.property.logo_path}
|
||||
<img src="{$registration_form.property.logo_path}" style="height:60px;" />
|
||||
{if $property_logo_path}
|
||||
<img src="{$property_logo_path}" style="height:60px;" />
|
||||
{else}
|
||||
<strong>[PROPERTY LOGO]</strong>
|
||||
{/if}
|
||||
@@ -41,12 +41,12 @@
|
||||
{/if}
|
||||
<tr>
|
||||
<td width="100%" class="center" style="font-size: 12pt; font-weight: bold;">
|
||||
{$registration_form.hotel.name|escape:'html':'UTF-8'}
|
||||
{$hotel_name|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="100%" class="center">
|
||||
{$registration_form.property.city_country|escape:'html':'UTF-8'}
|
||||
{$property_city_country|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -64,44 +64,44 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='TITLE:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
<span style="font-family: freeserif;">□</span> {l s='Mr.' pdf='true'}
|
||||
<span style="font-family: freeserif;">□</span> {l s='Ms.' pdf='true'}
|
||||
</td>
|
||||
<td width="25%" class="bold">{l s='Full Name (As per ID):' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Phone / Mobile:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
<td width="25%" class="bold">{l s='Email:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Date of Birth:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ________</td>
|
||||
<td width="25%" class="bold">{l s='Nationality:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='City / Country:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
<td width="25%" class="bold">{l s='Postal Code:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Address:' pdf='true'}</td>
|
||||
<td width="75%" colspan="3" class="white">__________________________________________________________________________________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='TITLE:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
<span style="font-family: freeserif;">□</span> {l s='Mr.' pdf='true'}
|
||||
<span style="font-family: freeserif;">□</span> {l s='Ms.' pdf='true'}
|
||||
</td>
|
||||
<td width="25%" class="bold">{l s='Full Name (As per ID):' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Phone / Mobile:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
<td width="25%" class="bold">{l s='Email:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Date of Birth:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ________</td>
|
||||
<td width="25%" class="bold">{l s='Nationality:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='City / Country:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
<td width="25%" class="bold">{l s='Postal Code:' pdf='true'}</td>
|
||||
<td width="25%" class="white">________________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Address:' pdf='true'}</td>
|
||||
<td width="75%" colspan="3" class="white">__________________________________________________________________________________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -134,7 +134,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Purpose of Visit:' pdf='true'}</td>
|
||||
<td width="75%" colspan="3" class="white">{if $registration_form.dynamic_fields.purpose_of_visit|@count}{foreach from=$registration_form.dynamic_fields.purpose_of_visit item=item name=purposeOfVisit}{if !$smarty.foreach.purposeOfVisit.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}{else}________________________{/if}</td>
|
||||
<td width="75%" colspan="3" class="white">{if $purpose_of_visit_options|@count}{foreach from=$purpose_of_visit_options item=item name=purposeOfVisit}{if !$smarty.foreach.purposeOfVisit.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}{else}________________________{/if}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -160,11 +160,11 @@
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Booking Reference No.:' pdf='true'}</td>
|
||||
<td width="25%" class="white">{$registration_form.stay.booking_reference|escape:'html':'UTF-8'}</td>
|
||||
<td width="25%" class="white">{$booking_reference|escape:'html':'UTF-8'}</td>
|
||||
<td width="25%" class="bold">{l s='Rate per Night:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
{if $registration_form.stay.rate_per_night}
|
||||
{$registration_form.stay.rate_per_night|escape:'html':'UTF-8'}
|
||||
{if $rate_per_night}
|
||||
{$rate_per_night|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
__________
|
||||
{/if}
|
||||
@@ -173,16 +173,16 @@
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Arrival Date & Time:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
{if $registration_form.stay.arrival_date_time}
|
||||
{$registration_form.stay.arrival_date_time|escape:'html':'UTF-8'}
|
||||
{if $arrival_date_time}
|
||||
{$arrival_date_time|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
____ / ____ / ____ ______
|
||||
{/if}
|
||||
</td>
|
||||
<td width="25%" class="bold">{l s='Departure Date & Time:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
{if $registration_form.stay.departure_date_time}
|
||||
{$registration_form.stay.departure_date_time|escape:'html':'UTF-8'}
|
||||
{if $departure_date_time}
|
||||
{$departure_date_time|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
____ / ____ / ____ ______
|
||||
{/if}
|
||||
@@ -190,15 +190,15 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Room Type:' pdf='true'}</td>
|
||||
<td width="25%" class="white">{$registration_form.stay.room_type|escape:'html':'UTF-8'}</td>
|
||||
<td width="25%" class="white">{$room_type|escape:'html':'UTF-8'}</td>
|
||||
<td width="25%" class="bold">{l s='Room Number:' pdf='true'}</td>
|
||||
<td width="25%" class="white">{$registration_form.stay.room_number|escape:'html':'UTF-8'}</td>
|
||||
<td width="25%" class="white">{$room_number|escape:'html':'UTF-8'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Number of Guests:' pdf='true'}</td>
|
||||
<td width="25%" class="white">
|
||||
{l s='Adults:' pdf='true'} {$registration_form.stay.adults|escape:'html':'UTF-8'}
|
||||
{l s='Children:' pdf='true'} {$registration_form.stay.children|escape:'html':'UTF-8'}
|
||||
{l s='Adults:' pdf='true'} {$adults|escape:'html':'UTF-8'}
|
||||
{l s='Children:' pdf='true'} {$children|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -221,59 +221,59 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<strong><span style="font-family: freeserif; font-size: 14pt;">□</span> {l s='LOCAL GUEST' pdf='true'}</strong><br /><br />
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Identity Proof:' pdf='true'}</td>
|
||||
{if $registration_form.dynamic_fields.identity_proof|@count}
|
||||
<td width="75%" class="white">{foreach from=$registration_form.dynamic_fields.identity_proof item=item name=identityProof}{if !$smarty.foreach.identityProof.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}</td>
|
||||
<td class="white">
|
||||
<strong><span style="font-family: freeserif; font-size: 14pt;">□</span> {l s='LOCAL GUEST' pdf='true'}</strong><br /><br />
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Identity Proof:' pdf='true'}</td>
|
||||
{if $identity_proof_options|@count}
|
||||
<td width="75%" class="white">{foreach from=$identity_proof_options item=item name=identityProof}{if !$smarty.foreach.identityProof.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}</td>
|
||||
{else}
|
||||
<td width="75%" class="white">________________________________</td>
|
||||
{/if}
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='ID Number:' pdf='true'}</td>
|
||||
<td width="75%" class="white">________________________________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<strong><span style="font-family: freeserif; font-size: 14pt;">□</span> {l s='INTERNATIONAL GUEST' pdf='true'}</strong><br /><br />
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Passport No.:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
<td width="25%" class="bold">{l s='Place of Issue:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Date of Issue:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
<td width="25%" class="bold">{l s='Date of Expiry:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Visa Number:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
<td width="25%" class="bold">{l s='Valid Until:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Arrival Date in Country:' pdf='true'}</td>
|
||||
<td width="75%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='ID Number:' pdf='true'}</td>
|
||||
<td width="75%" class="white">________________________________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<strong><span style="font-family: freeserif; font-size: 14pt;">□</span> {l s='INTERNATIONAL GUEST' pdf='true'}</strong><br /><br />
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Passport No.:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
<td width="25%" class="bold">{l s='Place of Issue:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Date of Issue:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
<td width="25%" class="bold">{l s='Date of Expiry:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Visa Number:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____________________</td>
|
||||
<td width="25%" class="bold">{l s='Valid Until:' pdf='true'}</td>
|
||||
<td width="25%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Arrival Date in Country:' pdf='true'}</td>
|
||||
<td width="75%" class="white">____ / ____ / ____</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $registration_form.config.show_additional_guests}
|
||||
{if $show_additional_guests}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
@@ -295,7 +295,7 @@
|
||||
<th class="header small" width="17%">{l s='ID Number' pdf='true'}</th>
|
||||
<th class="header small" width="15%">{l s='Nationality' pdf='true'}</th>
|
||||
</tr>
|
||||
{section name=ag loop=$registration_form.property.additional_guests_rows}
|
||||
{section name=ag loop=$additional_guests_rows}
|
||||
<tr class="color_line_even">
|
||||
<td class="center white">{$smarty.section.ag.iteration}</td>
|
||||
<td class="white">______________________________</td>
|
||||
@@ -304,7 +304,7 @@
|
||||
<td class="white">____________</td>
|
||||
</tr>
|
||||
{/section}
|
||||
{if !$registration_form.property.additional_guests_rows}
|
||||
{if !$additional_guests_rows}
|
||||
<tr class="color_line_even">
|
||||
<td class="center white">1</td>
|
||||
<td class="white">______________________________</td>
|
||||
@@ -322,7 +322,7 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $registration_form.config.show_billing_corporate_details}
|
||||
{if $show_billing_corporate_details}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
@@ -354,7 +354,7 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $registration_form.config.show_payment_deposit}
|
||||
{if $show_payment_deposit}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
@@ -371,7 +371,7 @@
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Payment Method:' pdf='true'}</td>
|
||||
<td width="75%" class="white">{if $registration_form.dynamic_fields.payment_method|@count}{foreach from=$registration_form.dynamic_fields.payment_method item=item name=paymentMethod}{if !$smarty.foreach.paymentMethod.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}{else}________________________________{/if}</td>
|
||||
<td width="75%" class="white">{if $payment_method_options|@count}{foreach from=$payment_method_options item=item name=paymentMethod}{if !$smarty.foreach.paymentMethod.first} {/if}<span style="font-family: freeserif; white-space: nowrap;">□ {$item.name|escape:'html':'UTF-8'|replace:' ':' '}</span>{/foreach}{else}________________________________{/if}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Credit Card Number:' pdf='true'}</td>
|
||||
@@ -388,7 +388,7 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $registration_form.config.show_property_regulations}
|
||||
{if $show_property_regulations}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
@@ -400,32 +400,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{* <tr>
|
||||
<td class="white">
|
||||
<table width="100%" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25%" class="bold">{l s='Guest Signature:' pdf='true'}</td>
|
||||
<td width="45%" class="white">______________________________</td>
|
||||
<td width="10%" class="bold">{l s='Date:' pdf='true'}</td>
|
||||
<td width="20%" class="white">____ / ____ / ________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr> *}
|
||||
<tr>
|
||||
<td class="white">
|
||||
<strong> {l s='Check-in Time:' pdf='true'}</strong>
|
||||
{if $registration_form.hotel.check_in_time}{$registration_form.hotel.check_in_time|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
{if $hotel_check_in_time}{$hotel_check_in_time|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
|
||||
<strong>{l s='Check-out Time:' pdf='true'}</strong>
|
||||
{if $registration_form.hotel.check_out_time}{$registration_form.hotel.check_out_time|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
{if $hotel_check_out_time}{$hotel_check_out_time|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="white">
|
||||
<strong> {l s='Hotel Policies:' pdf='true'}</strong>
|
||||
{if $registration_form.hotel.policies}
|
||||
{$registration_form.hotel.policies}
|
||||
{if $hotel_policies}
|
||||
{$hotel_policies}
|
||||
{else}
|
||||
______________________________<br />
|
||||
______________________________<br />
|
||||
@@ -439,7 +427,7 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $registration_form.config.show_office_use_only}
|
||||
{if $show_office_use_only}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
@@ -463,7 +451,8 @@
|
||||
<tr>
|
||||
<td width="20%" class="bold">{l s='ID Verified:' pdf='true'}</td>
|
||||
<td width="30%" class="white"><span style="font-family: freeserif;">□</span> {l s='Yes' pdf='true'} <span style="font-family: freeserif;">□</span> {l s='No' pdf='true'}</td>
|
||||
<td width="20%" class="bold">{l s='Registration No.:' pdf='true'}</td> <td width="30%" class="white">____________________</td>
|
||||
<td width="20%" class="bold">{l s='Registration No.:' pdf='true'}</td>
|
||||
<td width="30%" class="white">____________________</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -474,31 +463,10 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{* {if $registration_form.config.show_footer}
|
||||
<tr><td colspan="12" height="10"> </td></tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<table width="100%" cellpadding="3" cellspacing="0" nobr="true">
|
||||
<tr>
|
||||
<td width="100%" class="center small">
|
||||
{if $registration_form.hotel.address}{$registration_form.hotel.address}{else}[Property Address]{/if}
|
||||
<br />
|
||||
{l s='Phone No.:' pdf='true'} {if $registration_form.hotel.phone}{$registration_form.hotel.phone|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
|
|
||||
{l s='Email:' pdf='true'} {if $registration_form.hotel.email}{$registration_form.hotel.email|escape:'html':'UTF-8'}{else}__________{/if}
|
||||
|
|
||||
{l s='Website:' pdf='true'} {$registration_form.property.website|escape:'html':'UTF-8'}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/if} *}
|
||||
<tr>
|
||||
<td colspan="12" height="10"> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<table class="bordered-table" width="100%" cellpadding="5" cellspacing="0" nobr="true">
|
||||
@@ -520,7 +488,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
{if isset($HOOK_DISPLAY_PDF)}
|
||||
<tr>
|
||||
<td colspan="12" height="10"> </td>
|
||||
|
||||
Reference in New Issue
Block a user