-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
265 lines (249 loc) · 11.2 KB
/
contact.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>
<?= $_SESSION['setting_hotel_name'] . " | Contact Us" ?>
</title>
</head>
<body>
<!-- Page Preloder -->
<div id="preloder">
<div class="loader"></div>
</div>
<!-- Offcanvas Menu Section Begin -->
<div class="offcanvas-menu-overlay"></div>
<div class="canvas-open">
<i class="icon_menu"></i>
</div>
<div class="offcanvas-menu-wrapper">
<div class="canvas-close">
<i class="icon_close"></i>
</div>
<div class="search-icon search-switch">
<i class="icon_search"></i>
</div>
<div class="header-configure-area">
<div class="language-option">
<span>EN <i class="fa fa-angle-down"></i></span>
<div class="flag-dropdown">
<ul>
<li><a href="#">Fr</a></li>
</ul>
</div>
</div>
<a href="./index.php?page=home" class="bk-btn">Book Now</a>
</div>
<nav class="mainmenu mobile-menu">
<ul>
<li><a href="./index.php?page=home">Home</a></li>
<li><a href="./index.php?page=rooms">Rooms</a></li>
<li><a href="./index.php?page=about-us">About Us</a></li>
<!-- <li><a href="./pages.html">Pages</a>
<ul class="dropdown">
<li><a href="./room-details.html">Room Details</a></li>
<li><a href="#">Deluxe Room</a></li>
<li><a href="#">Family Room</a></li>
<li><a href="#">Premium Room</a></li>
</ul>
</li> -->
<li><a href="./index.php?page=blog">News</a></li>
<li class="active"><a href="./index.php?page=contact">Contact</a></li>
</ul>
</nav>
<div id="mobile-menu-wrap"></div>
<div class="top-social">
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-instagram"></i></a>
</div>
<ul class="top-widget">
<li><i class="fa fa-phone"></i> <?= $_SESSION['setting_contact'] ?></li>
<li><i class="fa fa-envelope"></i> <?= $_SESSION['setting_email'] ?></li>
</ul>
</div>
<!-- Offcanvas Menu Section End -->
<!-- Header Section Begin -->
<header class="header-section">
<div class="top-nav">
<div class="container">
<div class="row">
<div class="col-lg-6">
<ul class="tn-left">
<li><i class="fa fa-phone"></i> <?= $_SESSION['setting_contact'] ?></li>
<li><i class="fa fa-envelope"></i> <?= $_SESSION['setting_email'] ?></li>
</ul>
</div>
<div class="col-lg-6">
<div class="tn-right">
<div class="top-social">
<a href="#"><i class="fa fa-facebook"></i></a>
<a href="#"><i class="fa fa-twitter"></i></a>
<a href="#"><i class="fa fa-instagram"></i></a>
</div>
<a href="./index.php?page=home" class="bk-btn">Book Now</a>
<div class="language-option">
<span>EN <i class="fa fa-angle-down"></i></span>
<div class="flag-dropdown">
<ul>
<li><a href="#">Fr</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="menu-item">
<div class="container">
<div class="row">
<div class="col-lg-2">
<div class="logo">
<a href="./index.php?page=home">
<img src="img/logo.png" alt="logo image">
</a>
</div>
</div>
<div class="col-lg-10">
<div class="nav-menu">
<nav class="mainmenu">
<ul>
<li><a href="./index.php?page=home">Home</a></li>
<li><a href="./index.php?page=rooms">Rooms</a></li>
<li><a href="./index.php?page=about-us">About Us</a></li>
<!-- <li><a href="./pages.php">Pages</a>
<ul class="dropdown">
<li><a href="./room-details.html">Room Details</a></li>
<li><a href="./blog-details.html">Blog Details</a></li>
<li><a href="#">Family Room</a></li>
<li><a href="#">Premium Room</a></li>
</ul> -->
</li>
<li><a href="./index.php?page=blog">News</a></li>
<li class="active"><a href="./index.php?page=contact">Contact</a></li>
</ul>
</nav>
<div class="nav-right search-switch">
<i class="icon_search"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Header End -->
<!-- Contact Section Begin -->
<section class="contact-section spad">
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="contact-text">
<h2>Contact Info</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.</p>
<table>
<tbody>
<tr>
<td class="c-o">Address:</td>
<td>Plot DD34, kings Avenue Wuse Abuja Nigeria.</td>
</tr>
<tr>
<td class="c-o">Phone:</td>
<td><?= $_SESSION['setting_contact'] ?></td>
</tr>
<tr>
<td class="c-o">Email:</td>
<td><?= $_SESSION['setting_email'] ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-lg-7 offset-lg-1 contact-form-wrapper" style="bottom: 1.4rem; position:relative">
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']); ?>" method="post" class="contact-form">
<div class="row">
<div class="col-lg-6">
<input type="text" name="name" placeholder="Your Name ..." autocomplete="off" required>
</div>
<div class="col-lg-6">
<input type="text" name="email" placeholder="Your Email ..." autocomplete="off" required>
</div>
<div class="col-lg-12">
<textarea name="message" placeholder="Your Message ..." required></textarea>
<button type="submit">Submit</button>
</div>
</div>
</form>
</div>
</div>
<div class="map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3447.453724039318!2d7.463476309913093!3d9.068582890956748!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x104e0b1df05c451b%3A0x37e4050547e1366b!2sWuse%20Market%20Rd%2C%20Wuse%2C%20Abuja%20904101%2C%20Federal%20Capital%20Territory!5e1!3m2!1sen!2sng!4v1726952348722!5m2!1sen!2sng" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</div>
</div>
</section>
<!-- Contact Section End -->
<!-- Footer -->
<?php
include('./footer.php')
?>
<!--/ Footer -->
<!-- Search model Begin -->
<div class="search-model">
<div class="h-100 d-flex align-items-center justify-content-center">
<div class="search-close-switch"><i class="icon_close"></i></div>
<form class="search-model-form">
<input type="text" id="search-input" placeholder="Search here ..." autocomplete="off">
</form>
</div>
</div>
<!-- Search model end -->
<!-- Js Plugins -->
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/jquery.slicknav.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>
<?php
// Check if form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['name'])) {
// Get the submitted form data
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$message = mysqli_real_escape_string($conn, $_POST['message']);
// Prepare the SQL statement to insert the form data into the contact_messages table
$sql = "INSERT INTO contact (name, email, message) VALUES (?, ?, ?)";
// Prepare statement to prevent SQL injection
$stmt = $conn->prepare($sql);
$stmt->bind_param("sss", $name, $email, $message);
// Execute the statement
if ($stmt->execute()) {
// Success: Show SweetAlert for success
echo "<script>
Swal.fire({
icon: 'success',
title: 'Success!',
text: 'Your message has been sent successfully!',
confirmButtonText: 'OK'
});
</script>";
} else {
// Error: Show SweetAlert for error
echo "<script>
Swal.fire({
icon: 'error',
title: 'Error!',
text: 'There was an error sending your message. Please try again.',
confirmButtonText: 'OK'
});
</script>";
}
// Close statement
$stmt->close();
}
?>