\booking

This file is the main code block that manages the booking engine.

#

Summary

Methods
Properties
Constants
__construct()
getTmpBookingData()
getTmpGuestData()
storeBookingDetails()
getAllRoomsData()
getAllTariffsData()
getAllRoomFeatureDetails()
getAllRoomClasses()
getAllRoomFeatures()
getAllBookings()
get_all_tariff_types()
getAllTaxRates()
sanitise_for_eval()
get_fullybooked_dates()
sanitiseInput()
sanitiseOutput()
makeStringSafe()
resetRequestedRoom()
errorChecking()
setErrorLog()
setErrorLogFirst()
getErrorLog()
writeToLogfile()
getGrowlMessages()
setPopupMessage()
setGuestPopupMessage()
echo_populate_div()
getSingleRoomPropertyStatus()
makeExtras()
makeThirdPartyExtras()
makeOutputText()
implodeVariances()
setVariant()
getVariant()
getVariantsOfType()
initRoomFeatureFiltering()
toggleRoomFilterId()
check_room_has_selected_room_feature()
room_acceptable_according_to_room_filter()
checkRoomFeatureOption()
saveOverride()
initCoupons()
saveCoupon()
getGuestVariantCount()
getNumberOfGuestsSelected()
getGuestVariantDetails()
setGuestVariantDetails()
initGuestVariant()
checkGuestVariantIdAndQty()
makeCustomerTypes()
initExtras()
getExtras()
setExtras()
removeExtra()
checkExtra()
extraAlreadySelected()
modifyExtraQuantity()
add_third_party_extra()
remove_third_party_extra()
reset_choices_for_plugin()
add_additiional_line_item()
initArrivalDate()
nextDatePropertyHasRoomFree()
checkArrivalDate()
setArrivalDate()
getArrivalDate()
makeArrivalDateOutput()
fixedDaysArrivaldateDropdown()
initDepartureDate()
setDepartureDate()
setDepartureDateToNextDay()
checkDepartureDate()
getFixedPeriodDepartureDate()
getDepartureDate()
makeDepartureDateOutput()
dateRangeIncludesWeekends()
dateRangeIsAllWeekends()
getDayOfWeek()
setDateRangeString()
findDateRangeForDates()
findDaysForDates()
getUnixArrivalDate()
getUnixDepartureDate()
setStayDays()
getStayDays()
get_part_of_stay_period()
get_rate_per_night_converted_to_output_period()
outputDate()
JSCalmakeInputDates()
JSCalConvertInputDates()
calcPeriods()
setGuest_existing_id()
setGuest_firstname()
setGuest_surname()
setGuest_house()
setGuest_street()
setGuest_town()
setGuest_region()
setGuest_postcode()
setGuest_country()
setGuest_tel_landline()
setGuest_tel_mobile()
setGuest_email()
setGuest_discount()
checkEmail()
getExistingCustomerData()
resetExistingCustomer()
makeRequiredIcons()
initGuestDetails()
makeGuestData()
AJgetGuestDropdown()
bookingCountriesDropdown()
updateSelectedRoom()
updateRoomAllocation()
checkAllGuestsAllocatedToRooms()
checkExistingRoomsTariffsForRoomsTariffsWhereMinRoomSettingIsNoLongerMet()
removeFromSelectedRooms()
addToSelectedRooms()
numberOfCurrentlySelectedRooms()
checkRoomNotAlreadySelected()
checkTariffTalliesWithRoom()
listCurrentlySelectedRooms()
getAllRoomUidsForProperty()
removeRoomuidsAlreadyInThisBooking()
findFreeRoomsInDateRange()
extractLockedRooms()
checkPeopleNumbers()
getTotalInParty()
convertArrayToObject()
getTariffsForRoomUidByClass()
getTariffsForRoomClass()
getTariffsForRoomUids()
filter_tariffs_staydays()
filter_tariffs_on_dates()
filter_tariffs_alreadyselectedcheck()
filter_tariffs_peoplenumbercheck()
filter_tariffs_dowcheck()
build_tariff_to_date_map()
get_periods()
limitRoomsList()
generateRoomsList()
generate_room_type_dropdowns()
isAlreadyASelectedOption()
makeRoomTariffDetails()
makeRoomOverlibdata()
calculateRoomPriceIncVat()
GetRoomDetails()
GetTariffDetails()
estimate_AverageRate()
makeTariffHeaders()
monitorBookingStatus()
outputZeroPrices()
setOkToBook()
getOkToBook()
setMonitoring()
getMonitoringNumberOfMessages()
monitorGetFirstMessage()
monitorGetAllMessages()
selectedRoomsCanHostTotalInParty()
tariffsCanHostTotalInParty()
setVariantValues()
setGuestTypeVariantValues()
makeNightlyRoomCharges()
coupon_booking_date_ranges()
calcTotals()
calcExtras()
calcTax()
calcSinglePersonSuppliment()
calcDeposit()
getDeposit()
getExtrasTotal()
getTax()
getSinglePersonSuppliment()
getRoomAllocationOutput()
getGrandTotal()
getRoompernight()
getRoomtotal()
resetTotals()
makeRatePerNight()
setFlatRate()
outputDiscounts()
getPercentageOfRoomsBookedForRoomtype()
getDiscountedRoomrate()
setAverageRate()
te_setAverageRate()
get_nett_price()
get_gross_price()
calcLastMinuteDiscount()
generateBilling()
addBookingNote()
getMkTime()
email_usage_check()
generateDateInput()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
sort_alphabetic()
$mktimes
N/A

