-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-page.php
More file actions
63 lines (55 loc) · 1.23 KB
/
Copy pathadmin-page.php
File metadata and controls
63 lines (55 loc) · 1.23 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
<?php
/**
* This page will display all transactions in the checkbook
*
* Details about this page can go here...
*
* @author Donovan Goldston
*/
session_start();
// now to check if variable is true
if(!$_SESSION['user_role'] == 'admin')
{
header('location:login.php');
}
require_once('config.php');
require_once("includes/models/User.php");
require_once('includes/dataaccess/UserDataAccess.php');
$da = new UserDataAccess($conn);
$users = $da->get_all_users();
//shows title page name
$page_title = "Admin Page";
require_once("includes/header.inc.php");
echo('Hello: ');
echo $_SESSION['user_display_name'];
echo("<br><br>");
?>
<!-- makes the table for admin page-->
<table border="1">
<thead>
<th>User Name</th>
<th>Email address</th>
<th>User Status</th>
<th>Active Account</th>
</thead>
<tbody>
<?php
if(!empty($users)){
foreach ($users as $u) {
echo("<tr>");
echo("<td>" . $u->user_display_name . "</td>");
echo("<td>" . $u->user_email . "</td>");
echo("<td>" . $u->user_role . "</td>");
echo("<td>" . $u->user_active . "</td>");
echo("</tr>");
}
}else{
echo("<tr><td colspan='4' align='center'>NO USERS</td></tr>");
}
?>
</tbody>
</table>
<br><br>
<?php
require_once("includes/footer.inc.php");
?>