/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to trunk/Code Viewer Alt/AJAX/AjaxDemoApp4_getBookingsForDate.htm

  • Committer: Henrik G.
  • Date: 2013-03-26 23:22:55 UTC
  • Revision ID: henrik.gustavsson@his.se-20130326232255-ik6snyatlbkf3zs1
First seed of Lenasys ... Needs to be Organized Further

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<span class="description">
 
2
<br>
 
3
<div class="descriptionheading">Overview</div>
 
4
 
 
5
The bookings list is a typical function in booking systems that shows the number of bookings of a resource a certain date. 
 
6
This can for example be a list of rooms in a hotel that have been booked on a date.
 
7
 
 
8
<br><br>
 
9
 
 
10
<div class="descriptionheading">processinputbox</div>
 
11
The function called <span class="interestingdescription">processinputbox</span> is executed by the keyup and onchange events for the text boxes in the form. 
 
12
Events connected to text boxes are suitable for this type of application since attaching code to those events allows the capture of text written 
 
13
into a dialog box while the user keeps typing.<br>
 
14
The date and the resource ID are passed directly to the api together with the name of the application (as resource type).
 
15
 
 
16
<br><br>
 
17
 
 
18
<div class="descriptionheading">resultBooking</div>
 
19
 
 
20
The other function <span class="interestingdescription">showResources</span> is nearly identical to the result function of the previous example <a href='AjaxDemoApp2_getCustomerBookings.php'>getCustomerBookings</a>. 
 
21
The main difference is that only columns are added and that the whole result is one single row. 
 
22
 
 
23
<br><br><div class="descriptionheading">booking/getbookings_XML.php</div>
 
24
 
 
25
The <span class="interestingdescription">booking/getbookings_XML.php</span> 
 
26
can retrive all bookings of a <span class="interestingdescription">resourceID</span> for a certain <span class="interestingdescription">date</span>. All bookings for that resource for that date are given.
 
27
If the resource ID or the date is not specified all bookings (either all bookings for resource or all bookings for that date) are given.
 
28
<br><br>
 
29
All data is given as stored in the database, the result of this function does not compute any data such as current adjusted price it just collects all bookings.
 
30
<br><br>
 
31
The status is important as it tells us whether the booking is a firm booking or only a "temporary" booking.
 
32
 
 
33
<br><br><div class='exampleheading'>Function Call Example:<br><br>
 
34
<pre><span class="codeexample">$.ajax({
 
35
        type: 'POST',
 
36
        url: 'booking/getbookings_XML.php',
 
37
        data: { type: "Hotell_Demo",
 
38
                resourceID: escape(document.getElementById("resourceID").value),
 
39
                date:  escape(document.getElementById("date").value)},
 
40
        success:  ResultBooking
 
41
});                                                                                                     
 
42
</span></pre>
 
43
</div>
 
44
 
 
45
<br>
 
46
 
 
47
<br><div class='exampleheading'>Returned Data Example:<br>
 
48
<pre><span class="codeexample">
 
49
&lt;bookings&gt;
 
50
 
 
51
&lt;booking 
 
52
    application='Hotell_Demo'
 
53
    customerID='Leiflert'
 
54
    resourceID='1008'
 
55
    name='Karl Hotel and Resort'
 
56
    company='Karls'
 
57
    location='Exmouth'
 
58
    date='2001-07-20 00:00:00'
 
59
    position='26'
 
60
    status='2'
 
61
    cost='40'
 
62
    size='24'
 
63
 /&gt;
 
64
 
 
65
&lt;/bookings&gt;
 
66
</span>
 
67
</div>
 
68
                                                                                                                                        
 
69
</span></pre>
 
70