Properties

$mktimes

$mktimes : 

Type

Methods

__construct()

__construct() 

Constructor for the jomres_booking object, sets a bunch of variables, finds configuration settings & gets the current state of the booking from the tmpbooking table.

getTmpBookingData()

getTmpBookingData() 

Queries the database for the temporary booking data.

getTmpGuestData()

getTmpGuestData() 

Queries the database for the temporary booking data.

storeBookingDetails()

storeBookingDetails() 

Save the details of the booking object.

getAllRoomsData()

getAllRoomsData() 

getAllTariffsData()

getAllTariffsData() 

getAllRoomFeatureDetails()

getAllRoomFeatureDetails() 

getAllRoomClasses()

getAllRoomClasses() 

getAllRoomFeatures()

getAllRoomFeatures() 

getAllBookings()

getAllBookings() 

get_all_tariff_types()

get_all_tariff_types() 

getAllTaxRates()

getAllTaxRates() 

sanitise_for_eval()

sanitise_for_eval(  $string) 

Parameters

$string

get_fullybooked_dates()

get_fullybooked_dates() 

sanitiseInput()

sanitiseInput(  $type,   $value) 

Sanitises the input from the ajax query.

Parameters

$type
$value

sanitiseOutput()

sanitiseOutput(  $data) 

Sanitises the output before it's sent to the form. As the third phase of the form is generated from evaluated javascript queries any ' characters etc have to be stripped out before they're returned to the booking form.

Parameters

$data

makeStringSafe()

makeStringSafe(  $data) 

Make the string escaped.

Parameters

$data

resetRequestedRoom()

resetRequestedRoom() 

Resets the requested room array to nuthin. When the currently available rooms list is re-generated the available rooms list is completely re-calculated.

errorChecking()

errorChecking() 

Returns whether or not error checking flag is on or off.

setErrorLog()

setErrorLog(  $errorText) 

Receives debugging messages and stores them in an array $this->error.

Parameters

$errorText

setErrorLogFirst()

setErrorLogFirst(  $title) 

Parameters

$title

getErrorLog()

getErrorLog() 

Returns the contents of $this->error.

writeToLogfile()

writeToLogfile(  $text) 

Parameters

$text

getGrowlMessages()

getGrowlMessages() 

setPopupMessage()

setPopupMessage(  $message) 

Parameters

$message

setGuestPopupMessage()

setGuestPopupMessage(  $message) 

Parameters

$message

echo_populate_div()

echo_populate_div(  $message) 

Parameters

$message

getSingleRoomPropertyStatus()

getSingleRoomPropertyStatus() 

Returns true if this property is an SRP.

makeExtras()

makeExtras(  $selectedProperty) 

Make the Optional Extras.

Parameters

$selectedProperty

