-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
154 lines (124 loc) · 4.67 KB
/
users.php
File metadata and controls
154 lines (124 loc) · 4.67 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
$page_title = 'All User';
require_once('includes/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();
$groups = find_all('user_groups');
$count = 0;
?>
<?php include_once('layouts/header.php'); ?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<!-- Heading -->
<div class="panel-heading">
<div class="">
<img src="libs/logos/table-logo/user.png" alt="inventory-logo">
<span class="reportHeading">Users List</span>
</div>
<div class="">
<button class="btn btn-info pull-right btn-sm addNewGrp"> Add User</button>
</div>
</div>
<!-- Body -->
<div class="panel-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 50px;">#</th>
<th style="width: 25%;">Name </th>
<th style="width: 10%;">Username</th>
<th style="width: 10%;">User Role</th>
<th style="width: 10%;">Status</th>
<th style="width: 30%;">Last Login</th>
<th class="text-center" style="width:20%;">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach($all_users as $a_user): ?>
<tr>
<?php $count++; ?>
<td ><?php echo $count;?></td>
<td><?php echo remove_junk(ucwords($a_user['name']))?></td>
<td><?php echo remove_junk(ucwords($a_user['username']))?></td>
<td><?php echo remove_junk(ucwords($a_user['group_name']))?></td>
<td>
<?php if($a_user['status'] === '1'): ?>
<span class="active-indicator"><?php echo "Active"; ?></span>
<?php else: ?>
<span class="deactive-indicator"><?php echo "Deactive"; ?></span>
<?php endif;?>
</td>
<td><?php echo read_date($a_user['last_login'])?></td>
<td class="text-center">
<div class="btn-group edit-dlt-btn-group">
<a href="edit_user.php?id=<?php echo (int)$a_user['id'];?>" class="editBtn" data-toggle="tooltip" title="Edit">
<p>Edit <img src="libs/logos/table-logo/edit.png" alt="edit-logo"></p>
</a>
<a href="delete_user.php?id=<?php echo (int)$a_user['id'];?>" class="categoryDeleteBtn" data-toggle="tooltip" title="Remove">
<img src="libs/logos/table-logo/delete.png" alt="delete-logo">
</a>
</div>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- ADD -->
<div class="addNewgGroupPopUpWap display">
<div class="newgroupPopHeadWrap">
<div class="iconHeadGroup">
<img src="libs/logos/table-logo/inventory.png" alt="logo">
<div class="addPopGroupTitle">Add User Group</div>
</div>
<div class="addNewGroupContent">
<div class="addNewForm">
<form method="post" action="add_user.php">
<div class="inputGrup">
<label for="name">Full Name</label>
<input type="text" class="form-control" name="full-name" placeholder="Full Name">
</div>
<div class="inputGrup">
<label for="username">Username</label>
<input type="text" class="form-control" name="username" placeholder="Username">
</div>
<div class="inputGrup">
<label for="password">Password</label>
<input type="password" class="form-control" name ="password" placeholder="Password">
</div>
<div class="inputGrup">
<label for="level">User Role</label>
<select class="form-control" name="level">
<?php foreach ($groups as $group ):?>
<option value="<?php echo $group['group_level'];?>"><?php echo ucwords($group['group_name']);?></option>
<?php endforeach;?>
</select>
</div>
<div class="buttonGroup">
<div>
<div class="cancelBtn">
<button type="button">Cancel</button>
</div>
<div class="submitbtn">
<button type="submit" name="add_user" class="btn btn-primary">Add User</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<br>
<br>
<!-- Include User Group -->
<?php include_once('group.php'); ?>
<?php include_once('layouts/footer.php'); ?>