/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<html>
<head>
				<style>
					table {border: 1px dotted gray; padding: 1em;}
				</style>

				<script language="javascript" src="../jquery/jquery-1.8.2.min.js"></script>

				<script language="javascript">

							// The API is passed a resource ID and a booking date
							function ResultBooking(returnedData)
							{
									// An XML DOM document is returned from AJAX
									var resultset=returnedData.childNodes[0];

									var output="<table>";
									output+="<tr>";

									// Iterate over all nodes in root node (i.e. customers)
									for (i = 0; i < resultset.childNodes.length; i++) {
											if(resultset.childNodes.item(i).nodeName=="booking"){
													// Retrieve position from the returned booking
													var booking=resultset.childNodes.item(i);
													output+="<td>"+booking.attributes['position'].nodeValue+"</td>";
											}
									}
										
									output+="</tr>";
									output+="</table>"
									var div=document.getElementById('OutputDiv');
									div.innerHTML=output;
							}				
							
							function processinputbox()
							{
									resource=document.getElementById("resourceID").value;
									bookingdate=document.getElementById("date").value;
					    $.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
									   });
							
						}
							
				</script>
</head>
<body>
	
	<form name='searchbookings'>
				resourceID:<br><input type='text' name='resourceID' id='resourceID' onchange="processinputbox()" onkeyup="processinputbox()"><br>
				date:<br><input type='text' name='date' id='date' onchange="processinputbox()" onkeyup="processinputbox()"><br>
	</form>
	Result<br>
	<div id="OutputDiv">
		<br>
	
</body>
</html>