makeThirdPartyExtras()

makeThirdPartyExtras(  $selectedProperty) 

Parameters

$selectedProperty

makeOutputText()

makeOutputText() 

Make the Output text, put them into an array for patTemplate and return the array.

implodeVariances()

implodeVariances() 

Implodes the variances ready for storing in the database.

setVariant()

setVariant(  $type = '',   $id = '',   $qty,   $val = 0.0,   $val_nodiscount = 0.0) 

Generic variant handling. Sets the variant to the specified values.

Parameters

$type
$id
$qty
$val
$val_nodiscount

getVariant()

getVariant(  $type = '',   $id = '') 

Generic variant handling. Returns the variant quantity and value given the variant type and it's id.

Parameters

$type
$id

getVariantsOfType()

getVariantsOfType(  $type = '') 

Generic variant handling. Return all variants of a given type.

Parameters

$type

initRoomFeatureFiltering()

initRoomFeatureFiltering() 

toggleRoomFilterId()

toggleRoomFilterId(  $id) 

Parameters

$id

check_room_has_selected_room_feature()

check_room_has_selected_room_feature(  $room_id) 

Parameters

$room_id

room_acceptable_according_to_room_filter()

room_acceptable_according_to_room_filter(  $room_id) 

Parameters

$room_id

checkRoomFeatureOption()

checkRoomFeatureOption(  $freeRoomsArray) 

Parameters

$freeRoomsArray

saveOverride()

saveOverride(  $values) 

Parameters

$values

initCoupons()

initCoupons() 

Coupons initialise the coupon variables.

saveCoupon()

saveCoupon(  $coupon_code) 

Coupons saveCoupon and return a success/failure message.

Parameters

$coupon_code

getGuestVariantCount()

getGuestVariantCount() 

Guest type variants: return the total number of guest type variants.

getNumberOfGuestsSelected()

getNumberOfGuestsSelected() 

getGuestVariantDetails()

getGuestVariantDetails(  $id) 

Guest type variants: return the details of a given guest type when passed it's id.

Parameters

$id

setGuestVariantDetails()

setGuestVariantDetails(  $id,   $qty) 

Guest type variants: Sets a guest type variant based on the id and quantity passed.

Parameters

$id
$qty

initGuestVariant()

initGuestVariant(  $id,   $qty) 

Guest type variants: Initialises a guest type variant based on the id and quantity passed.

Parameters

$id
$qty

checkGuestVariantIdAndQty()

checkGuestVariantIdAndQty(  $id,   $qty) 

Guest type variants: Checks a guest type variant Will fail if id is not set Will fail if the id doesn't tally with the ids for this property Will fail if the quantity is greater than the maximum quantity allowed for that variant.

Parameters

$id
$qty

makeCustomerTypes()

makeCustomerTypes(  $selectedProperty) 

Make the customer type dropdowns.

Parameters

$selectedProperty

initExtras()

initExtras() 

Initialises the Extras selected to empty.

getExtras()

getExtras() 

Returns the extras currently selected (string).

setExtras()

setExtras(  $extra) 

Receives an extra's uid and appends it to the existing selected extras list.

Parameters

$extra

removeExtra()

removeExtra(  $extra) 

Removes the selected extra from the list of currently selected extras.

Parameters

$extra

checkExtra()

checkExtra(  $extra) 

Check the id of the extra passed from the Ajax query Will fail if the extra id not set Will fail if the extra cannot be tallied with the property uid.

Parameters

$extra

extraAlreadySelected()

extraAlreadySelected(  $extra) 

Returns true if the extra has already been selected.

Parameters

$extra

modifyExtraQuantity()

modifyExtraQuantity(  $value,   $extraID) 

Receives an extra's uid and an integer and modifys the extra's quantity.

Parameters

$value
$extraID

add_third_party_extra()

add_third_party_extra(  $plugin,   $id,   $description = 'No description',   $total_value = 0.0,   $tax_code_id) 

Parameters

$plugin
$id
$description
$total_value
$tax_code_id

remove_third_party_extra()

remove_third_party_extra(  $plugin,   $id) 

Parameters

$plugin
$id

reset_choices_for_plugin()

