Overview
The bookings list is a typical function in booking systems that shows the number of bookings of a resource a certain date. This can for example be a list of rooms in a hotel that have been booked on a date.

processinputbox
The function called processinputbox is executed by the keyup and onchange events for the text boxes in the form. Events connected to text boxes are suitable for this type of application since attaching code to those events allows the capture of text written into a dialog box while the user keeps typing.
The date and the resource ID are passed directly to the api together with the name of the application (as resource type).

resultBooking
The other function showResources is nearly identical to the result function of the previous example getCustomerBookings. The main difference is that only columns are added and that the whole result is one single row.

booking/getbookings_XML.php
The booking/getbookings_XML.php can retrive all bookings of a resourceID for a certain date. All bookings for that resource for that date are given. If the resource ID or the date is not specified all bookings (either all bookings for resource or all bookings for that date) are given.

All data is given as stored in the database, the result of this function does not compute any data such as current adjusted price it just collects all bookings.

The status is important as it tells us whether the booking is a firm booking or only a "temporary" booking.

Function Call Example:

$.ajax({
	type: 'POST',
	url: 'booking/getbookings_XML.php',
	data: { type: "Hotell_Demo",
		resourceID: escape(document.getElementById("resourceID").value),
		date:  escape(document.getElementById("date").value)},
	success:  ResultBooking
});													


Returned Data Example:

<bookings>

<booking 
    application='Hotell_Demo'
    customerID='Leiflert'
    resourceID='1008'
    name='Karl Hotel and Resort'
    company='Karls'
    location='Exmouth'
    date='2001-07-20 00:00:00'
    position='26'
    status='2'
    cost='40'
    size='24'
 />

</bookings>