This repository has been archived by the owner on Apr 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
users.php
81 lines (73 loc) · 2.63 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
80
81
<?PHP
require 'includes/master.inc.php';
$Auth->requireAdmin('login.php');
$db = Database::getDatabase();
if(isset($_GET['q']))
{
$q = $_GET['q'];
$_q = $db->escape($q);
$search_sql = " AND (username LIKE '%$_q%' OR email LIKE '%$_q%') ";
}
else
{
$q = '';
$search_sql = '';
}
$users = DBObject::glob('User', "SELECT * FROM shine_users WHERE 1 = 1 $search_sql ORDER BY username");
?>
<?PHP include('inc/header.inc.php'); ?>
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div class="block tabs spaces">
<div class="hd">
<ul>
<li class="active"><a href="users.php">Users</a></li>
<li><a href="user-new.php">Create new user</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="bd">
<table>
<thead>
<tr>
<td>Username</td>
<td>Level</td>
<td>Email</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<?PHP foreach($users as $u) : ?>
<tr>
<td><?PHP echo $u->username; ?></td>
<td><?PHP echo $u->level; ?></td>
<td><?PHP echo $u->email; ?></td>
<td>
<a href="user-edit.php?id=<?PHP echo $u->id; ?>">Edit</a>
<a href="user-edit.php?id=<?PHP echo $u->id; ?>&action=delete" onclick="return confirm('Are you sure?');">Delete</a>
</td>
</tr>
<?PHP endforeach; ?>
</tbody>
</table>
</div>
</div>
</div></div>
</div>
<div id="sidebar" class="yui-b">
<div class="block">
<div class="hd">
Search Users
</div>
<div class="bd">
<form action="users.php" method="get">
<p><input type="text" name="q" value="<?PHP echo @$q; ?>" id="q" class="text">
<span class="info">Searches Username and Email address.</span></p>
<p><input type="submit" name="btnSearch" value="Search" id="btnSearch"></p>
</form>
</div>
</div>
</div>
</div>
<?PHP include('inc/footer.inc.php'); ?>