reset_choices_for_plugin(  $plugin) 

Parameters

$plugin

add_additiional_line_item()

add_additiional_line_item(  $context = 'UNKNOWN',   $id,   $description = 'No description',   $total_value = 0.0,   $tax_code_id) 

Parameters

$context
$id
$description
$total_value
$tax_code_id

initArrivalDate()

initArrivalDate() 

Initialise the arrival date.

nextDatePropertyHasRoomFree()

nextDatePropertyHasRoomFree(  $arrivalDate) 

Find the next date that the property has a room available.

Parameters

$arrivalDate

checkArrivalDate()

checkArrivalDate(  $arrivalDate) 

Checks that the given date isn't earlier than today, or later than the latest possible date (according to limit advance bookings flag).

Parameters

$arrivalDate

setArrivalDate()

setArrivalDate(  $arrivalDate) 

Set the arrival date to YYYY/MM/DD.

Parameters

$arrivalDate

getArrivalDate()

getArrivalDate() 

Returns the current arrival date.

makeArrivalDateOutput()

makeArrivalDateOutput(  $arrivalDate) 

Makes the arrival date output. Depending on configuration options this can be either a javascript popup or a dropdown.

Parameters

$arrivalDate

fixedDaysArrivaldateDropdown()

fixedDaysArrivaldateDropdown(  $arrivalDate) 

Make the arrival date dropdown for properties that have a fixed arrival day (eg Saturday). Finds only those dates that match AND have a slot available after them.

Parameters

$arrivalDate

initDepartureDate()

initDepartureDate() 

Initialise the departure date, which can vary based on if configuration options define that there's a minimum number of days between the arrival date and the departure date.

setDepartureDate()

setDepartureDate(  $departureDate) 

Set the departure date.

Parameters

$departureDate

setDepartureDateToNextDay()

setDepartureDateToNextDay(  $arrivalDate) 

Sets the departure date to the day after the passed arrival date.

Parameters

$arrivalDate

checkDepartureDate()

checkDepartureDate(  $departureDate) 

Ensure that the departure date is not < tomorrows date, or less than arrival date.

Parameters

$departureDate

getFixedPeriodDepartureDate()

getFixedPeriodDepartureDate(  $departurePeriod) 

Gets a fix period's departure date. Passed the departure period, will return the appropriate date.

Parameters

$departurePeriod

getDepartureDate()

getDepartureDate() 

Return the departure date.

makeDepartureDateOutput()

makeDepartureDateOutput(  $departureDate) 

Make the departure date output This varies depending on configuration options, can be either a javascript calendar or dropdown.

Parameters

$departureDate

dateRangeIncludesWeekends()

dateRangeIncludesWeekends() 

Returns true if any of the dates between arrival and departure fall on a weekend day.

dateRangeIsAllWeekends()

dateRangeIsAllWeekends() 

Returns true all of the dates between arrival and departure fall on a weekend day.

getDayOfWeek()

getDayOfWeek(  $date) 

Return the day of the week for a given date. Expects a day in yyyy/mm/dd format.

Parameters

$date

setDateRangeString()

setDateRangeString() 

Construct a string of dates based on the arrival and departure date. Populates the dateRangeString with the result and returns it.

findDateRangeForDates()

findDateRangeForDates(  $d1,   $d2) 

Construct a string of dates based on the arrival and departure date. Populates the dateRangeString with the result and returns it.

Parameters

$d1
$d2

findDaysForDates()

findDaysForDates(  $d1,   $d2) 

Set the stay days, the number of days the booking covers, based on arrival date and departure date.

Parameters

$d1
$d2

getUnixArrivalDate()

getUnixArrivalDate() 

Returns the unix timestamp for the arrival date.

getUnixDepartureDate()

getUnixDepartureDate() 

Returns the unix timestamp for the departure date.

setStayDays()

setStayDays() 

Set the stay days, the number of days the booking covers, based on arrival date and departure date.

getStayDays()

getStayDays() 

Returns the number of days that the stay covers.

get_part_of_stay_period()

get_part_of_stay_period(  $staydays) 

Parameters

$staydays

get_rate_per_night_converted_to_output_period()

