-
Notifications
You must be signed in to change notification settings - Fork 1
/
users.php
79 lines (77 loc) · 2.81 KB
/
users.php
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
$page_title = 'Lista de usuarios';
require_once('include/load.php');
?>
<?php
// Checkin What level user has permission to view this page
page_require_level(1);
//pull out all user form database
$all_users = find_all_user();
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-12">
<?php echo display_msg($msg); ?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<strong>
<i class="glyphicon glyphicon-user"></i>
<span>Usuarios</span>
</strong>
<a href="add_user.php" class="btn btn-info pull-right">Agregar usuario</a>
</div>
<div class="panel-body">
<table class="table table-striped" id="tbl-users">
<thead>
<tr>
<th class="text-center" style="width: 50px;"></th>
<th>Nombre </th>
<th>Usuario</th>
<th class="text-center" style="width: 15%;">Rol de usuario</th>
<th class="text-center" style="width: 10%;">Estado</th>
<th style="width: 20%;">Último login</th>
<th class="text-center" style="width: 100px;">Acciones</th>
</tr>
</thead>
<tbody>
<?php foreach($all_users as $a_user): ?>
<tr>
<td class="text-center"><?php echo count_id();?></td>
<td><?php echo remove_junk($a_user['name'])?></td>
<td><?php echo remove_junk($a_user['username'])?></td>
<td class="text-center"><?php echo remove_junk(ucwords($a_user['group_name']))?></td>
<td class="text-center">
<?php if($a_user['status'] === '1'): ?>
<span class="label label-success"><?php echo "Activo"; ?></span>
<?php else: ?>
<span class="label label-danger"><?php echo "Inactivo"; ?></span>
<?php endif;?>
</td>
<td><?php echo read_date($a_user['last_login'])?></td>
<td class="text-center">
<div class="btn-group">
<a href="edit_user.php?id=<?php echo (int)$a_user['id'];?>" data-toggle="tooltip" data-placement="left" title="Editar">
<i class="glyphicon glyphicon-pencil"></i>
</a>
<a href="delete_user.php?id=<?php echo (int)$a_user['id'];?>" data-toggle="tooltip" data-placement="left" title="Eliminar">
<i class="glyphicon glyphicon-trash"></i>
</a>
</div>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- DataTable (only for more than 10 items)-->
<?php if (count_id() > 10): ?>
<script type="text/javascript" src="lib/js/users.js"></script>
<?php endif; ?>
<?php include_once('layouts/footer.php'); ?>