-
Notifications
You must be signed in to change notification settings - Fork 0
/
created.php
184 lines (152 loc) · 5.36 KB
/
created.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Bootstrap CDN CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!--Boostrap CDN JQUERY -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!--Boostrap CDN popper -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<title>Pending Requests Page</title>
</head>
<body>
<header>
<!-- ======================= For Pending Requests ============================ -->
<main role="main">
<section class="jumbotron text-center">
<div class="container">
<center>
<?php
$query = "select * from `requests`;";
if(count(fetchAll($query))>0){
foreach(fetchAll($query) as $row){
if($row['status']== 'created'){
// echo "<tr>";
// echo "<td style='border=1px solid black'>".$row['id']."</td>";
// echo "<td>".$row['username']."</td>";
// echo "<td>".$row['email']."</td>";
// echo "<td>".$row['status']."</td>";
// echo "</tr>";
?>
<center>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Username</th>
<th scope="col">Email</th>
<th scope="col">Date</th>
<th scope="col">Status</th>
<th scope="col">Accept</th>
<th scope="col">Reject</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><?php echo $row['id'] ?></th>
<td><?php echo $row['username'] ?></td>
<td><?php echo $row['email'] ?></td>
<td><small><i><?php echo $row['date'] ?></i></small></td>
<td><button class="btn btn-secondary my-2">Pending</button></td>
<td><a href="accept.php?id=<?php echo $row['id'] ?>" class="btn btn-primary my-2">Accept</a></td>
<td><a href="reject.php?id=<?php echo $row['id'] ?>" class="btn btn-danger my-2">Reject</a></td>
</tr>
</tbody>
</table>
</center>
<?php
}
}
// echo "</tbody></table>";
}else{
echo "No Pending Requests.";
}
?>
<!-- ==================== //Accepeted Requests page =============================-->
<?php
$query = "select * from `requests`;";
if(count(fetchAll($query))>0){
foreach(fetchAll($query) as $row){
if($row['status']== 'accepted'){
?>
<center>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Username</th>
<th scope="col">Email</th>
<th scope="col">Date</th>
<th scope="col">Status</th>
<th scope="col">Accept</th>
<th scope="col">Reject</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><?php echo $row['id'] ?></th>
<td><?php echo $row['username'] ?></td>
<td><?php echo $row['email'] ?></td>
<td><small><i><?php echo $row['date'] ?></i></small></td>
<td><button class="btn btn-success my-2"><?php echo $row['status']?></button></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</center>
<?php
}
}
}else{
echo "No Pending Requests.";
}
?>
<!-- =========================== Rejected Requests Page ====================== -->
<?php
$query = "select * from `requests`;";
if(count(fetchAll($query))>0){
foreach(fetchAll($query) as $row){
if($row['status']== 'rejected'){
?>
<center>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Username</th>
<th scope="col">Email</th>
<th scope="col">Date</th>
<th scope="col">Status</th>
<th scope="col">Accept</th>
<th scope="col">Reject</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><?php echo $row['id'] ?></th>
<td><?php echo $row['username'] ?></td>
<td><?php echo $row['email'] ?></td>
<td><small><i><?php echo $row['date'] ?></i></small></td>
<td><button class="btn btn-danger my-2"><?php echo $row['status']?></button></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</center>
<?php
}
}
}else{
echo "No Pending Requests.";
}
?>
</div>
</section>
</main>
</body>
</html>