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 |
<script language="javascript" src="../jquery/jquery-1.8.2.min.js"></script> |
|
4 |
||
5 |
<script language="javascript"> |
|
6 |
// The API is passed the customer data and the name of the return function |
|
7 |
function storeCustomer() |
|
8 |
{ |
|
9 |
var customerID=document.getElementById("customerID").value; |
|
10 |
var firstname=document.getElementById("firstname").value; |
|
11 |
var lastname=document.getElementById("lastname").value; |
|
12 |
var email=document.getElementById("email").value; |
|
13 |
var address=document.getElementById("address").value; |
|
14 |
||
15 |
$.ajax({ |
|
16 |
type: 'POST', |
|
17 |
url: '../booking/makecustomer_XML.php', |
|
18 |
data: { ID: escape(customerID), |
|
19 |
firstname: escape(firstname), |
|
20 |
lastname: escape(lastname), |
|
21 |
email: escape(email), |
|
22 |
address: escape(address), |
|
23 |
}, |
|
24 |
success: ResultCustomer |
|
25 |
}); |
|
26 |
} |
|
27 |
|
|
28 |
function ResultCustomer(returnedData) |
|
29 |
{ |
|
30 |
// Iterate over all nodes in root node (i.e. the 'created' element in root which has an attribute called status) |
|
31 |
for (i = 0; i < returnedData.childNodes.length; i++) { |
|
32 |
if(returnedData.childNodes.item(i).nodeName=="created"){ |
|
33 |
alert(returnedData.childNodes.item(i).attributes['status'].nodeValue); |
|
34 |
} |
|
35 |
} |
|
36 |
} |
|
37 |
||
38 |
</script> |
|
39 |
</head> |
|
40 |
<body> |
|
41 |
<form> |
|
42 |
ID: (is used to identify the user)<br><input type="text" id="customerID"> <br> |
|
43 |
firstname:<br><input type="text" id="firstname"><br> |
|
44 |
lastname:<br><input type="text" id="lastname"><br> |
|
45 |
address:<br><input type="text" id="address"><br> |
|
46 |
email:<br><input type="text" id="email"><br> |
|
47 |
<input type="button" value="Store Customer" onclick="storeCustomer();"> |
|
48 |
</form> |
|
49 |
</body> |
|
50 |
</html> |