bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/0.1
1
by Henrik G.
First seed of Lenasys ... Needs to be Organized Further |
1 |
<html> |
2 |
<head> |
|
3 |
<style> |
|
4 |
table {border: 1px dotted gray; padding: 1em;} |
|
5 |
</style> |
|
6 |
||
7 |
<script language="javascript" src="../jquery/jquery-1.8.2.min.js"></script> |
|
8 |
||
9 |
<script language="javascript"> |
|
10 |
||
11 |
// The API is passed a resource ID and a booking date |
|
12 |
function ResultBooking(returnedData) |
|
13 |
{ |
|
14 |
// An XML DOM document is returned from AJAX |
|
15 |
var resultset=returnedData.childNodes[0]; |
|
16 |
||
17 |
var output="<table>"; |
|
18 |
output+="<tr>"; |
|
19 |
||
20 |
// Iterate over all nodes in root node (i.e. customers) |
|
21 |
for (i = 0; i < resultset.childNodes.length; i++) { |
|
22 |
if(resultset.childNodes.item(i).nodeName=="booking"){ |
|
23 |
// Retrieve position from the returned booking |
|
24 |
var booking=resultset.childNodes.item(i); |
|
25 |
output+="<td>"+booking.attributes['position'].nodeValue+"</td>"; |
|
26 |
} |
|
27 |
} |
|
28 |
|
|
29 |
output+="</tr>"; |
|
30 |
output+="</table>" |
|
31 |
var div=document.getElementById('OutputDiv'); |
|
32 |
div.innerHTML=output; |
|
33 |
} |
|
34 |
|
|
35 |
function processinputbox() |
|
36 |
{ |
|
37 |
resource=document.getElementById("resourceID").value; |
|
38 |
bookingdate=document.getElementById("date").value; |
|
39 |
$.ajax({ |
|
40 |
type: 'POST', |
|
41 |
url: '../booking/getbookings_XML.php', |
|
42 |
data: { type: "Hotell_Demo", |
|
43 |
resourceID: escape(document.getElementById("resourceID").value), |
|
44 |
date: escape(document.getElementById("date").value)}, |
|
45 |
success: ResultBooking |
|
46 |
}); |
|
47 |
|
|
48 |
} |
|
49 |
|
|
50 |
</script> |
|
51 |
</head> |
|
52 |
<body> |
|
53 |
||
54 |
<form name='searchbookings'> |
|
55 |
resourceID:<br><input type='text' name='resourceID' id='resourceID' onchange="processinputbox()" onkeyup="processinputbox()"><br> |
|
56 |
date:<br><input type='text' name='date' id='date' onchange="processinputbox()" onkeyup="processinputbox()"><br> |
|
57 |
</form> |
|
58 |
Result<br> |
|
59 |
<div id="OutputDiv"> |
|
60 |
<br> |
|
61 |
||
62 |
</body> |
|
63 |
</html> |