-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontact.php
252 lines (243 loc) · 16.3 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
<?php
session_start();
ob_start();
$rootPath = '/ananas';
require_once './database/DB.php';
?>
<?php
$status = "";
if (isset($_POST['submit'])) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$message = mysqli_real_escape_string($conn, $_POST['message']);
$phone = '';
if ($name =='' || $email =='' || $message == '') {
$status = 'Vui lòng điền các trường còn thiếu';
} else {
$sql = "INSERT INTO contact (username, email, message) VALUES ('$name', '$email', '$message')";
if ($conn->query($sql) === TRUE) {
// echo "Send message successfully";
$status = "Cảm ơn bạn đã liên hệ với chúng tôi. <br> Chúng tôi sẽ phản hồi cho bạn trong thời gian sớm nhất.";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
}
?>
<!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>Liên hệ - Ananas</title>
<link rel="stylesheet" href="https://site-assets.fontawesome.com/releases/v6.1.2/css/all.css">
<!-- CSS only -->
<link rel="icon" type="image/x-icon" href="https://brademar.com/wp-content/uploads/2022/09/Ananas-Logo-PNG-1.png">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link rel="stylesheet" href="./public/css/base.css">
<link rel="stylesheet" href="./public/css/contact.css">
</head>
<body>
<?php
require './includes/header.php';
require './includes/navbar.php';
?>
<!-- <div class="container-fluid bg-light py-5">
<div class="col-md-6 m-auto text-center">
<h1 class="h1" style="color:#002A54">Liên hệ với chúng tôi</h1>
<p style="color:#ED171F">
Bạn có thắc mắc về dịch vụ của chúng tôi? Hãy gửi tin nhắn cho chúng tôi tại đây.
</p>
</div>
</div> -->
<!-- start contact page -->
<!-- <div class="container py-2">
<div class="row py-2">
<p class="text-center text-danger"><?php echo $status?></p>
<form class="col-md-9 m-auto" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" role="form">
<div class="row">
<div class="form-group col-md-6 mb-3">
<label for="contactName">Tên của bạn</label>
<input type="text" class="form-control mt-1" id="contactName" name="name" placeholder="Enter your name">
</div>
<div class="form-group col-md-6 mb-3">
<label for="contactEmail">Email</label>
<input type="email" class="form-control mt-1" id="contactEmail" name="email" placeholder=" Enter your email">
</div>
</div>
<div class="mb-3">
<label for="contactMessage">Tin nhắn</label>
<textarea class="form-control mt-1" id="contactMessage" name="message" placeholder="Message" rows="8"></textarea>
</div>
<div class="row">
<div class="col text-end mt-2">
<button name="submit" type="submit" class="btn btn-primary btn-lg px-5 contact-btn">Gửi</button>
</div>
</div>
</form>
</div>
</div> -->
<section class="bg-light py-3 py-md-5">
<div class="container">
<div class="row gy-3 gy-md-4 gy-lg-0 align-items-md-center">
<div class="col-12 col-lg-6">
<div class="row justify-content-xl-center">
<div class="col-12 col-xl-11">
<h2 class="h1 mb-3">Thông tin liên lạc</h2>
<p class="lead fs-4 text-secondary mb-5">Khách hàng là thượng đế. Nếu bạn quan tâm hay gặp
bất kỳ vấn đề gì trong quá trình trải nghiệm và sử dung sản phẩm. Hãy liên hệ với chúng
tôi.</p>
<div class="d-flex mb-5">
<div class="me-4 text-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor"
class="bi bi-geo" viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z" />
</svg>
</div>
<div>
<h4 class="mb-3">Địa chỉ</h4>
<address class="mb-0 text-secondary">Đại học Bách Khoa, Bình Dương, Việt Nam
</address>
</div>
</div>
<div class="row mb-5">
<div class="col-12 col-sm-6">
<div class="d-flex mb-5 mb-sm-0">
<div class="me-4 text-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"
fill="currentColor" class="bi bi-telephone-outbound"
viewBox="0 0 16 16">
<path
d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511zM11 .5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V1.707l-4.146 4.147a.5.5 0 0 1-.708-.708L14.293 1H11.5a.5.5 0 0 1-.5-.5z" />
</svg>
</div>
<div>
<h4 class="mb-3">Điện thoại</h4>
<p class="mb-0">
<a class="link-secondary text-decoration-none"
href="tel:+15057922430">086.289.8859</a>
</p>
</div>
</div>
</div>
<div class="col-12 col-sm-6">
<div class="d-flex mb-0">
<div class="me-4 text-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"
fill="currentColor" class="bi bi-envelope-at" viewBox="0 0 16 16">
<path
d="M2 2a2 2 0 0 0-2 2v8.01A2 2 0 0 0 2 14h5.5a.5.5 0 0 0 0-1H2a1 1 0 0 1-.966-.741l5.64-3.471L8 9.583l7-4.2V8.5a.5.5 0 0 0 1 0V4a2 2 0 0 0-2-2H2Zm3.708 6.208L1 11.105V5.383l4.708 2.825ZM1 4.217V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.217l-7 4.2-7-4.2Z" />
<path
d="M14.247 14.269c1.01 0 1.587-.857 1.587-2.025v-.21C15.834 10.43 14.64 9 12.52 9h-.035C10.42 9 9 10.36 9 12.432v.214C9 14.82 10.438 16 12.358 16h.044c.594 0 1.018-.074 1.237-.175v-.73c-.245.11-.673.18-1.18.18h-.044c-1.334 0-2.571-.788-2.571-2.655v-.157c0-1.657 1.058-2.724 2.64-2.724h.04c1.535 0 2.484 1.05 2.484 2.326v.118c0 .975-.324 1.39-.639 1.39-.232 0-.41-.148-.41-.42v-2.19h-.906v.569h-.03c-.084-.298-.368-.63-.954-.63-.778 0-1.259.555-1.259 1.4v.528c0 .892.49 1.434 1.26 1.434.471 0 .896-.227 1.014-.643h.043c.118.42.617.648 1.12.648Zm-2.453-1.588v-.227c0-.546.227-.791.573-.791.297 0 .572.192.572.708v.367c0 .573-.253.744-.564.744-.354 0-.581-.215-.581-.8Z" />
</svg>
</div>
<div>
<h4 class="mb-3">E-Mail</h4>
<p class="mb-0">
<a class="link-secondary text-decoration-none"
href="mailto:[email protected]">[email protected]</a>
</p>
</div>
</div>
</div>
</div>
<div class="d-flex">
<div class="me-4 text-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor"
class="bi bi-alarm" viewBox="0 0 16 16">
<path
d="M8.5 5.5a.5.5 0 0 0-1 0v3.362l-1.429 2.38a.5.5 0 1 0 .858.515l1.5-2.5A.5.5 0 0 0 8.5 9V5.5z" />
<path
d="M6.5 0a.5.5 0 0 0 0 1H7v1.07a7.001 7.001 0 0 0-3.273 12.474l-.602.602a.5.5 0 0 0 .707.708l.746-.746A6.97 6.97 0 0 0 8 16a6.97 6.97 0 0 0 3.422-.892l.746.746a.5.5 0 0 0 .707-.708l-.601-.602A7.001 7.001 0 0 0 9 2.07V1h.5a.5.5 0 0 0 0-1h-3zm1.038 3.018a6.093 6.093 0 0 1 .924 0 6 6 0 1 1-.924 0zM0 3.5c0 .753.333 1.429.86 1.887A8.035 8.035 0 0 1 4.387 1.86 2.5 2.5 0 0 0 0 3.5zM13.5 1c-.753 0-1.429.333-1.887.86a8.035 8.035 0 0 1 3.527 3.527A2.5 2.5 0 0 0 13.5 1z" />
</svg>
</div>
<div>
<h4 class="mb-3">Giờ mở cửa</h4>
<div class="d-flex mb-1">
<p class="text-secondary fw-bold mb-0 me-5">Mon - Fri</p>
<p class="text-secondary mb-0">9am - 5pm</p>
</div>
<div class="d-flex">
<p class="text-secondary fw-bold mb-0 me-5">Sat - Sun</p>
<p class="text-secondary mb-0">9am - 2pm</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6">
<p class="text-center text-danger"><?php echo $status?></p>
<div class="bg-white border rounded shadow-sm overflow-hidden">
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST" role="form">
<div class="row gy-4 gy-xl-5 p-4 p-xl-5">
<div class="col-12 col-md-6">
<label for="fullname" class="form-label">Full Name <span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="fullname" name="name"
required>
</div>
<div class="col-12 col-md-6">
<label for="email" class="form-label">Email <span
class="text-danger">*</span></label>
<div class="input-group">
<span class="input-group-text">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-envelope" viewBox="0 0 16 16">
<path
d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z" />
</svg>
</span>
<input type="email" class="form-control" id="email" name="email"
required>
</div>
</div>
<div class="col-12">
<label for="message" class="form-label">Message <span
class="text-danger">*</span></label>
<textarea class="form-control" id="message" name="message" rows="3"
required></textarea>
</div>
<div class="col-12">
<div class="d-grid">
<button class="btn btn-primary btn-lg" name="submit" type="submit">Gửi tin nhắn</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<!-- end contact page -->
<?php
$conn->close();
require './includes/footer.php';
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"
integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous">
</script>
<script src="./public/javascripts/loadCartHeader.js"></script>
<script>
$(document).ready(function() {
loadCartAjax();
$(window).scroll(function() {
if ($(this).scrollTop() > 114) {
$("#navbar-top").addClass('fix-nav')
} else {
$("#navbar-top").removeClass('fix-nav')
}
})
});
</script>
<script src="./public/javascripts/liveSearch.js"></script>
</body>
</html>