summaryrefslogtreecommitdiffstats
path: root/frontends/php/users.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 10:20:29 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-12 10:20:29 +0000
commitc0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (patch)
tree43b9a3f70cc15cfcc674fafbd0c8a3829417331e /frontends/php/users.php
parentd7d135227396a5b3cede974e94c25032a1bc69d2 (diff)
downloadzabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.gz
zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.xz
zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.zip
- [DEV-66] added sorting to screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4996 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/users.php')
-rw-r--r--frontends/php/users.php34
1 files changed, 21 insertions, 13 deletions
diff --git a/frontends/php/users.php b/frontends/php/users.php
index db4be063..4a780502 100644
--- a/frontends/php/users.php
+++ b/frontends/php/users.php
@@ -114,7 +114,7 @@ include_once "include/page_header.php";
check_fields($fields);
-
+ validate_sort_and_sortorder();
?>
<?php
if($_REQUEST["config"]==0)
@@ -379,13 +379,18 @@ include_once "include/page_header.php";
$table->setHeader(array(
array( new CCheckBox("all_users",NULL,
"CheckAll('".$form->GetName()."','all_users');"),
- S_ALIAS
+ make_sorting_link(S_ALIAS,'u.alias')
),
- S_NAME,S_SURNAME,S_USER_TYPE,S_GROUPS,S_IS_ONLINE_Q));
+ make_sorting_link(S_NAME,'u.name'),
+ make_sorting_link(S_SURNAME,'u.surname'),
+ make_sorting_link(S_USER_TYPE,'u.type'),
+ S_GROUPS,
+ S_IS_ONLINE_Q));
- $db_users=DBselect("select userid,alias,name,surname,type,autologout ".
- ' from users where '.DBin_node('userid').
- " order by alias");
+ $db_users=DBselect('SELECT u.userid,u.alias,u.name,u.surname,u.type,u.autologout '.
+ ' FROM users u'.
+ ' WHERE '.DBin_node('u.userid').
+ order_by('u.alias,u.name,u.surname,u.type','u.userid'));
while($db_user=DBfetch($db_users))
{
$db_sessions = DBselect('select count(*) as count, max(s.lastaccess) as lastaccess'.
@@ -442,19 +447,22 @@ include_once "include/page_header.php";
$table->setHeader(array(
array( new CCheckBox("all_groups",NULL,
"CheckAll('".$form->GetName()."','all_groups');"),
- S_NAME),
+ make_sorting_link(S_NAME,'ug.name')),
S_MEMBERS));
- $result=DBselect("select usrgrpid,name from usrgrp".
- ' where '.DBin_node('usrgrpid').
- " order by name");
+ $result=DBselect('SELECT ug.usrgrpid, ug.name '.
+ ' FROM usrgrp ug'.
+ ' WHERE '.DBin_node('ug.usrgrpid').
+ order_by('ug.name'));
while($row=DBfetch($result))
{
$users = array();
- $db_users=DBselect("select distinct u.alias,u.userid from users u,users_groups ug ".
- "where u.userid=ug.userid and ug.usrgrpid=".$row["usrgrpid"].
- " order by alias");
+ $db_users=DBselect('SELECT DISTINCT u.alias,u.userid '.
+ ' FROM users u,users_groups ug '.
+ ' WHERE u.userid=ug.userid '.
+ ' AND ug.usrgrpid='.$row['usrgrpid'].
+ ' ORDER BY u.alias');
while($db_user=DBfetch($db_users)) $users[$db_user['userid']] = $db_user["alias"];