-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinquiries.php
More file actions
144 lines (123 loc) · 3.15 KB
/
Copy pathinquiries.php
File metadata and controls
144 lines (123 loc) · 3.15 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
<!DOCTYPE html>
<?php
session_start();
include('adminbar.php');
include('db.php');
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
header("Location: login.php");
exit();
}
// Check if the user is not logged in, redirect to the login page
if (!isset($_SESSION['username'])) {
header("Location: index.php");
exit();
}
$username = $_SESSION['username'];
// Fetch user data from the database
$query = mysqli_query($conn, "SELECT * FROM users WHERE username='$username'");
$userData = mysqli_fetch_assoc($query);
$query1 = mysqli_query($conn, "SELECT * FROM feedback");
// Check if the query was successful
if ($query1) {
// Fetch data
$userData1 = mysqli_fetch_assoc($query1);
// Display the table
} else {
// Display an error message if the query fails
echo "Error: " . mysqli_error($conn);
}
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Laundry Management System - Admin Profile</title>
<style>
body {
margin-left: 11%;
}
label {
font-size: 2em;
font-family: Arial, Helvetica, sans-serif;
margin-top: 5%;
margin-bottom: 5%;
}
.profile-info {
text-align: left;
margin-top: 8%;
transform: translate(-300%, -10%);
display: flex;
flex-direction: column;
align-items: flex-start;
}
.profile-info h1 {
font-size: 24px;
font-weight: bold;
margin-bottom: 5%;
}
.profile-info label {
font-size: 18px;
font-weight: bold;
margin-bottom: 5px;
}
.profile-info p {
font-size: 16px;
margin: 0;
}
.guff h1 {
font-size: 4em;
font-weight: lighter;
}
.line {
height: 1px;
max-width: 900px;
color: grey;
opacity: 20%;
margin-top: 0.5%;
}
table {
margin-left: 300px;
/* margin-top: -10%; */
}
th, td {
border: 1px solid black;
padding: 10px;
text-align: left;
}
.box
{
margin-top: 5%;
}
</style>
</head>
<body>
<div class="box">
<table>
<table>
<thead>
<tr>
<th>Email</th>
<th>Feedback</th>
</tr>
</thead>
<tbody>
<?php
// Check if there are records
if ($userData1) {
do {
?>
<tr>
<td><?php echo $userData1['email']; ?></td>
<td><?php echo $userData1['feedback']; ?></td>
</tr>
<?php
} while ($userData1 = mysqli_fetch_assoc($query1));
} else {
echo "<tr><td colspan='2'>No records found</td></tr>";
}
?>
</tbody>
</table>
</div>
</body>
</html>