-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeedback.php
More file actions
468 lines (376 loc) · 10.8 KB
/
Copy pathfeedback.php
File metadata and controls
468 lines (376 loc) · 10.8 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
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "eventadministration";
$conn = mysqli_connect($servername,$username,$password,$database);
$eid= $_GET['eid'];
$date = date('Y-m-d');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Get your feedback</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="" name="keywords">
<meta content="" name="description">
<link href="img/favicon.png" rel="icon">
<link href="img/apple-touch-icon.png" rel="apple-touch-icon">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Montserrat:300,400,500,700" rel="stylesheet">
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/lightbox/css/lightbox.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body{margin-top:20px;
background:#eee;
}
.ratings-container {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
max-width: 800px;
margin: 20px auto;
}
.item {
border: 1px solid #ccc;
padding: 10px;
margin: 10px;
}
.item-name {
font-weight: bold;
}
.rating {
color: #00f;
font-size: 24px;
}
.star {
color: #ddd;
font-size: 20px;
cursor: pointer;
}
.filled {
color: #f8d825;
}
.contact-area {
background-attachment: fixed;
background-size: cover;
background-position: center;
}
@media only screen and (max-width:768px) {
.contact {
margin-bottom: 60px;
}
}
.contact input {
background: #fff;
border: 1px solid #fff;
border-radius: 3px;
-webkit-box-shadow: none;
box-shadow: none;
color: #232434;
font-size: 16px;
height: 60px;
padding: 10px;
width: 100%;
font-family: 'poppins', sans-serif;
padding-left: 30px;
-webkit-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
.contact textarea {
background: #fff;
border: 1px solid #fff;
border-radius: 3px;
-webkit-box-shadow: none;
box-shadow: none;
color: #232434;
font-size: 16px;
padding: 10px;
width: 100%;
font-family: 'poppins', sans-serif;
padding-left: 30px;
-webkit-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
.contact input:focus {
background: #fff;
border: 1px solid #fff;
color: #232434;
-webkit-box-shadow: none;
box-shadow: none;
outline: 0 none;
}
.contact textarea:focus {
background: #fff;
border: 1px solid #fff;
color: #232434;
-webkit-box-shadow: none;
box-shadow: none;
outline: 0 none;
}
.form-control::placeholder {
color: #232434;
opacity: 1;
}
.btn-contact-bg {
border-radius: 30px;
color: #fff;
outline: medium none !important;
padding: 15px 27px;
text-transform: capitalize;
-webkit-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
background: #7564e5;
font-family: 'poppins', sans-serif;
cursor: pointer;
width: 100%;
}
.btn-contact-bg:hover,
.btn-contact-bg:focus {
background: #232434;
color: #fff;
}
/*START ADDRESS*/
.single_address {
overflow: hidden;
margin-bottom: 10px;
padding-left: 40px;
}
@media only screen and (max-width:768px) {
.single_address {
padding-left: 0px;
}
}
.single_address i {
background: #f6f6f6;
color: #7564e5;
border-radius: 30px;
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
float: left;
margin-right: 14px;
font-size: 22px;
-webkit-box-shadow: 0 5px 30px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 5px 30px 0 rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
-webkit-transition: all 0.3s ease 0s;
-o-transition: all 0.3s ease 0s;
transition: all 0.3s ease 0s;
}
.single_address:hover i {
background: #7564e5;
color: #fff;
}
.single_address h4 {
font-size: 18px;
margin-bottom: 0px;
overflow: hidden;
font-weight: 600;
}
.single_address p {
overflow: hidden;
margin-top: 5px;
}
.section-title h1 {
font-size: 44px;
font-weight: 500;
margin-top: 0;
position: relative;
text-transform: capitalize;
margin-bottom: 15px;
}
.section-title p {
padding: 0 10px;
width: 70%;
margin: auto;
letter-spacing: 1px;
}
.section-title {
margin-bottom: 60px;
}
.text-center {
text-align: center!important;
}
</style>
</head>
<body>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<div id="contact" class="contact-area section-padding">
<div class="container">
<div class="section-title text-center">
<h1>Help the organizers with your opinion</h1>
</div>
<div class="row">
<div class="col-lg-7">
<div class="contact">
<form class="form" name="enq" method="post" action="#" >
<div class="row">
<div class="form-group col-md-6">
<input type="text" name="pid" class="form-control" placeholder="Enter your Participant ID" required="required">
</div>
<div class="form-group col-md-6">
<input type="text" name="ppass" class="form-control" placeholder="Enter your Password" required="required">
</div>
<div class="form-group col-md-12">
<label for="rating">Your Rattings</label>
<select name="rating" id="rating">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
<div class="form-group col-md-12">
<textarea rows="6" name="comments" class="form-control" placeholder="Your opinion" required="required"></textarea>
</div>
<div class="col-md-12 text-center">
<button type="submit" value="Send message" name="submit" id="submitButton" class="btn btn-contact-bg" title="Submit!">Send Feedback</button>
</div>
</div>
</form>
<br> <br>
<section>
<?php
$query="SELECT concat(ParticipantFirstName,' ',ParticipantlastName) as name,Rating,Comments,date
FROM feedback_ JOIN participants on feedback_.Pid=participants.ParticipantID
where EventID = $eid";
$result= mysqli_query($conn, $query);
echo '<div class="container">
<div class="row">
<div class="col-sm-5 col-md-6 col-12 pb-4">
<h3>Others Comment</h3> <hr>';
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result)){
echo '<div class="comment mt-4 text-justify float-left">
<h4>'. $row['name'] .'</h4>
<span>- '. date('j F, y',strtotime($row['date'])) .'</span>
<br>';
for ($i = 1; $i <= 5; $i++) {
echo "<span class='star " . (($i <= $row['Rating']) ? 'filled' : '') . "'>★</span>";
}
echo '<p style="font-size: 20px;">'. $row['Comments'] .'</p>
<hr>
</div> ' ;
}
}
echo '</div>
</div>
</div>';
?>
</section>
</div>
</div>
<?php
if(isset($_POST['submit']))
{
$eid= $_GET['eid'];
$rating= $_POST['rating'];
$pid= $_POST['pid'];
$ppass= $_POST['ppass'];
$comments= $_POST['comments'];
$sql9 = "SELECT *
FROM participants
WHERE ParticipantID= $pid and pass='$ppass'";
$r9 = mysqli_query($conn, $sql9);
if(mysqli_num_rows($r9) == 0)
{
echo "<script>alert('Wrong Credentials Try Again!')</script>";
echo "<script>location.href='feedback.php?eid=". $eid ."'</script>";
}
else{
$sql2 = "SELECT *
FROM registration_
WHERE ParticipantID = $pid and EventID = $eid";
$r = mysqli_query($conn, $sql2);
if(mysqli_num_rows($r) == 0)
{
echo "<script>alert('Sorry we cant take your feedback')</script>";
echo "<script>location.href='home.php'</script>";
}
$sql1 = "SELECT *
FROM feedback_ JOIN participants
on feedback_.Pid=participants.ParticipantID
where feedback_.EventID=$eid and feedback_.Pid=$pid";
$result = mysqli_query($conn, $sql1);
if(mysqli_num_rows($result) > 0)
{
echo "<script>alert('You already gave your feedback')</script>";
echo "<script>location.href='home.php'</script>";
}
else{
$sql = "INSERT INTO `feedback_` (`Rating`, `Comments`, `EventID`, `Fid`, `Pid`,`date`) VALUES ('$rating', '$comments', '$eid', NULL, '$pid','$date');";
$res = mysqli_query($conn,$sql);
if($sql)
{
echo "<script>alert('Successfull')</script>";
echo "<script>location.href='home.php'</script>";
}
}
}
}
?>
<div class="col-lg-5">
<div class="single_address">
<i class="fa fa-map-marker" ></i>
<h4>Our Address</h4>
<p>United City, Madani Avenue, Badda, Dhaka 1212</p>
</div>
<?php
$address = 'UIU united city';
$address= str_replace(" ","+",$address);
?>
<iframe width="100%" height="500" src="https://maps.google.com/maps?q=<?php
echo $address; ?>&output=embed"></iframe>
<?php
?>
<div class="single_address">
<br>
<i class="fa fa-envelope"></i>
<h4>Send your message</h4>
<?php
$sql = "SELECT OrganizerContactNumber,OrganizerEmail FROM organizer join events on events.OrganizerID=organizer.OrganizerID where EventID=$eid";
$result = mysqli_query($conn, $sql);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result)){
echo '
<p><a href="#" class="__cf_email__" data-cfemail="e7ae898188a7829f868a978b82c984888a">'. $row["OrganizerEmail"] .'</a></p>
</div>
<div class="single_address">
<i class="fa fa-phone"></i>
<h4>Call us on</h4>
<p>'. $row["OrganizerContactNumber"] .'</p>';
}
}
?>
</div>
<div class="single_address">
<i class="fa fa-clock-o"></i>
<h4>Work Time</h4>
<p>Sat - Wed: 08.00 - 16.00. </p>
</div>
</div>
</div>
</div>
</div>
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
<script type="text/javascript">
</script>
</body>
</html>