Overview
The resource search is a variation on a classical search form. A number of optional search terms are entered and a result is retrieved based on those parameters.
searchResources
The function called searchResources 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 search terms are collected from the form and passed directly to the api. The

showResources
The other function showResources is nearly identical to the result function of the previous example getCustomerBookings.

getResources
The booking/getresources_XML.php performs a search using a set of search terms. "None" is given, that search term is ignored.
The three first terms i.e. name, location and company use a logical or if more than one term is given. The full text search works in isolation from the other terms.

Call Example:

$.ajax({
	type: 'POST',
	url: 'booking/getresources_XML.php',
	data: { name: escape(document.getElementById("resName").value),
		location:  escape(document.getElementById("resLocation").value),
		company: escape(document.getElementById("resCompany").value),
		fulltext: escape(document.getElementById("resFulltext").value) },
	success:  showResources
});


Returned Data Example:

<resources>
<resource 
    id='1001'
    name='Pilkington Inn'
    company='Sunside Hotels'
    location='Manchester'
    size='15'
    cost='350'
 />
</resource>