-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.php
66 lines (53 loc) · 2.11 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
<?php
// header file
require('./templates/header.php');
$received = false;
if (isset($_POST['submit']))
{
$id = uniqid();
$title = mysqli_escape_string($conn, $_POST['title']);
$content = mysqli_escape_string($conn, $_POST['content']);
$sql = "INSERT INTO feedback(id, title, content) VALUES('$id', '$title', '$content')";
if (!mysqli_query($conn, $sql))
{
echo "Error: ".mysqli_error($conn);
}
else
{
$received = true;
}
}
?>
<div class="container my-5" ng-controller="reportProblemController">
<div ng-hide="received" class="row">
<h1 class="display-1 text-primary my-3">Feedback</h1>
<form action="feedback.php" method="POST">
<div class="mb-3 form-floating col-10">
<input type="text" placeholder="Subject" name="title" id="title" maxlength="220" class="form-control" required>
<label for="title">Subject</label>
</div>
<div class="mb-3 form-floating col-10">
<textarea placeholder="Your feedback" name="content" class="form-control" id="content" maxlength="1000" style="height: 150px; resize: none;" required></textarea>
<label for="content">Your feedback</label>
</div>
<div class="mb-3">
<input type="submit" name="submit" value="Done" class="col-auto btn btn-lg btn-outline-success">
</div>
<small class="text-muted">Your feedback is anonymous</small>
</form>
</div>
<div ng-show="received" class="my-5 py-5 row justify-content-center">
<div class="display-4 col-auto text-primary my-5 py-5">Thank you for your valuable time!</div>
<div class="col-12"></div>
<p class="lead col-auto text-muted">We will look into your feedback soon.</p>
</div>
</div>
<script>
catglueQuiz.controller('reportProblemController', $scope => {
$scope.received = <?php echo $received ? 'true' : 'false'; ?>;
})
</script>
<?php
// footer file
require('./templates/footer.php');
?>