Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (66 sloc) 2.64 KB
<?php
defined('APP_DIR') or define('APP_DIR', __DIR__ . '/../app/');
include_once(APP_DIR . 'model/User.php');
include_once(APP_DIR . 'include/http.php');
$data = User::authenticated();
if (!$data || $data->access != 'admin') {
Http::redirect('index.php');
}
$users = User::all();
include 'template/header.html';
include 'template/user_menu_button.php';
?>
<div class="row admin-container">
<div class="col l8 m10 s12 offset-l2 offset-m1">
<div class="row">
<div class="col s12">
<h1> Users </h1>
</div>
</div>
<?php foreach ($users as $user) { ?>
<div class="row card-panel scale-transition scale-out user-tile">
<div class="col s3 blue-text valign-wrapper">
<i class="small material-icons">perm_identity</i>
<span class="valign username"> <?php echo $user->username ?> </span>
</div>
<div class="col s5 red-text valign-wrapper">
<i class="small material-icons">verified_user</i>
<span class="valign access_level">Access level: <?php echo $user->access ?> </span>
</div>
<div class="col s2">
<a
class="modal-trigger btn tooltipped waves-effect waves-light"
data-position="bottom" data-delay="50" data-tooltip="Edit"
href="#edit-modal-<?php echo $user->id ?>"
>
<i class="small material-icons">mode_edit</i>
</a>
</div>
<div class="col s2">
<form action="delete.php" method="post">
<button
type="submit" class="btn tooltipped waves-effect waves-light"
data-position="bottom" data-delay="50" data-tooltip="Delete"
onclick="Materialize.toast('User deleted', 4000)"
>
<i class="small material-icons">delete</i>
<input name="username" value="<?php echo $user->username ?>" />
</button>
</form>
</div>
</div>
<?php } ?>
</div>
</div>
<div class="fixed-action-btn">
<a class="modal-trigger btn-floating btn-large red" href="#create-modal">
<i class="large material-icons waves-effect waves-light">add</i>
</a>
</div>
<?php
foreach ($users as $user) {
include(APP_DIR . 'forms/edit.php');
}
include(APP_DIR . 'forms/create.php');
include 'template/footer.html';
?>
You can’t perform that action at this time.