Show the number of users and move the registration count to the front.

This commit is contained in:
markjcrane
2015-09-04 21:51:51 -06:00
parent 765d34668c
commit 4e9c06901a
3 changed files with 39 additions and 38 deletions

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2014
Portions created by the Initial Developer are Copyright (C) 2008-2015
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -127,7 +127,7 @@ require_once "resources/check_auth.php";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n";
echo "<tr>\n";
echo "<td width='100%'>\n";
echo " <b>".$text['header-registrations'].": ".count($registrations)."</b>\n";
echo " <b>".count($registrations)." ".$text['header-registrations']."</b>\n";
echo "</td>\n";
echo "<td valign='middle' nowrap='nowrap' style='padding-right: 15px' id='refresh_state'>";
echo " <img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_stop();' alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\">";

View File

@@ -1,6 +1,6 @@
<?php
$text['title-user_manager']['en-us'] = "User Manager";
$text['title-user_manager']['en-us'] = "Users";
$text['title-user_manager']['es-cl'] = "Administración de Usuarios";
$text['title-user_manager']['pt-pt'] = "Gestão de Utilizadores";
$text['title-user_manager']['fr-fr'] = "Gestion des utilisateurs";

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2013
Portions created by the Initial Developer are Copyright (C) 2008-2015
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -34,6 +34,7 @@ else {
exit;
}
//additional includes
require_once "resources/paging.php";
//set the variables
@@ -41,35 +42,6 @@ else {
$order = check_str($_GET["order"]);
$search_value = check_str($_REQUEST["search_value"]);
//page title and description
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<form method='post' action=''>";
echo "<tr>\n";
echo "<td align='left' width='90%' nowrap='nowrap' valign='top'><b>".$text['header-user_manager']."</b></td>\n";
echo "<td align='right' nowrap='nowrap'>";
if (permission_exists('user_all')) {
if ($_GET['showall'] == 'true') {
echo "<input type='button' class='btn' value='".$text['button-back']."' onclick=\"window.location='index.php';\">\n";
echo "<input type='hidden' name='showall' value='true'>";
}
else {
echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='index.php?showall=true';\">\n";
}
}
echo "<input type='text' class='txt' style='width: 150px; margin-right: 3px;' name='search_value' value=\"".$search_value."\">";
echo "<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
echo "</td>";
echo "</tr>\n";
echo "</form>";
echo "<tr>\n";
echo "<td align='left' colspan='4'>\n";
echo $text['description-user_manager']."\n";
echo "<br />\n";
echo "<br />\n";
echo "</td>\n";
echo "</tr>\n";
//get the list of superadmins
$superadmins = superadmin_list($db);
@@ -157,10 +129,39 @@ else {
$sql .= " limit ".$rows_per_page." offset ".$offset." ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
$users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$user_count = count($users);
unset ($prep_statement, $sql);
//page title and description
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<form method='post' action=''>";
echo "<tr>\n";
echo "<td align='left' width='90%' nowrap='nowrap' valign='top'><b>".$user_count." ".$text['header-user_manager']."</b></td>\n";
echo "<td align='right' nowrap='nowrap'>";
if (permission_exists('user_all')) {
if ($_GET['showall'] == 'true') {
echo "<input type='button' class='btn' value='".$text['button-back']."' onclick=\"window.location='index.php';\">\n";
echo "<input type='hidden' name='showall' value='true'>";
}
else {
echo "<input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='index.php?showall=true';\">\n";
}
}
echo "<input type='text' class='txt' style='width: 150px; margin-right: 3px;' name='search_value' value=\"".$search_value."\">";
echo "<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
echo "</td>";
echo "</tr>\n";
echo "</form>";
echo "<tr>\n";
echo "<td align='left' colspan='4'>\n";
echo $text['description-user_manager']."\n";
echo "<br />\n";
echo "<br />\n";
echo "</td>\n";
echo "</tr>\n";
//alternate the row style
$c = 0;
$row_style["0"] = "row_style0";
@@ -185,8 +186,8 @@ else {
echo "</td>\n";
echo "</tr>\n";
if ($result_count > 0) {
foreach($result as $row) {
if ($user_count > 0) {
foreach($users as $row) {
if (if_superadmin($superadmins, $row['user_uuid']) && !if_group("superadmin")) {
//hide
} else {
@@ -233,7 +234,7 @@ else {
if ($c==0) { $c=1; } else { $c=0; }
}
} //end foreach
unset($sql, $result, $row_count);
unset($sql, $users, $user_count);
} //end if results
echo "<tr>\n";