Overview
The bookings list is a variation on the traditional shopping cart model that lists all bookings made by a certain user. A form contains a field for writing the customer ID, and a list of bookings made by the customer with that ID is retrieved.
processinputbox
The function called processinputbox is executed by the keyup and onchange events for the text box in the form. Events connected to a specific dialog component 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.
ResultCustomer
The other function ResultCustomer is called automatically by jQuery when the data has been returned.
The function it iterates over the Booking elements that have been returned and adds an on-screen table row (composed of the attributes of the booking) for each of the bookings.
The result is placed in a div with the ID OutputDiv

booking/getcustomerbookings_XML.php
The getCustomerBookings function collects all bookings made by a certain customer. No error handling is performed at all. If the ResourceType (i.e. application name) "None" is given, all bookings for the customer is returned including bookings made in other applications.

Call Example:

$.ajax({
	type: 'POST',
	url: 'booking/getcustomerbookings_XML.php',
	data: {
		customerID: escape(customer)
	},
	success:  ResultBookingCustomer,
});


Returned Data Example:

<bookings>
<booking 
    application='Hotell_Demo'
    customerID='Haakon'
    resourceID='1008'
    name='Karl Hotel and Resort'
    company='Karls'
    location='Exmouth'
    date='2001-07-20 00:00:00'
    position='13'
    cost='280'
 />
</bookings>