-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
189 lines (161 loc) · 7.6 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
<?php error_reporting(0);
include('includes/config.php');
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$sql="INSERT INTO tblenquiry(FullName,EmailId,Subject,Description) VALUES(:name,:email,:subject,:message)";
$query = $dbh->prepare($sql);
$query->bindParam(':name',$name,PDO::PARAM_STR);
$query->bindParam(':email',$email,PDO::PARAM_STR);
$query->bindParam(':subject',$subject,PDO::PARAM_STR);
$query->bindParam(':message',$message,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
echo "<script>alert('Query sent successfully');</script>";
echo "<script>window.location.href ='contact.php'</script>";
}
else
{
echo "<script>alert('Something went wrong. Please try again.');</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CWMS | Contact Us</title>
<!-- Favicon -->
<link href="img/favicon.ico" rel="icon">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
<!-- CSS Libraries -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="lib/flaticon/font/flaticon.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php include_once('includes/header.php');?>
<!-- Page Header Start -->
<div class="page-header">
<div class="container">
<div class="row">
<div class="col-12">
<h2>Contact Us</h2>
</div>
<div class="col-12">
<a href="index.php">Home</a>
<a href="contact.php">Contact</a>
</div>
</div>
</div>
</div>
<!-- Page Header End -->
<!-- Contact Start -->
<div class="contact">
<div class="container">
<div class="section-header text-center">
<p>Get In Touch</p>
<h2>Contact for any query</h2>
</div>
<div class="row">
<?php
$sql = "SELECT * from tblpages where type='contact'";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
foreach($results as $result)
{
?>
<div class="col-md-4">
<div class="contact-info">
<h2>Quick Contact Info</h2>
<div class="contact-info-item">
<div class="contact-info-icon">
<i class="fa fa-map-marker-alt"></i>
</div>
<div class="contact-info-text">
<h3>Address</h3>
<p>+<?php echo $result->detail; ?></p>
</div>
</div>
<div class="contact-info-item">
<div class="contact-info-icon">
<i class="far fa-clock"></i>
</div>
<div class="contact-info-text">
<h3>Opening Hour</h3>
<p><?php echo $result->openignHrs; ?></p>
</div>
</div>
<div class="contact-info-item">
<div class="contact-info-icon">
<i class="fa fa-phone-alt"></i>
</div>
<div class="contact-info-text">
<h3>Call Us</h3>
<p>+<?php echo $result->phoneNumber; ?></p>
</div>
</div>
<div class="contact-info-item">
<div class="contact-info-icon">
<i class="far fa-envelope"></i>
</div>
<div class="contact-info-text">
<h3>Email Us</h3>
<p><?php echo $result->emailId; ?></p>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="col-md-7">
<div class="contact-form">
<div id="success"></div>
<form name="sentMessage" id="contactForm" method="post">
<div class="control-group">
<input type="text" class="form-control" id="name" placeholder="Your Name" required="required" name="name" /><br />
</div>
<div class="control-group">
<input type="email" class="form-control" id="email" placeholder="Your Email" name="email" required="required" /> <br />
</div>
<div class="control-group">
<input type="text" class="form-control" id="subject" placeholder="Subject" required="required" name="subject" /> <br />
</div>
<div class="control-group">
<textarea class="form-control" id="message" placeholder="Message" required="required" name="message" ></textarea><br />
</div>
<div>
<button class="btn btn-custom" type="submit" id="sendMessageButton" name="submit">Send Message</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Contact End -->
<!-- Footer Start -->
<?php include_once('includes/footer.php');?>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/counterup/counterup.min.js"></script>
<!-- Contact Javascript File -->
<!-- -->
<!-- Template Javascript -->
<script src="js/main.js"></script>
</body>
</html>