-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathallUsers.php
executable file
·79 lines (70 loc) · 2.13 KB
/
allUsers.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
require_once ("include/superHead.php");
require_once ("conf/conf.php");
$phpExMessage="";
require_once ("include/mysql_connect.php");
function getAllUsers() {
global $mysql;
$all_users = array();
$query="select * from user where userType >= 1 and userGroup = " . MyUserGroupID;
$result = $mysql->query($query);
if(!$result) echo "Could not get index list.<br/>\n";
else
{
while($row = $result->fetch_row())
{
$userID = $row[0];
$loginName = $row[1];
$firstName = $row[4];
$lastName = $row[5];
$all_users[] = array($userID, $loginName, $firstName, $lastName);
}
}
$result->free();
return $all_users;
}
?>
<!DOCTYPE html>
<html>
<head>
<?php include("include/leaderBoardHeader.php"); ?>
</head>
<body onload="sh_highlightDocument();">
<?php //session_start();
if(!isset($_SESSION['user'])){
echo "This toolkit is only for register users, please <a href=\"login.php\">Login</a><br/>\n";
header('Location: login.php');
}
?>
<div class="container">
<table class="table table-bordered table-hover" style="text-align:center;">
<thead>
<tr>
<th>userID</th>
<th>loginID</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<?php
$allUsers = getAllUsers();
foreach ($allUsers as $user) {
echo "<tr>";
$idx = 0;
foreach ($user as $v) {
if ($idx == 0) {
echo "<td><a href='uid.php?uid=$v'>$v</a></td>";
} else {
echo "<td>$v</td>";
}
$idx++;
}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</body>
</html>