forked from howest-wsde/owaes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.users.php
97 lines (81 loc) · 4.08 KB
/
admin.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include "inc.default.php"; // should be included in EVERY file
$oSecurity = new security(TRUE);
if (!$oSecurity->admin()) stop("admin");
$oPage->addJS("script/admin.js");
$oPage->addCSS("style/admin.css");
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
echo $oPage->getHeader();
?>
</head>
<body id="index">
<?php echo $oPage->startTabs(); ?>
<div class="body">
<div class="container">
<div class="row">
<?php
echo $oSecurity->me()->html("user.html");
?>
</div>
<div class="main market admin-users">
<?php include "admin.menu.xml"; ?>
<!-- <h1>Users: </h1> -->
<table class="editable">
<tr>
<th class="order">first name</th>
<th class="order">last name</th>
<th class="order">alias</th>
<th class="order">login</th>
</tr>
<?php
$oUsers = new userList();
$itemsPerPage = 10;
$pages = array_chunk($oUsers->getList(), $itemsPerPage);
if (isset($_GET['showpage'])){
$pageKey = (int)$_GET['showpage'];
}else{$pageKey = 0;}
if($pageKey >= count($pages)){
$pageKey = count($pages)-1;
}
foreach ($pages[$pageKey] as $oUser) {
echo "<tr>";
echo "<td id=\"tblUsers_" . $oUser->id() . "_firstname\">" . $oUser->firstname() . "</td>";
echo "<td id=\"tblUsers_" . $oUser->id() . "_lastname\">" . $oUser->lastname() . "</td>";
echo "<td id=\"tblUsers_" . $oUser->id() . "_alias\">" . $oUser->alias() . "</td>";
echo "<td id=\"tblUsers_" . $oUser->id() . "_login\">" . $oUser->login() . "</td>";
echo "</tr>";
}
?>
</table>
<?php
echo("<div class='links'>");
if($pageKey > 0){
$prevPage = $pageKey -1;
echo("<a href='admin.users.php?showpage=$prevPage'>BACK</a>");
}
for($i=1; $i< count($pages)+1; $i++):
$j = $i-1;
if($pageKey + 1 == $i){
echo("<span>".$i."</span>");
}else{
echo("<a href='admin.users.php?showpage=$j'> $i</a>");
}
endfor;
if($pageKey < (count($pages)-1)){
$nextPage = $pageKey +1;
echo("<a href='admin.users.php?showpage=$nextPage'>NEXT</a>");
}
echo("</div>");
?>
</div>
</div>
<?php echo $oPage->endTabs(); ?>
</div>
<div class="footer">
<?php echo $oPage->footer(); ?>
</div>
</body>
</html>