/Users/johnr/Desktop/IA pdf Downloads/_New Projects Downloads May 7th/CS_IA_Mattew/submitpage.html |
1 <?php
2 spl_autoload_register(function ($class_name) { // https://www.php.net/manual/en/language.oop5.autoload.php
3 include $class_name . '.class.php';
4 });
5 $destination = apcu_fetch('destination');
6 $inquiry = apcu_fetch('inquiry');
7 $customer = apcu_fetch('customer');
8 $dayPlans = apcu_fetch('dayplans');
9
10 ?>
11 <!DOCTYPE html>
12 <head>
13 <link href="style.css" rel="stylesheet">
14 </head>
15 https://www.the-art-of-web.com/javascript/doublesubmit/
16 <script type="text/javascript">
17 function checkForm(form) // Submit button clicked, text will change to please wait and button can no longer be pressed. Ensuring multiple submits do not occur with the same user.
18 {
19 // check form input values
20 form.myButton.disabled = true;
21 form.myButton.value = "Please wait...";
22 return true;
23 }
24
25 </script>
26 <h1>Golfasian Inquiry Form</h1>
27
28 <body>
29
30 <form action="thankyou.html" method="POST" onsubmit="checkForm(this);">
31 <div class="container">
32 <p>
33 <h4>Customer and Contact Information:</h4>
34 <hr>
35
36 <table>
37 <tr>
38 <th>Name</th>
39 <th>Email</th>
40 <th>Phone Number</th>
41 <th>Nationality</th>
42 </tr>
43 <tr>
44 <td> <?php echo $customer->getFullName(); ?> </td>
45 <td> <?php echo $customer->getEmail(); ?> </td>
46 <td> <?php echo $customer->getPhoneNumber(); ?> </td>
47 <td> <?php echo $customer->getNationality(); ?> </td>
48 </tr>
49 </table>
50 <hr>
51 </p><p>
52 <h4>Trip Details:</h4>
53 <hr>
54 <table>
55 <tr>
56 <th>Destination(s)</th>
57 <th>Arrival</th>
58 <th>Departure</th>
59 <th>Period</th>
60 <th>Hotel Standard</th>
61 </tr>
62 <tr>
63 <td> <?php echo $destination->getChosenDestination(); ?> </td>
64 <td> <?php echo $inquiry->getArrivalDate(); ?> </td>
65 <td> <?php echo $inquiry->getDepartureDate(); ?> </td>
66 <td> <?php echo $inquiry->getNumberOfDays(); ?> days, <?php echo $inquiry->getNumberOfNights() ?> nights</td>
67 <td> <?php echo $inquiry->getHotelRating(); ?> </td>
68 </tr>
69 </table>
70 <hr>
71 </p><p>
72 <h4>Day by Day Details:</h4>
73 <table class="spacing">
74 <hr>
75 <tr>
76 <th>Day Number</th>
77 <th>Hotel</th>
78 <th>Hotel Breakfast</th>
79 <th>Golf</th>
80 <th>Requested Tee Time</th>
81 <th>Cart</th>
82 <th>Caddie</th>
83 <th>Transportation Required</th>
84 </tr>
85 <?php for($i = 0; $i < $inquiry->getNumberOfDays(); $i++){
86 if($dayPlans[$i]->getHotelBreakfast()){
87 $hotelBreakfast = "Yes";
88 }else{
89 $hotelBreakfast = "None";
90 }
91 if($dayPlans[$i]->getGolfCourse() != "No golf day"){
92 if($dayPlans[$i]->getCart()){
93 $cart = "Yes";
94 }else{
95 $cart = "None";
96 }
97 if($dayPlans[$i]->getCaddie()){
98 $caddie = "Yes";
99 }else{
100 $caddie = "None";
101 }
102 }else{
103 $cart = "";
104 $caddie = NULL;
105 }
106 if($dayPlans[$i]->getTransportation()){
107 $transportation = "Yes";
108 }else{
109 $transportation = "No";
110 }
111
112 ?>
113 <tr>
114 <td> <?php echo $i+1; ?> </td>
115 <td> <?php echo $dayPlans[$i]->getHotel(); ?> </td>
116 <td> <?php echo $hotelBreakfast; ?> </td>
117 <td> <?php echo $dayPlans[$i]->getGolfCourse(); ?> </td>
118 <td> <?php echo $dayPlans[$i]->getTeeTime(); ?> </td>
119 <td> <?php echo $cart; ?> </td>
120 <td> <?php echo $caddie; ?> </td>
121 <td> <?php echo $transportation; ?> </td>
122 </tr>
123 <?php } ?>
124
125 </table>
126 </p>
127 <hr>
128 <input type="submit" name="myButton" value="Submit Inquiry">
129 <input type="button" value="Back" onclick="history.back()">
130 </div>
131
132 </form>
133 </body>
134 </html>