get_rate_per_night_converted_to_output_period(  $ratepernight) 

Parameters

$ratepernight

outputDate()

outputDate(  $thedate) 

Receives a date in yyyy/mm/dd format and reformats it according to configuration options requested output.

Parameters

$thedate

JSCalmakeInputDates()

JSCalmakeInputDates(  $inputDate) 

Converts a date passed to it to the required format which is then displayed as part of the javascript calendar input.

Parameters

$inputDate

JSCalConvertInputDates()

JSCalConvertInputDates(  $inputDate) 

Converts a date passed from the javascript calendar into the yyyy/mm/dd format that Jomres expects to deal with.

Parameters

$inputDate

calcPeriods()

calcPeriods(  $arrivalDate) 

Returns an array of fixed period dates from arrival date for the number of times fixedArrivalDatesRecurring configuration option is set.

Parameters

$arrivalDate

setGuest_existing_id()

setGuest_existing_id(  $value) 

An existing guest is a user who already exists on the system. This method sets it.

Parameters

$value

setGuest_firstname()

setGuest_firstname(  $value) 

Set the object's firstname variable.

Parameters

$value

setGuest_surname()

setGuest_surname(  $value) 

Set the object's surname variable.

Parameters

$value

setGuest_house()

setGuest_house(  $value) 

Set the object's house variable (typically house number).

Parameters

$value

setGuest_street()

setGuest_street(  $value) 

Set the object's street variable.

Parameters

$value

setGuest_town()

setGuest_town(  $value) 

Set the object's town variable.

Parameters

$value

setGuest_region()

setGuest_region(  $value) 

Set the object's region variable.

Parameters

$value

setGuest_postcode()

setGuest_postcode(  $value) 

Set the object's postcode variable.

Parameters

$value

setGuest_country()

setGuest_country(  $value) 

Set the object's country variable. If not set then the country is reset to the default country set in configuration options.

Parameters

$value

setGuest_tel_landline()

setGuest_tel_landline(  $value) 

Set the object's landline variable.

Parameters

$value

setGuest_tel_mobile()

setGuest_tel_mobile(  $value) 

Set the object's mobile variable.

Parameters

$value

setGuest_email()

setGuest_email(  $value) 

Set the object's email variable.

Parameters

$value

setGuest_discount()

setGuest_discount(  $value) 

Set the object's discount variable.

Parameters

$value

checkEmail()

checkEmail(  $value) 

A simple email structure check.

Parameters

$value

getExistingCustomerData()

getExistingCustomerData(  $id) 

Passed an existing guest's uid.

If the booker is known to be a manager then the object's guest details are retrieved from the guest's table and stored temporarily in the tmpguest by the store method. Will populate the object's guest data and return and array of same data.

Parameters

$id

resetExistingCustomer()

resetExistingCustomer() 

Clear the guests data to empty values. Triggered by the guest dropdown being reset to empty.

makeRequiredIcons()

makeRequiredIcons() 

Fill the variables of the Required fields.

initGuestDetails()

initGuestDetails(  $bkg,   $guest_deets) 

Initialise the guests details. If the user is a registered user any existing data will be found for them and the appropriate fields prefilled.

This function sets the booking object's details.

Parameters

$bkg
$guest_deets

makeGuestData()

makeGuestData() 

Make the Guest, put them into an array for patTemplate and return the array.

AJgetGuestDropdown()

AJgetGuestDropdown() 

Makes the guest dropdown that managers/receptions see so that they can autmatically fill the booking form with the guest's details.

bookingCountriesDropdown()

bookingCountriesDropdown(  $selectedCountry) 

Makes the countries dropdown.

Parameters

$selectedCountry

updateSelectedRoom()

updateSelectedRoom(  $roomAndTariff) 

Updates the selected room with the room^tariff string If room^tariff are already in the requestedRoom array then it will be removed otherwise it is added.

Parameters

$roomAndTariff

updateRoomAllocation()

updateRoomAllocation(  $add_allocation = true,   $rm_id,   $num_of_guests) 

Parameters

$add_allocation
$rm_id
$num_of_guests

checkAllGuestsAllocatedToRooms()

