diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php index 3af89e53..3e8e98c9 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 {