-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdashboard.php
More file actions
215 lines (178 loc) · 6.46 KB
/
dashboard.php
File metadata and controls
215 lines (178 loc) · 6.46 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
<?php
include "server.php";
include "connect.php";
//include "dummy.php"
//include "index.php"
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<link rel="stylesheet" href="dashboard.css" >
<link rel="stylesheet" type="text/css" href="admin.css">
</head>
<body>
<div class="header">
<div class="left" >
<div><a href="index.php" style="text-decoration: none;">
<span style="color:#001242 ;">WASH</span><span style="color:#001242 ;">.</span><span style="color:#001242;">IT</span>
</div></a>
</div>
<div class="out">
<a href="landingpage.php? logout='1'" style="color: red;">logout</a>
</div>
</div>
<input type="checkbox" id = "openSidebarMenu">
<label for="openSidebarMenu" class = "SidebarIconToggle">
<div class="spinner top"></div>
<div class="spinner middle"></div>
<div class="spinner bottom"></div>
</label>
<div id = "sidebarMenu">
<ul class="menu">
<li><a href="index.php">Home</a></li>
<li><a href="services.php">Services</a></li>
<li><a href="feedback.php">Feedback</a></li>
<li><a href="order.php">Order</a></li>
<li><a href="about.php">About</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
<div class="right">
<?php
$sql = "SELECT firstName FROM member WHERE member.firstName = '$_SESSION[firstName]'";
$result = mysqli_query($db, $sql);
$row = $result->fetch_assoc();
echo "Username: " . $row["firstName"]. "<br>";
$sql1 = "SELECT mobileNo FROM member WHERE member.firstName = '$_SESSION[firstName]'";
$result1 = mysqli_query($db, $sql1);
$row1 = $result1->fetch_assoc();
echo "MobileNo.: " . $row1["mobileNo"]. "<br>";
$sql2 = "SELECT email FROM member WHERE member.firstName = '$_SESSION[firstName]'";
$result2 = mysqli_query($db, $sql2);
$row2 = $result2->fetch_assoc();
echo "Email: " . $row2["email"]. "<br>";
$sql3 = "SELECT SID FROM member WHERE member.firstName = '$_SESSION[firstName]'";
$result3 = mysqli_query($db, $sql3);
$row3 = $result3->fetch_assoc();
echo "Student ID: " . $row3["SID"]. "<br>";
$sql4 = "SELECT memberID FROM member WHERE member.firstName = '$_SESSION[firstName]'";
$result4 = mysqli_query($db, $sql4);
$row4 = $result4->fetch_assoc();
echo "Member ID: " . $row4["memberID"]. "<br>";
$db->close();
?>
<!-- <a href="editinfo.php">Edit Info</a> -->
<!-- <a href="index.php" style="color: blue;">Go back</a> -->
<img src="IUT.png" alt="A description of the image" width="200" height="400">
</div>
<br>
<div class="edit">
<center>
<button class="staff">
<a href="editinfo.php" ><h1>Edit Info</h1></a>
</button>
</center>
</div>
<div class="row">
<div class="content">
<div class="boxWrapper">
<center>
<h1 >My Orders-</h1>
</center>
<div class="">
<table>
<col width="5%">
<col width="5%">
<col width="5%">
<col width="20%">
<col width="15%">
<col width="5%">
<col width="10%">
<col width="10%">
<col width="5%">
<col width="5%">
<tr>
<th>Service ID</th>
<th>Member ID</th>
<th>Member Name</th>
<th>Date In</th>
<th>Date Out</th>
<th>Service status</th>
<th>Total price</th>
</tr>
<?php
$q="SELECT *,`firstName` FROM `laundryservice`,`member` where laundryservice.memberId = '$row4[memberID]' AND member.memberId = '$row4[memberID]' AND laundryservice.serviceStatus = 'NF' ORDER BY `serviceId`";
$result=$mysqli->query($q);
if(!$result){
echo "Select failed. Error: ".$mysqli->error ;
}
while($row=$result->fetch_array()){ ?>
<?php
$dashDateOut="";
if ($row['dateOut']=="0000-00-00") {
$dashDateOut="-";
}
else {
$dashDateOut=$row['dateOut'];
}
$finishStatus="";
if($row['serviceStatus']=="NF"){
$finishStatus="Not finish";
}
else {
$finishStatus="Pending";
}
?>
<tr>
<td><?=$row['serviceId']?></td>
<td><?=$row['memberId']?></td>
<td><?=$row['firstName']?></td>
<td><?=$row['dateIn']?></td>
<td><?=$dashDateOut?></td>
<td><?=$finishStatus?></td>
<td><?=$row['totalPrice']?></td>
</tr>
<?php } ?>
<?php
$q1="SELECT *,`firstName` FROM `laundryservice`,`member` where laundryservice.memberId = '$row4[memberID]' AND member.memberId = '$row4[memberID]' AND laundryservice.serviceStatus = 'P' ORDER BY `serviceId`";
$result1=$mysqli->query($q1);
if(!$result1){
echo "Select failed. Error: ".$mysqli->error ;
}
while($row=$result1->fetch_array()){ ?>
<?php
$dashDateOut="";
if ($row['dateOut']=="0000-00-00") {
$dashDateOut="-";
}
else {
$dashDateOut=$row['dateOut'];
}
$finishStatus="";
if($row['serviceStatus']=="NF"){
$finishStatus="Not finish";
}
else {
$finishStatus="Pending";
}
?>
<tr>
<td><?=$row['serviceId']?></td>
<td><?=$row['memberId']?></td>
<td><?=$row['firstName']?></td>
<td><?=$row['dateIn']?></td>
<td><?=$dashDateOut?></td>
<td><?=$finishStatus?></td>
<td><?=$row['totalPrice']?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</body>
</html>