checkAllGuestsAllocatedToRooms() 

checkExistingRoomsTariffsForRoomsTariffsWhereMinRoomSettingIsNoLongerMet()

checkExistingRoomsTariffsForRoomsTariffsWhereMinRoomSettingIsNoLongerMet(  $roomAndTariff) 

Now we need to check and see if there are any mini-max room/tariff combinations selected. If there are and the current number of rooms selected < min or max, then we need to remove those particular rooms new for v4.4.1.

Parameters

$roomAndTariff

removeFromSelectedRooms()

removeFromSelectedRooms(  $roomAndTariff) 

Rebuild the requestedRoom array excluding the one we don't want.

Parameters

$roomAndTariff

addToSelectedRooms()

addToSelectedRooms(  $roomAndTariff) 

Add room^tariff to requestedRoom.

Parameters

$roomAndTariff

numberOfCurrentlySelectedRooms()

numberOfCurrentlySelectedRooms() 

Returns the number of currently selected rooms.

checkRoomNotAlreadySelected()

checkRoomNotAlreadySelected(  $rtArray) 

Checks that a room^tariff hasn't already been selected.

Parameters

$rtArray

checkTariffTalliesWithRoom()

checkTariffTalliesWithRoom(  $rtArray) 

Checks that it is logical to select a room with a given tariff. Finds the room type then checks that the tariff has the same room type.

Parameters

$rtArray

listCurrentlySelectedRooms()

listCurrentlySelectedRooms() 

String output of the currently selected rooms. Returns overlib'd output as a string.

getAllRoomUidsForProperty()

getAllRoomUidsForProperty() 

Get all of the rooms for this property.

removeRoomuidsAlreadyInThisBooking()

removeRoomuidsAlreadyInThisBooking(  $freeRoomsArray) 

From the free rooms array, strips out any rooms that have already been selected.

Parameters

$freeRoomsArray

findFreeRoomsInDateRange()

findFreeRoomsInDateRange(  $freeRoomsArray) 

Find rooms that are free within the arrival and departure dates.

Parameters

$freeRoomsArray

extractLockedRooms()

extractLockedRooms(  $freeRoomsArray) 

Filters rooms out that have been locked.

Parameters

$freeRoomsArray

checkPeopleNumbers()

checkPeopleNumbers(  $freeRoomsArray) 

Finds the total number of beds that are unbooked in this property at this time.

Parameters

$freeRoomsArray

getTotalInParty()

getTotalInParty() 

Adds the total selected guesttypes to find the total in the party. Returns the integer.

convertArrayToObject()

convertArrayToObject(  $tmpArray) 

Passed an array, it'll create an object and pass it back. v2.6.0.3 dobooking_functions was changed to reduce the number of queries by collecting much of the required data in a few quick queries when the booking object is created. This information is then stored in memory as an array because it's easy to access directly, however some of the code in dobooking_functions expects to be passed the array(obj) that was pulled from db queries so instead of rewriting bunches of code so that they now see basic arrays, we'll reconvert (in memory) the array found to an an object. The method calling this method will actually create the array(obj) to be passed back to it's parent method.

Parameters

$tmpArray

getTariffsForRoomUidByClass()

getTariffsForRoomUidByClass(  $room_uid) 

Pass a room uid, this method will return all tariffs for that room uid's class.

Parameters

$room_uid

getTariffsForRoomClass()

getTariffsForRoomClass(  $roomClass) 

Pass a roomClass uid, this method will return all tariffs for that class.

Parameters

$roomClass

getTariffsForRoomUids()

getTariffsForRoomUids(  $freeRoomsArray) 

Find any tariffs that are valid for the available rooms Finds all tariffs for a given room type Checks that arrival and departure dates fall between the valid from -> to dates Checks that min & max days of the booking (stayDays) are applicable Checks that the min & max people in the party do are applicable to the tariff Checks to see if the tariff allows bookings that include weekends if the date range includes a weekend day Returns an array $roomAndTariffArray which is a multi-dimensional array of rooms and tariffs that can be applied to the room.

Parameters

$freeRoomsArray

filter_tariffs_staydays()

filter_tariffs_staydays(  $tariff) 

Parameters

