-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
150 lines (125 loc) · 6.38 KB
/
contact.php
File metadata and controls
150 lines (125 loc) · 6.38 KB
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
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_POST['send'])){
$name = $_POST['name'];
$email = $_POST['email'];
$number = $_POST['number'];
$msg = $_POST['msg'];
$select_message = $conn->prepare("SELECT * FROM `message` WHERE name = ? AND email = ? AND number = ? AND message = ?");
$select_message->execute([$name, $email, $number, $msg]);
if($select_message->rowCount() > 0){
echo '
<div class="d-flex align-items-center border border-warning mb-4 " style="padding: 15px;">
<h3 class="fa-solid fa-triangle-exclamation text-warning mr-3"></h3>
<h5 class="font-weight-semi-bold m-0">Tin nhắn đã tồn tại</h5>
<i class="fas fa-times ml-auto text-danger " style="font-size: 1.5rem;" onclick="this.parentElement.remove();"></i>
</div>';
}else{
$insert_message = $conn->prepare("INSERT INTO `message`(user_id, name, email, number, message) VALUES(?,?,?,?,?)");
$insert_message->execute([$user_id, $name, $email, $number, $msg]);
echo '
<div class="d-flex align-items-center border border-success mb-4 " style="padding: 15px;">
<h3 class="fa-solid fa-check text-success mr-3"></h3>
<h5 class="font-weight-semi-bold m-0">Tin nhắn được gửi thành công</h5>
<i class="fas fa-times ml-auto " style="font-size: 1.5rem;" onclick="this.parentElement.remove();"></i>
</div>';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Liên hệ</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="T Chow" name="keywords">
<meta content="T Chow" name="description">
<!-- Favicon -->
<link rel="shortcut icon" type="image/icon" href="./images/favicon.ico"/>
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<!-- Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link href="./lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Customized Bootstrap Stylesheet -->
<link href="./css/style.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<!-- Topbar Start -->
<?php include 'header.php'; ?>
<!-- Topbar End -->
<!-- Page Header Start -->
<div class="container-fluid bg-secondary mb-5">
<div class="d-flex flex-column align-items-center justify-content-center" style="min-height: 120px">
<h1 class="font-weight-semi-bold text-uppercase mt-3">Liên hệ</h1>
<div class="d-inline-flex mb-3">
<p class="m-0"><a href="home.php">Trang chủ</a></p>
<p class="m-0 px-2">-</p>
<p class="m-0">Liên hệ</p>
</div>
</div>
</div>
<!-- Page Header End -->
<!-- Contact Start -->
<div class="container-fluid pt-4">
<div class="text-center mb-5">
<h2 class="section-title px-5"><span class="px-2">Liên hệ với chúng tôi</span></h2>
</div>
<div class="row px-xl-5">
<div class="col-lg-7 mb-5">
<div class="contact-form">
<form id="contactForm" novalidate="novalidate" action="" method="POST">
<div class="control-group">
<input name="name" type="text" class="form-control" placeholder="Tên của bạn"/>
<p class="help-block text-danger"></p>
</div>
<div class="control-group">
<input name="email" type="email" class="form-control" placeholder="Email"/>
<p class="help-block text-danger"></p>
</div>
<div class="control-group">
<input name="number" type="number" min="0" class="form-control" placeholder="Số điện thoại"/>
<p class="help-block text-danger"></p>
</div>
<div class="control-group">
<textarea name="msg" class="form-control" rows="6" placeholder="Nội dung"></textarea>
<p class="help-block text-danger"></p>
</div>
<div>
<button name="send" class="btn btn-primary py-2 px-4 border" type="submit" id="sendMessageButton">Gửi tin nhắn</button>
</div>
</form>
</div>
</div>
<div class="col-lg-5 mb-5">
<h5 class="font-weight-bold mb-3">Liên hệ với chúng tôi</h5>
<p>Chúng tôi rất vui lòng khi nhận được phản hồi từ bạn.</p>
<div class="d-flex flex-column mb-3">
<h5 class="font-weight-bold mb-3">Cửa hàng 1</h5>
<p class="mb-2"><i class="fa fa-map-marker-alt text-primary mr-3"></i>Vị Thanh, Hậu Giang</p>
<p class="mb-2"><i class="fa fa-envelope text-primary mr-3"></i>chaub1910192@student.ctu.edu.vn</p>
<p class="mb-2"><i class="fa fa-phone-alt text-primary mr-3"></i>012 345 67890</p>
</div>
<div class="d-flex flex-column">
<h5 class="font-weight-bold mb-3">Cửa hàng 2</h5>
<p class="mb-2"><i class="fa fa-map-marker-alt text-primary mr-3"></i>Lai Vung, Đồng Tháp</p>
<p class="mb-2"><i class="fa fa-envelope text-primary mr-3"></i>truongb1910325@student.ctu.edu.vn</p>
<p class="mb-0"><i class="fa fa-phone-alt text-primary mr-3"></i>012 345 67890</p>
</div>
</div>
</div>
</div>
<!-- Contact End -->
<!-- Footer Start -->
<?php include 'footer.php'; ?>
<!-- Footer End -->
</body>
</html>