This file is the main code block that manages the booking engine.
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.
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.
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.
Passed an array, it'll create an object and pass it back. v18.104.22.168 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.
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.
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.
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.
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.