From 90c70b2704c7e31e1b0810aefc48196ca4321115 Mon Sep 17 00:00:00 2001 From: jengo Date: Sat, 19 Aug 2000 06:17:20 +0000 Subject: [PATCH] Cleaned up with accounts form, added a search field and next matchs icons --- admin/accounts.php | 53 +++++++++++++++++++++++++++++++++++------- admin/currentusers.php | 3 ++- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/admin/accounts.php b/admin/accounts.php index 1028550538..79710ea63d 100755 --- a/admin/accounts.php +++ b/admin/accounts.php @@ -13,13 +13,45 @@ $phpgw_flags["currentapp"] = "admin"; include("../header.inc.php"); - echo "

" . lang_admin("user accounts") . "
" - . "\n"; - $phpgw->db->query("select con,firstname,lastname,loginid from accounts order by " - . "lastname, firstname"); + if (! $start) + $start = 0; + + if (! $sort) + $sort = "desc"; + + if ($order) + $ordermethod = "order by $order $sort"; + else + $ordermethod = "order by lastname,firstname,loginid asc"; + + if ($query) { + $querymethod = " where firstname like '%$query%' OR lastname like '%$query%' OR loginid " + . "like '%$query%' "; + } + + $phpgw->db->query("select count(*) from accounts $querymethod"); + $phpgw->db->next_record(); + + $total = $phpgw->db->f(0); + $limit = $phpgw->nextmatchs->sql_limit($start); + + echo '

" . lang_common("Last name") . "" - . lang_common("First name") . " " . lang_common("Edit") . " " - . lang_common("Delete") . " " . lang_common("View") . "
' + . '' + . '' + . '' + . '
' . $phpgw->nextmatchs->left("accounts.php",$start,$total) . '' . lang_admin("user accounts") . '' . $phpgw->nextmatchs->right("accounts.php",$start,$total) . '
'; + + echo "
" + . "\n"; + + $phpgw->db->query("select con,firstname,lastname,loginid from accounts $querymethod " + . "$ordermethod limit $limit"); while ($phpgw->db->next_record()) { $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); @@ -42,9 +74,12 @@ echo "\n"; } + echo "\n" - . $phpgw->session->hidden_var() - . "
" + . $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"accounts.php",lang_common("last name")) . "" + . $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"accounts.php",lang_common("first name")) . "" + . lang_common("Edit") . " " . lang_common("Delete") . " " + . lang_common("View") . "
link("viewaccount.php", "con=" . $phpgw->db->f("con")) . "\"> " . lang_common("View") . "
"; + . $phpgw->session->hidden_var() . "
" + . "" + . $phpgw->session->hidden_var() . "
" . lang_common("search") . " " + . "
"; include($phpgw_info["server"]["api_dir"] . "/footer.inc.php"); diff --git a/admin/currentusers.php b/admin/currentusers.php index 8bbb9706d7..b0216e943d 100755 --- a/admin/currentusers.php +++ b/admin/currentusers.php @@ -13,10 +13,11 @@ $phpgw_flags["currentapp"] = "admin"; include("../header.inc.php"); + if (! $start) $start = 0; - $limit =$phpgw->nextmatchs->sql_limit($start); + $limit = $phpgw->nextmatchs->sql_limit($start); $phpgw->db->query("select count(*) from sessions"); $phpgw->db->next_record();