-
Notifications
You must be signed in to change notification settings - Fork 0
/
suggestions.php
114 lines (106 loc) · 3.58 KB
/
suggestions.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
<?php
session_start();
if (!isset($_SESSION['username'])) {
header("Location: alogin.php");
}
if (isset($_GET['logout'])) {
unset($_SESSION['username']);
session_destroy();
header("Location: alogin.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Suggestions - Housekeeper Admin Dashboard</title>
<?php require("meta.php"); ?>
</head>
<body>
<!-- Side Navigation -->
<?php require("allotsidenav.php"); ?>
<!-- Main content -->
<div class="main-content">
<!-- Header -->
<div class="header bg-background pb-6 pt-5 pt-md-6">
<div class="container-fluid">
<?php require("allotheader.php"); ?>
</div>
</div>
<!-- Page content -->
<div class="container-fluid mt--5">
<div class="row mt-2 pb-5">
<div class="col-xl-12 mb-5 mb-xl-0">
<div class="card shadow">
<div class="card-header border-0">
<div class="row align-items-center">
<div class="col">
<h3 class="mb-0">Suggestions Record</h3>
</div>
</div>
</div>
<div class="table-responsive">
<!-- Projects table -->
<table class="table align-items-center table-flush">
<thead class="thead-light">
<tr>
<th scope="col">Housekeeper</th>
<th scope="col">Room</th>
<th scope="col">Date</th>
<th colspan="3">Suggestions</th>
</tr>
</thead>
<tbody>
<?php
$info = getSuggestions($_SESSION['username'], $db);
if (mysqli_num_rows($info) > 0) {
while ($row = mysqli_fetch_assoc($info)) {
?>
<tr>
<th scope="row">
<?php
$numstars = $row['rating'];
$str = "";
for ($i = 0; $i < $numstars; $i++) {
if ($i == 0)
$str .= "<i class='fas fa-star fa-xs' style='color:#f1c40f'></i>";
else
$str .= "<i class='ml-1 fas fa-star fa-xs' style='color:#f1c40f'></i>";
}
echo $row['name'] . "<br>" . $str;
?>
</th>
<td>
<?php
echo strtoupper($row['room']);
?>
</td>
<td>
<?php
echo $row['date'];
?>
</td>
<td colspan="3" style="height: 80px; overflow-y:auto">
<?php
echo $row['suggestion'];
?>
</td>
</tr>
<?php
}
} else {
echo "<tr><td colspan='6' style='text-align:center'>No suggestions found.</td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="assets/vendor/jquery/dist/jquery.min.js"></script>
<script src="assets/vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/argon.min.js"></script>
</body>
</html>