-
Notifications
You must be signed in to change notification settings - Fork 1
/
contact.php
347 lines (323 loc) · 16 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
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<title>Contact Us</title>
<link rel = "icon" href ="img/logo.jpg" type = "image/x-icon">
<style>
.icon-badge-group .icon-badge-container {
display: inline-block;
}
.icon-badge-container {
position: absolute;
}
.icon-badge-icon {
font-size: 30px;
color: rgb(0 0 0 / 50%);
position: relative;
}
.icon-badge {
background-color: #979797;;
font-size: 10px;
color: white;
text-align: center;
width: 15px;
height: 15px;
border-radius: 49%;
position: relative;
top: -35px;
left: 17px;
}
.footer.container-fluid.bg-dark.text-light {
position:fixed;
bottom:0;
}
.contact2 {
font-family: "Montserrat", sans-serif;
color: #8d97ad;
font-weight: 300;
/* padding: 60px 0; */
/* margin-bottom: 170px; */
background-position: center top;
}
.contact2 h1,
.contact2 h2,
.contact2 h3,
.contact2 h4,
.contact2 h5,
.contact2 h6 {
color: #3e4555;
}
.contact2 .font-weight-medium {
font-weight: 500;
}
.contact2 .subtitle {
color: #8d97ad;
line-height: 24px;
}
.contact2 .bg-image {
background-size: cover;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.contact2 .card.card-shadow {
-webkit-box-shadow: 0px 0px 30px rgba(115, 128, 157, 0.1);
box-shadow: 0px 0px 30px rgba(61, 109, 214, 0.774);
}
.contact2 .detail-box .round-social {
margin-top: 100px;
}
.contact2 .round-social a {
background: transparent;
margin: 0 7px;
padding: 11px 12px;
}
.contact2 .contact-container .links a {
color: #8d97ad;
}
.contact2 .contact-container {
position: relative;
top: 107px;
}
.contact2 .btn-danger-gradiant {
background: #ff4d7e;
background: -webkit-linear-gradient(legacy-direction(to right), #ff4d7e 0%, #ff6a5b 100%);
background: -webkit-gradient(linear, left top, right top, from(#ff4d7e), to(#ff6a5b));
background: -webkit-linear-gradient(left, #ff4d7e 0%, #ff6a5b 100%);
background: -o-linear-gradient(left, #ff4d7e 0%, #ff6a5b 100%);
background: linear-gradient(to right, #ff4d7e 0%, #ff6a5b 100%);
}
.contact2 .btn-danger-gradiant:hover {
background: #ff6a5b;
background: -webkit-linear-gradient(legacy-direction(to right), #ff6a5b 0%, #ff4d7e 100%);
background: -webkit-gradient(linear, left top, right top, from(#ff6a5b), to(#ff4d7e));
background: -webkit-linear-gradient(left, #ff6a5b 0%, #ff4d7e 100%);
background: -o-linear-gradient(left, #ff6a5b 0%, #ff4d7e 100%);
background: linear-gradient(to right, #ff6a5b 0%, #ff4d7e 100%);
}
</style>
</head>
<body>
<?php include 'partials/_dbconnect.php';?>
<?php include 'partials/_nav.php';?>
<div class="contact2" style="background-image:url(img/map1.jpg);height: 400px;" id="contact">
<div class="container">
<div class="row contact-container">
<div class="col-lg-12">
<div class="card card-shadow border-0 mb-4">
<div class="row">
<div class="col-lg-8">
<div class="contact-box p-4">
<div class="row">
<div class="col-lg-8">
<h4 class="title">Contact Us</h4>
</div>
<?php if($loggedin){ ?>
<div class="col-lg-4">
<div class="icon-badge-container mx-1" style="padding-left: 167px;">
<a href="#" data-toggle="modal" data-target="#adminReply"><i class="far fa-envelope icon-badge-icon"></i></a>
<div class="icon-badge"><b><span id="totalMessage">0</span></b></div>
</div>
</div>
<?php } ?>
</div>
<?php
$passSql = "SELECT * FROM users WHERE id='$userId'";
$passResult = mysqli_query($conn, $passSql);
$passRow=mysqli_fetch_assoc($passResult);
$email = $passRow['email'];
$phone = $passRow['phone'];
?>
<form action="partials/_manageContactUs.php" method="POST">
<div class="row">
<div class="col-lg-6">
<div class="form-group mt-3">
<b><label for="email">Email:</label></b>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter Your Email" required value="<?php echo $email ?>">
</div>
</div>
<div class="col-lg-6">
<div class="form-group mt-3">
<b><label for="phone">Phone No:</label></b>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon">+91</span>
</div>
<input type="tel" class="form-control" id="phone" name="phone" aria-describedby="basic-addon" placeholder="Enter Your Phone Number" required pattern="[0-9]{10}" value="<?php echo $phone ?>">
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group mt-3">
<b><label for="orderId">Order Id:</label></b>
<input class="form-control" type="text" id="orderId" name="orderId" placeholder="Order Id" value="0">
<small id="orderIdHelp" class="form-text text-muted">If your problem is not related to the order(order id = 0).</small>
</div>
</div>
<div class="col-lg-6">
<div class="form-group mt-3">
<b><label for="password">Password:</label></b>
<input class="form-control" id="password" name="password" placeholder="Enter Password" type="password" placeholder="Enter Your Password" required data-toggle="password">
</div>
</div>
<div class="col-lg-12">
<div class="form-group mt-3">
<textarea class="form-control" id="message" name="message" rows="2" required minlength="6" placeholder="How May We Help You ?"></textarea>
</div>
</div>
<?php if($loggedin){ ?>
<div class="col-lg-12">
<button type="submit" class="btn btn-danger-gradiant mt-3 mb-3 text-white border-0 py-2 px-3"><span> SUBMIT NOW <i class="ti-arrow-right"></i></span></button>
<button type="button" class="btn btn-danger-gradiant mt-3 mb-3 text-white border-0 py-2 px-3 mx-2" data-toggle="modal" data-target="#history"><span> HISTORY <i class="ti-arrow-right"></i></span></button>
</div>
<?php }else { ?>
<div class="col-lg-12">
<button type="submit" class="btn btn-danger-gradiant mt-3 text-white border-0 py-2 px-3" disabled><span> SUBMIT NOW <i class="ti-arrow-right"></i></span></button>
<small class="form-text text-muted">First login to Contct with Us.</small>
</div>
<?php } ?>
</div>
</form>
</div>
</div>
<?php
$sql = "SELECT * FROM `sitedetail`";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$systemName = $row['systemName'];
$address = $row['address'];
$email = $row['email'];
$contact1 = $row['contact1'];
$contact2 = $row['contact2'];
echo '<div class="col-lg-4 bg-image" style="background-image:url(img/contact.jpg)">
<div class="detail-box p-4">
<h5 class="text-black font-weight-light mb-3">ADDRESS</h5>
<p class="text-black op-7">' .$address. '</p>
<h5 class="text-black font-weight-light mb-3 mt-4">CALL US</h5>
<p class="text-black op-7">' .$contact1. '
<br> ' .$contact2. '</p>
<div class="round-social light">
<a href="https://www.google.com/intl/en-GB/gmail/about/' .$email. '" class="ml-0 text-decoration-none text-white border border-white rounded-circle" target="_blank"><i class="far fa-envelope"></i></a>
<a href="https://github.com/" class="text-decoration-none text-white border border-white rounded-circle" target="_blank"><i class="fab fa-github"></i></i></a>
<a href="https://youtube.com/" class="text-decoration-none text-white border border-white rounded-circle" target="_blank"><i class="fab fa-youtube"></i></a>
</div>
</div>
</div>';
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Message Modal -->
<div class="modal fade" id="adminReply" tabindex="-1" role="dialog" aria-labelledby="adminReply" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color: rgb(187 188 189);">
<h5 class="modal-title" id="adminReply">Admin Reply</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="messagebd">
<table class="table-striped table-bordered col-md-12 text-center">
<thead style="background-color: rgb(111 202 203);">
<tr>
<th>Contact Id</th>
<th>Reply Message</th>
<th>datetime</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM `contactreply` WHERE `userId`='$userId'";
$result = mysqli_query($conn, $sql);
$count = 0;
while($row=mysqli_fetch_assoc($result)) {
$contactId = $row['contactId'];
$message = $row['message'];
$datetime = $row['datetime'];
$count++;
echo '<tr>
<td>' .$contactId. '</td>
<td>' .$message. '</td>
<td>' .$datetime. '</td>
</tr>';
}
echo '<script>document.getElementById("totalMessage").innerHTML = "' .$count. '";</script>';
if($count==0) {
?><script> document.getElementById("messagebd").innerHTML = '<div class="my-1">you have not recieve any message.</div>';</script> <?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- history Modal -->
<div class="modal fade" id="history" tabindex="-1" role="dialog" aria-labelledby="history" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color: rgb(187 188 189);">
<h5 class="modal-title" id="history">Your Sent Message</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="bd">
<table class="table-striped table-bordered col-md-12 text-center">
<thead style="background-color: rgb(111 202 203);">
<tr>
<th>Contact Id</th>
<th>Order Id</th>
<th>Message</th>
<th>datetime</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM `contact` WHERE `userId`='$userId'";
$result = mysqli_query($conn, $sql);
$count = 0;
while($row=mysqli_fetch_assoc($result)) {
$contactId = $row['contactId'];
$orderId = $row['orderId'];
$message = $row['message'];
$datetime = $row['time'];
$count++;
echo '<tr>
<td>' .$contactId. '</td>
<td>' .$orderId. '</td>
<td>' .$message. '</td>
<td>' .$datetime. '</td>
</tr>';
}
if($count==0) {
?><script> document.getElementById("bd").innerHTML = '<div class="my-1">you have not contacted us.</div>';</script> <?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include 'partials/_footer.php';?>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://unpkg.com/[email protected]/dist/bootstrap-show-password.min.js"></script>
</body>
</html>