-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
307 lines (282 loc) · 14.4 KB
/
home.php
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<?php
include 'config.php';
session_start();
// page redirect
$usermail="";
$usermail=$_SESSION['usermail'];
if($usermail == true){
}else{
header("location: index.php");
}
?>
<!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">
<link rel="stylesheet" href="./css/home.css">
<title>Villa on the rock</title>
<!-- boot -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<!-- fontowesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<!-- sweet alert -->
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<link rel="stylesheet" href="./admin/css/roombook.css">
<style>
#guestdetailpanel{
display: none;
}
#guestdetailpanel .middle{
height: 450px;
}
</style>
</head>
<body>
<nav>
<div class="logo">
<img class="bluebirdlogo" src="./image/bluebirdlogo.png" alt="logo">
<p>THE VILLA ON THE ROCK</p>
</div>
<ul>
<li><a href="#firstsection">Home</a></li>
<li><a href="#secondsection">Rooms</a></li>
<li><a href="#thirdsection">Facilites</a></li>
<li><a href="#contactus">contact us</a></li>
<a href="./logout.php"><button class="btn btn-danger">Logout</button></a>
</ul>
</nav>
<section id="firstsection" class="carousel slide carousel_section" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="carousel-image" src="./image/villa1.jpeg">
</div>
<div class="carousel-item">
<img class="carousel-image" src="./image/villa2.jpeg">
</div>
<div class="carousel-item">
<img class="carousel-image" src="./image/villa3.jpeg">
</div>
<div class="carousel-item">
<img class="carousel-image" src="./image/villa5.jpeg">
</div>
<div class="welcomeline">
<h1 class="welcometag">Welcome to the villa on the rock</h1>
</div>
<!-- bookbox -->
<div id="guestdetailpanel">
<form action="" method="POST" class="guestdetailpanelform">
<div class="head">
<h3>RESERVATION</h3>
<i class="fa-solid fa-circle-xmark" onclick="closebox()"></i>
</div>
<div class="middle">
<div class="guestinfo">
<h4>Guest information</h4>
<input type="text" name="Name" placeholder="Enter Full name">
<input type="email" name="Email" placeholder="Enter Email">
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe");
?>
<select name="Country" class="selectinput">
<option value selected >Select your country</option>
<?php
foreach($countries as $key => $value):
echo '<option value="'.$value.'">'.$value.'</option>';
//close your tags!!
endforeach;
?>
</select>
<input type="text" name="Phone" placeholder="Enter Phoneno">
</div>
<div class="line"></div>
<div class="reservationinfo">
<h4>Reservation information</h4>
<select name="RoomType" class="selectinput">
<option value selected >Type Of Room</option>
<option value="Superior Room">SUPERIOR ROOM</option>
<option value="Deluxe Room">DELUXE ROOM</option>
<option value="Guest House">GUEST HOUSE</option>
<option value="Single Room">SINGLE ROOM</option>
</select>
<select name="Bed" class="selectinput">
<option value selected >Bedding Type</option>
<option value="Single">Single</option>
<option value="Double">Double</option>
<option value="Triple">Triple</option>
<option value="Quad">Quad</option>
<option value="None">None</option>
</select>
<select name="NoofRoom" class="selectinput">
<option value selected >No of Room</option>
<option value="1">1</option>
<!-- <option value="1">2</option>
<option value="1">3</option> -->
</select>
<select name="Meal" class="selectinput">
<option value selected >Meal</option>
<option value="Room only">Room only</option>
<option value="Breakfast">Breakfast</option>
<option value="Half Board">Half Board</option>
<option value="Full Board">Full Board</option>
</select>
<div class="datesection">
<span>
<label for="cin"> Check-In</label>
<input name="cin" type ="date">
</span>
<span>
<label for="cin"> Check-Out</label>
<input name="cout" type ="date">
</span>
</div>
</div>
</div>
<div class="footer">
<button class="btn btn-success" name="guestdetailsubmit">Submit</button>
</div>
</form>
<!-- ==== room book php ====-->
<?php
if (isset($_POST['guestdetailsubmit'])) {
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Country = $_POST['Country'];
$Phone = $_POST['Phone'];
$RoomType = $_POST['RoomType'];
$Bed = $_POST['Bed'];
$NoofRoom = $_POST['NoofRoom'];
$Meal = $_POST['Meal'];
$cin = $_POST['cin'];
$cout = $_POST['cout'];
if($Name == "" || $Email == "" || $Country == ""){
echo "<script>swal({
title: 'Fill the proper details',
icon: 'error',
});
</script>";
}
else{
$sta = "NotConfirm";
$sql = "INSERT INTO roombook(Name,Email,Country,Phone,RoomType,Bed,NoofRoom,Meal,cin,cout,stat,nodays) VALUES ('$Name','$Email','$Country','$Phone','$RoomType','$Bed','$NoofRoom','$Meal','$cin','$cout','$sta',datediff('$cout','$cin'))";
$result = mysqli_query($conn, $sql);
if ($result) {
echo "<script>swal({
title: 'Reservation successful',
icon: 'success',
});
</script>";
} else {
echo "<script>swal({
title: 'Something went wrong',
icon: 'error',
});
</script>";
}
}
}
?>
</div>
</div>
</section>
<section id="secondsection">
<img src="./image/homeanimatebg.svg">
<div class="ourroom">
<h1 class="head">≼ Our room ≽</h1>
<div class="roomselect">
<div class="roombox">
<div class="hotelphoto h1"></div>
<div class="roomdata">
<h2>Superior Room</h2>
<div class="services">
<i class="fa-solid fa-wifi"></i>
<i class="fa-solid fa-burger"></i>
<i class="fa-solid fa-spa"></i>
<i class="fa-solid fa-dumbbell"></i>
<i class="fa-solid fa-person-swimming"></i>
</div>
<button class="btn btn-primary bookbtn" onclick="openbookbox()">Book</button>
</div>
</div>
<div class="roombox">
<div class="hotelphoto h2"></div>
<div class="roomdata">
<h2>Delux Room</h2>
<div class="services">
<i class="fa-solid fa-wifi"></i>
<i class="fa-solid fa-burger"></i>
<i class="fa-solid fa-spa"></i>
<i class="fa-solid fa-dumbbell"></i>
</div>
<button class="btn btn-primary bookbtn" onclick="openbookbox()">Book</button>
</div>
</div>
<div class="roombox">
<div class="hotelphoto h3"></div>
<div class="roomdata">
<h2>Guest Room</h2>
<div class="services">
<i class="fa-solid fa-wifi"></i>
<i class="fa-solid fa-burger"></i>
<i class="fa-solid fa-spa"></i>
</div>
<button class="btn btn-primary bookbtn" onclick="openbookbox()">Book</button>
</div>
</div>
<div class="roombox">
<div class="hotelphoto h4"></div>
<div class="roomdata">
<h2>Single Room</h2>
<div class="services">
<i class="fa-solid fa-wifi"></i>
<i class="fa-solid fa-burger"></i>
</div>
<button class="btn btn-primary bookbtn" onclick="openbookbox()">Book</button>
</div>
</div>
</div>
</div>
</section>
<section id="thirdsection">
<h1 class="head">≼ Facilities ≽</h1>
<div class="facility">
<div class="box">
<h2>Swiming pool</h2>
</div>
<div class="box">
<h2>Spa</h2>
</div>
<div class="box">
<h2>24*7 Restaurants</h2>
</div>
<div class="box">
<h2>24*7 Gym</h2>
</div>
<div class="box">
<h2>Bike rent service</h2>
</div>
</div>
</section>
<section id="contactus">
<div class="social">
<i class="fa-brands fa-instagram"></i>
<i class="fa-brands fa-facebook"></i>
<i class="fa-solid fa-envelope"></i>
</div>
<div class="createdby">
<h5>Created by @damith</h5>
</div>
</section>
</body>
<script>
var bookbox = document.getElementById("guestdetailpanel");
openbookbox = () =>{
bookbox.style.display = "flex";
}
closebox = () =>{
bookbox.style.display = "none";
}
</script>
</html>