-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
45 lines (40 loc) · 1.22 KB
/
index.php
File metadata and controls
45 lines (40 loc) · 1.22 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
<?php
require "db.php";
require "functions.php";
require "header.php";
$users = getUsers($sql);
?>
<h1>Users administration </h1>
<a class="action" href="user_add.php">Add user</a>
<br><br>
<table>
<tr>
<th>Avatar</th>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Active</th>
<th>Actions</th>
</tr>
<?php foreach($users as $user): ?>
<tr>
<td>
<img class="avatar" src="uploads/<?=$user["avatar"]?>">
</td>
<td><?=$user["name"]?>
<td><?=$user["email"]?>
<td><?=$user["role_name"]?>
<td>
<?php if($user["is_active"] == 1): ?>
YES
<?php else: ?>
NO
<?php endif; ?>
</td>
<td>
<a class="action" href="user_edit.php?id=<?=$user["id"]?>">Edit</a>
<a class="action danger" href="user_delete.php?id=<?=$user["id"]?>">Delete</a>
</td >
</tr>
<?php endforeach; ?>
</table>