$tariff

filter_tariffs_on_dates()

filter_tariffs_on_dates(  $tariff,   $unixArrivalDate,   $unixDepartureDate) 

Parameters

$tariff
$unixArrivalDate
$unixDepartureDate

filter_tariffs_alreadyselectedcheck()

filter_tariffs_alreadyselectedcheck(  $tariff) 

Parameters

$tariff

filter_tariffs_peoplenumbercheck()

filter_tariffs_peoplenumbercheck(  $tariff) 

Parameters

$tariff

filter_tariffs_dowcheck()

filter_tariffs_dowcheck(  $tariff) 

Parameters

$tariff

build_tariff_to_date_map()

build_tariff_to_date_map() 

get_periods()

get_periods(  $start,   $end,   $interval = null) 

Parameters

$start
$end
$interval

limitRoomsList()

limitRoomsList(  $roomAndTariffArray) 

Limits the number of rooms that can be displayed if the config option returnRoomsLimit is set to greater than 0.

Parameters

$roomAndTariffArray

generateRoomsList()

generateRoomsList(  $roomAndTariffArray) 

Generates the overlib rooms list and returns a string for display in the booking form.

Parameters

$roomAndTariffArray

generate_room_type_dropdowns()

generate_room_type_dropdowns() 

isAlreadyASelectedOption()

isAlreadyASelectedOption(  $roomTariffOutputId) 

Find out if this tariff has already been selected.

Parameters

$roomTariffOutputId

makeRoomTariffDetails()

makeRoomTariffDetails(  $roomuid,   $tariffuid) 

Receives the room and tariff uid. Constructs the room and tariff output depending on configuration settings.

Parameters

$roomuid
$tariffuid

makeRoomOverlibdata()

makeRoomOverlibdata(  $roomUid,   $tariffUid,   $roomTariffOutputId,   $roomTariffOutputText,   $removing = false) 

Make the overlib data for the room & tariff. Returns a string.

Parameters

$roomUid
$tariffUid
$roomTariffOutputId
$roomTariffOutputText
$removing

calculateRoomPriceIncVat()

calculateRoomPriceIncVat(  $price) 

Parameters

$price

GetRoomDetails()

GetRoomDetails(  $roomUid) 

Returns details of a given room according to the passed room id.

Parameters

$roomUid

GetTariffDetails()

GetTariffDetails(  $tariffUid) 

Returns details of a given tariff according to the passed tariff id.

Parameters

$tariffUid

estimate_AverageRate()

estimate_AverageRate(  $roomUid,   $tariffUid) 

We will estimate the averate rate over the booking period using this modified and cut down version of the average calculation function.

Parameters

$roomUid
$tariffUid

makeTariffHeaders()

makeTariffHeaders() 

monitorBookingStatus()

monitorBookingStatus() 

Called in phase 3 of the ajax queries.

Checks the state of the booking. If any of the checks fail the method setMonitoring is passed a message. If, at the end, the monitoringMessages array is empty then we know that it has passed all the tests and the booking is ready for confirmation. At that stage the ok_to_book flag is set to true.

outputZeroPrices()

outputZeroPrices() 

setOkToBook()

setOkToBook(  $val = false) 

Sets the ok_to_book flag. Default is false.

Parameters

$val

getOkToBook()

getOkToBook() 

Returns the value of the ok_to_book flag. Used by the handlereq script.

setMonitoring()

setMonitoring(  $message) 

Inserts the message into the monitoringMessages array.

Parameters

$message

getMonitoringNumberOfMessages()

getMonitoringNumberOfMessages() 

Returns the number of messages in the monitoringMessages array.

monitorGetFirstMessage()

monitorGetFirstMessage() 

Get the first message in the monitoringMessages array. This is the first test that the monitoring method failed the booking on.

monitorGetAllMessages()

monitorGetAllMessages() 

Return all the messages as a string.

selectedRoomsCanHostTotalInParty()

selectedRoomsCanHostTotalInParty() 

Check that the selected rooms can accomodate the total in the party.

tariffsCanHostTotalInParty()

tariffsCanHostTotalInParty() 

Check that the selected tariff can accomodate the total in the party.

