Skip to content
Permalink
Newer
Older
100644 73 lines (66 sloc) 2.64 KB
1
<?php
2
defined('APP_DIR') or define('APP_DIR', __DIR__ . '/../app/');
3
include_once(APP_DIR . 'model/User.php');
4
include_once(APP_DIR . 'include/http.php');
5
6
$data = User::authenticated();
7
if (!$data || $data->access != 'admin') {
8
Http::redirect('index.php');
9
}
10
11
$users = User::all();
12
13
include 'template/header.html';
14
include 'template/user_menu_button.php';
15
?>
16
17
<div class="row admin-container">
18
<div class="col l8 m10 s12 offset-l2 offset-m1">
19
<div class="row">
20
<div class="col s12">
21
<h1> Users </h1>
22
</div>
23
</div>
24
<?php foreach ($users as $user) { ?>
25
<div class="row card-panel scale-transition scale-out user-tile">
26
<div class="col s3 blue-text valign-wrapper">
27
<i class="small material-icons">perm_identity</i>
28
<span class="valign username"> <?php echo $user->username ?> </span>
29
</div>
30
<div class="col s5 red-text valign-wrapper">
31
<i class="small material-icons">verified_user</i>
32
<span class="valign access_level">Access level: <?php echo $user->access ?> </span>
33
</div>
34
<div class="col s2">
35
<a
36
class="modal-trigger btn tooltipped waves-effect waves-light"
37
data-position="bottom" data-delay="50" data-tooltip="Edit"
38
href="#edit-modal-<?php echo $user->id ?>"
39
>
40
<i class="small material-icons">mode_edit</i>
41
</a>
42
</div>
43
<div class="col s2">
44
<form action="delete.php" method="post">
45
<button
46
type="submit" class="btn tooltipped waves-effect waves-light"
47
data-position="bottom" data-delay="50" data-tooltip="Delete"
48
onclick="Materialize.toast('User deleted', 4000)"
49
>
50
<i class="small material-icons">delete</i>
51
<input name="username" value="<?php echo $user->username ?>" />
52
</button>
53
</form>
54
</div>
55
</div>
56
<?php } ?>
57
</div>
58
</div>
59
60
<div class="fixed-action-btn">
61
<a class="modal-trigger btn-floating btn-large red" href="#create-modal">
62
<i class="large material-icons waves-effect waves-light">add</i>
63
</a>
64
</div>
65
66
<?php
67
68
foreach ($users as $user) {
69
include(APP_DIR . 'forms/edit.php');
70
}
71
include(APP_DIR . 'forms/create.php');
72
include 'template/footer.html';
73
?>
You can’t perform that action at this time.