-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
38 lines (35 loc) · 1.34 KB
/
users.php
File metadata and controls
38 lines (35 loc) · 1.34 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
<?php
/******************************************************************************
* Name: Dean Lorenzo
* Student number: 0367298
* Course: Web Development - 2008 (228566)
* Assignment: Final Project
* Created: Nov 18, 2022
* Updated: Nov 18, 2022
* Purpose: Administrators access the dashboard to manage users and pages.
******************************************************************************/
require_once('header.php');
// if the user visits this page and isn't logged in, then redirect
if(!($usr_dat = CheckLogin($db)) && $usr_dat['admin'] != 1){
LoginRedirect();
}
$qry = "SELECT * FROM user ORDER BY first_name";
$stm = $db->prepare($qry);
$stm->execute();
?>
<h1>Manage users</h1>
<br />
<table>
<?php while($dat = $stm->fetch()): ?>
<ul>
<li class="tbl-li">[<?= $dat['first_name'] ?></li>
<li class="tbl-li"><?= $dat['last_name'] ?>]</li>
<li class="tbl-li">[<?= $dat['email'] ?>]</li>
<li class="tbl-li">[Username: <?= strtoupper($dat['username']) ?>]</li>
<li class="tbl-li">[Active: <?= $dat['active'] ?>]</li>
<li class="tbl-li">
<a href="user_edit.php?userid=<?= $dat['userid']?>">EDIT</a></li>
</ul>
<?php endwhile ?>
</table>
<?php require_once('footer.php');