-
Notifications
You must be signed in to change notification settings - Fork 0
/
book.html
196 lines (136 loc) · 5.76 KB
/
book.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!-- Booking form page with fields to enter details of customized packages -->
<!-- This form calls book_form.php on successful submission -->
<!-- Connect to database via php and display drop down list of packages -->
<?php
$connection = mysqli_connect('localhost','root','','packages_db');
if(!$connection){
die("Connection failed: ".mysqli_connect_error());
}
$query = "SELECT name FROM `packages`";
$result = mysqli_query($connection,$query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>book</title>
<!-- swiper css link -->
<link rel="stylesheet" href="https://unpkg.com/swiper@7/swiper-bundle.min.css" />
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- header section starts -->
<section class="header">
<a href="home.php" class="logo">tour.</a>
<nav class="navbar">
<a href="index.html">home</a>
<a href="about.html">about</a>
<a href="package.html">package</a>
<a href="book.html">book</a>
</nav>
<div id="menu-btn" class="fas fa-bars"></div>
</section>
<!-- header section ends -->
<div class="heading" style="background:url(images/temple1-book.jpg) no-repeat">
<h1>book now</h1>
</div>
<!-- booking section starts -->
<section class="booking">
<h1 class="heading-title">book your trip!</h1>
<form action="book_form.php" method="post" class="book-form" onsubmit="return myFunction();">
<!-- Store details in database and display confirmation window on successful booking -->
<!-- All fields are required. Also shows customized error message when phone number length is not 10 digits -->
<div class="flex">
<div class="inputBox">
<span>name :</span>
<input type="text" placeholder="enter your name" name="name" required="required">
</div>
<div class="inputBox">
<span>email :</span>
<input type="email" placeholder="enter your email" name="email" required="required">
</div>
<div class="inputBox">
<span>phone :</span>
<input type="tel" placeholder="enter your number" name="phone" pattern="[1-9][0-9]{9}" required oninvalid="this.setCustomValidity('Length of phone number must be 10 digits')" oninput="this.setCustomValidity('')"/>
</div>
<div class="inputBox">
<span>address :</span>
<input type="text" placeholder="enter your address" name="address" required="required" >
</div>
<div class="dropdown">
<label for="package">Choose a package:</label>
<select id="package" name="location" required="required">
<!-- Display drop down menu by reading names of all packages available in database -->
<?php
while($row = mysqli_fetch_row($result)){
echo "<option value='{$row[0]}'>{$row[0]}</option>";
}
?>
</select>
</div>
<div class="inputBox">
<span>how many :</span>
<input type="number" placeholder="number of tourists" name="guests" required="required">
</div>
<div class="inputBox">
<span>arrivals :</span>
<input type="date" name="arrivals" required="required">
</div>
<div class="inputBox">
<span>leaving :</span>
<input type="date" name="leaving" required="required"">
</div>
<!-- Disables all dates shown in calendar which are prior to today's date -->
<script>
window.onload=function(){//from ww w . j a va2s. c o m
var today = new Date().toISOString().split('T')[0];
document.getElementsByName("leaving")[0].setAttribute('min', today);
document.getElementsByName("arrivals")[0].setAttribute('min', today);
}
</script>
</div>
<input type="submit" value="submit" class="btn" name="send">
</form>
<script>
function myFunction(){
confirm("Booking successful!");
}
</script>
</section>
<!-- booking section ends -->
<!-- footer section starts -->
<section class="footer">
<div class="box-container">
<div class="box">
<h3>quick links</h3>
<a href="index.html"> <i class="fas fa-angle-right"></i> home</a>
<a href="about.html"> <i class="fas fa-angle-right"></i> about</a>
<a href="package.html"> <i class="fas fa-angle-right"></i> package</a>
<a href="book.html"> <i class="fas fa-angle-right"></i> book</a>
</div>
<div class="box">
<h3>contact info</h3>
<a href="#"> <i class="fas fa-phone"></i> +91 70926 ##### </a>
<a href="#"> <i class="fas fa-envelope"></i> [email protected] </a>
<a href="#"> <i class="fas fa-map"></i> chennai, india - 600075 </a>
</div>
<div class="box">
<h3>follow on</h3>
<a href="https://instagram.com/catladyvaish/"> <i class="fab fa-instagram"></i> instagram </a>
<a href="https://www.linkedin.com/in/vaishnavi-anand502/"> <i class="fab fa-linkedin"></i> linkedin </a>
</div>
</div>
<div class="credit"> created by <span>Vaishnavi Anand</span></div>
</section>
<!-- footer section ends -->
<!-- swiper js link -->
<script src="https://unpkg.com/swiper@7/swiper-bundle.min.js"></script>
<!-- custom js file link -->
<script src="js/script.js"></script>
</body>
</html>