-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.php
90 lines (74 loc) · 2.09 KB
/
feedback.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
<?php
include("header.php");
include('connection.php');
?>
<style>
.rating {
display: inline-block;
}
.rating input {
display: none;
}
.rating label {
color: #ccc;
font-size: 40px;
padding: 5px;
float: right;
transition: color 0.2s ease-in-out;
}
.rating input:checked ~ label {
color: #ffc107;
}
.rating label:hover {
cursor: pointer;
color: #ffc107;
}
</style>
<a href="logout.php">a</a>
<!-- Service Start -->
<div class="container-fluid py-5">
<div class="container pt-5 pb-3">
<div class="text-center mb-3 pb-3">
<h1>Feedback</h1>
</div>
<div class="row">
<div class="card-body rounded-bottom bg-white p-5">
<form method="POST" enctype="multipart/form-data">
<div class="form-group">
<textarea class="form-control p-4" name="feedback" placeholder="Enter Your Feedback" required></textarea>
</div>
<label>User Rating</label> <br>
<div class="rating">
<input type="radio" name="rating" value="5" id="5"><label for="5">★</label>
<input type="radio" name="rating" value="4" id="4"><label for="4">★</label>
<input type="radio" name="rating" value="3" id="3"><label for="3">★</label>
<input type="radio" name="rating" value="2" id="2"><label for="2">★</label>
<input type="radio" name="rating" value="1" id="1"><label for="1">★</label>
</div>
<div>
<input class="btn btn-primary btn-block py-3" type="submit" name="submit1" value="Submit">
</div>
</form>
</div>
</div>
<?php
if(isset($_POST['submit1']))
{
$feedback = $_POST['feedback'];
$rating = $_POST['rating'];
$date=date('Y-m-d');
$sql = "INSERT INTO `feedback`(`user_id`, `rating`, `review`, `date`) VALUES ('$_SESSION[uid]',
'$rating','$feedback', '$date')";
//echo $upd;
mysqli_query($con,$sql);
echo '<script>alert("Success!")
window.location="feedback.php";
</script>';
}
?>
</div>
</div>
<!-- Service End -->
<?php
include("footer.php");
?>