From dd5f2ef7ad6490f12540d7fd6712d434fc4c2efd Mon Sep 17 00:00:00 2001 From: Angelo Cuccato Date: Sun, 26 Dec 2010 01:26:04 +0100 Subject: [PATCH] add group filter and Statistics in User List --- www-ssl/admin/user.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php index f8691563..362d6a3b 100755 --- a/www-ssl/admin/user.php +++ b/www-ssl/admin/user.php @@ -12,7 +12,10 @@ if (!IsSet($_GET["enterUID"])) echo "Neuen Engel eintragen

\n"; if( !isset($_GET["OrderBy"]) ) $_GET["OrderBy"] = "Nick"; - $SQL = "SELECT * FROM `User` ORDER BY `". $_GET["OrderBy"]. "` ASC"; + $SQL = "SELECT User.*, UserGroups.Name AS 'Group' FROM `User` ". + "LEFT JOIN `UserCVS` ON User.UID = UserCVS.UID ". + "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ". + "ORDER BY `". $_GET["OrderBy"]. "` ASC"; $Erg = mysql_query($SQL, $con); echo mysql_error($con); @@ -37,7 +40,8 @@ if (!IsSet($_GET["enterUID"])) ?OrderBy=lastLogIn">lastLogIn | ?OrderBy=Art">Type | ?OrderBy=ICQ">ICQ | - ?OrderBy=jabber">jabber + ?OrderBy=jabber">jabber | + ?OrderBy=Group">Group ?OrderBy=Size">Größe ?OrderBy=Gekommen">G @@ -80,6 +84,7 @@ if (!IsSet($_GET["enterUID"])) echo "\n\t\tICQ: ". mysql_result($Erg, $n, "ICQ"). "
"; if( strlen( mysql_result($Erg, $n, "jabber"))>0) echo "\n\t\tjabber: ". mysql_result($Erg, $n, "jabber"). "
"; + echo "\n\t\tGroup: ". mysql_result($Erg, $n, "Group"). "
"; echo "\n"; echo "\t".mysql_result($Erg, $n, "Size")."\n"; $Gekommen += mysql_result($Erg, $n, "Gekommen"); @@ -114,6 +119,15 @@ if (!IsSet($_GET["enterUID"])) funktion_db_element_list_2row( "Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); + + echo "
\n"; + + funktion_db_element_list_2row( "Used Groups", + "SELECT UserGroups.Name AS 'GroupName', COUNT(UserGroups.Name) AS Count FROM `UserCVS` ". + "LEFT JOIN `UserGroups` ON UserGroups.UID = UserCVS.GroupID ". + "WHERE (UserCVS.GroupID!='NULL') ". + "GROUP BY `GroupName` ". + ""); } else {