setVariantValues()

setVariantValues() 

Set the variant values, Returns true or false.

setGuestTypeVariantValues()

setGuestTypeVariantValues() 

Calculate how much to charge per person Find the value of the selected guest types, as a variation of the basic room per night of all the selected rooms Eg. you have two rooms, one and $20 and one at $40, the basic value of the rooms is $30 per night.

The guest values are calculated as a 'variation' from the basic room value. Whilst this calculation is done every time, the decision as to whether or not to apply this variation is made elsewhere.

makeNightlyRoomCharges()

makeNightlyRoomCharges() 

Calculates the value of the room charges per night If property is NOT set to charge Per Person Per Night then variances calculated in setGuestTypeVariantValues are ignored If property is set to charge Per Person Per Night and all tariffs in selection are set to Ignore PPPN then PPPN is ignored If property is set to charge Per Person Per Night and some tariffs in selection are set to Ignore PPPN then PPPN is calculated across the board because it's not possible to figure out how many people are in each room Sets $this->room_total to the total value of the rooms per night.

coupon_booking_date_ranges()

coupon_booking_date_ranges(  $first,   $last,   $step = '+1 day',   $format = 'Y-m-d') 

Parameters

$first
$last
$step
$format

calcTotals()

calcTotals() 

calcExtras()

calcExtras() 

calcTax()

calcTax() 

Calculates room &/or VAT.

calcSinglePersonSuppliment()

calcSinglePersonSuppliment() 

Discerns if single person suppliement applies, and if it does, how much should be charged.

calcDeposit()

calcDeposit() 

Calculates how much deposit should be charged.

getDeposit()

getDeposit() 

Returns the value of the deposit required to make the booking.

getExtrasTotal()

getExtrasTotal() 

Returns the total value of the extras selected.

getTax()

getTax() 

Returns the total value of the Tax calculated.

getSinglePersonSuppliment()

getSinglePersonSuppliment() 

Returns the total value of the single person suppliment caluclated.

getRoomAllocationOutput()

getRoomAllocationOutput() 

Outputs the results of the automatic room allocations.

getGrandTotal()

getGrandTotal() 

Returns the grand total calculated.

getRoompernight()

getRoompernight() 

Returns the room per night calculated.

getRoomtotal()

getRoomtotal() 

Returns the room total for the booking.

resetTotals()

resetTotals() 

Resets all totals to 0.00.

makeRatePerNight()

makeRatePerNight() 

setFlatRate()

setFlatRate() 

The default method of handling price calculations. When a booking is made the price for the entire period reflects the price of the booking.

outputDiscounts()

outputDiscounts() 

getPercentageOfRoomsBookedForRoomtype()

getPercentageOfRoomsBookedForRoomtype(  $roomtypeid) 

Parameters

$roomtypeid

getDiscountedRoomrate()

getDiscountedRoomrate(  $roomrate,   $percentagebooked) 

Parameters

$roomrate
$percentagebooked

setAverageRate()

setAverageRate() 

The alterntive method of handling price calculations. When a booking is made the price for rooms is calculated as the sum of the value of the rooms for each night/number of rooms.

te_setAverageRate()

te_setAverageRate() 

The alterntive method of handling price calculations. When a booking is made the price for rooms is calculated as the sum of the value of the rooms for each night/number of rooms.

get_nett_price()

get_nett_price(  $price,   $tax_rate) 

Parameters

$price
$tax_rate

get_gross_price()

get_gross_price(  $price,   $tax_rate) 

Parameters

$price
$tax_rate

calcLastMinuteDiscount()

calcLastMinuteDiscount() 

generateBilling()

generateBilling() 

addBookingNote()

addBookingNote(  $context,   $note) 

Parameters

$context
$note

getMkTime()

getMkTime(  $date) 

Parameters

$date

email_usage_check()

email_usage_check(  $email) 

Parameters

$email

generateDateInput()

generateDateInput(  $fieldName,   $dateValue,   $myID = false) 

Creates the javascript date input and returns it as a value.

Parameters

$fieldName
$dateValue
$myID

sort_alphabetic()

sort_alphabetic(  $a,   $b) 

Parameters

$a
$b