From 35fe4b3ed65718e9d09951b8879cc7cc69f7c1ef Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 3 Jun 2011 06:40:29 +0200 Subject: admin user --- DB/db_rewrite.sql | 36 ++++++++------ includes/funktion_db_list.php | 27 +++++----- includes/pages/admin_user.php | 111 ++++++++++++++++++++++++++++++++++++++++++ includes/sys_menu.php | 1 + www-ssl/css/base.css | 16 ++++++ www-ssl/index.php | 4 ++ 6 files changed, 165 insertions(+), 30 deletions(-) create mode 100644 includes/pages/admin_user.php diff --git a/DB/db_rewrite.sql b/DB/db_rewrite.sql index f5ba1c6d..f713c813 100644 --- a/DB/db_rewrite.sql +++ b/DB/db_rewrite.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 03. Juni 2011 um 03:49 +-- Erstellungszeit: 03. Juni 2011 um 04:40 -- Server Version: 5.1.44 -- PHP-Version: 5.3.1 @@ -71,23 +71,24 @@ CREATE TABLE IF NOT EXISTS `Counter` ( -- INSERT INTO `Counter` (`URL`, `Anz`) VALUES -('news', 187), +('news', 190), ('login', 26), ('logout', 13), ('start', 26), ('faq', 19), ('credits', 3), -('register', 3), +('register', 8), ('admin_rooms', 89), ('admin_angel_types', 71), ('user_settings', 126), ('user_messages', 113), -('admin_groups', 117), +('admin_groups', 125), ('user_questions', 55), ('admin_questions', 42), ('admin_faq', 55), ('admin_news', 32), -('news_comments', 151); +('news_comments', 151), +('admin_user', 55); -- -------------------------------------------------------- @@ -133,7 +134,7 @@ CREATE TABLE IF NOT EXISTS `GroupPrivileges` ( `privilege_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `group_id` (`group_id`,`privilege_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ; -- -- Daten für Tabelle `GroupPrivileges` @@ -145,15 +146,17 @@ INSERT INTO `GroupPrivileges` (`id`, `group_id`, `privilege_id`) VALUES (40, -2, 4), (41, -2, 3), (23, -1, 2), -(48, -4, 14), -(46, -4, 7), +(62, -4, 16), +(61, -4, 6), (44, -2, 11), (43, -2, 9), (12, -5, 10), -(47, -4, 13), -(49, -4, 12), +(60, -4, 12), +(59, -4, 14), (45, -2, 8), -(50, -4, 6); +(58, -4, 13), +(57, -4, 7), +(63, -4, 5); -- -------------------------------------------------------- @@ -265,7 +268,7 @@ CREATE TABLE IF NOT EXISTS `Privileges` ( `desc` varchar(1024) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ; -- -- Daten für Tabelle `Privileges` @@ -286,7 +289,8 @@ INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (12, 'admin_questions', 'Answer user''s questions'), (13, 'admin_faq', 'Edit FAQs'), (14, 'admin_news', 'Administrate the news section'), -(15, 'news_comments', 'User can comment news'); +(15, 'news_comments', 'User can comment news'), +(16, 'admin_user', 'Administrate the angels'); -- -------------------------------------------------------- @@ -984,8 +988,8 @@ INSERT INTO `Sprache` (`TextID`, `Sprache`, `Text`) VALUES ('admin/dect.php', 'EN', 'Dect'), ('admin/dect_call.php', 'DE', ' '), ('admin/dect_call.php', 'EN', ' '), -('admin/user.php', 'DE', 'Engelliste'), -('admin/user.php', 'EN', 'Drone-list'), +('admin_user', 'DE', 'Engelliste'), +('admin_user', 'EN', 'Manage angels'), ('admin/userDefaultSetting.php', 'DE', 'Engel Voreinstellungen'), ('admin/userDefaultSetting.php', 'EN', 'Drone Default Setting'), ('admin/UserPicture.php', 'DE', 'Benutzerbilder'), @@ -1072,7 +1076,7 @@ CREATE TABLE IF NOT EXISTS `User` ( -- INSERT INTO `User` (`UID`, `Nick`, `Name`, `Vorname`, `Alter`, `Telefon`, `DECT`, `Handy`, `email`, `ICQ`, `jabber`, `Size`, `Passwort`, `Gekommen`, `Aktiv`, `Tshirt`, `color`, `Sprache`, `Avatar`, `Menu`, `lastLogIn`, `CreateDate`, `Art`, `kommentar`, `Hometown`) VALUES -(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307072950, '0000-00-00 00:00:00', '', '', ''), +(1, 'admin', '', '', 0, '', '', '', '', '', '', 'L', '21232f297a57a5a743894a0e4a801fc3', 0, 0, 0, 10, 'DE', 115, 'L', 1307075960, '0000-00-00 00:00:00', '', '', ''), (147, 'msquare', '', '', 23, '', '', '', 'msquare@notrademark.de', '', '', 'L', 'e10adc3949ba59abbe56e057f20f883e', 0, 0, 0, 6, 'EN', 0, 'L', 1307042703, '2011-06-02 00:55:09', '', '', ''); -- -------------------------------------------------------- diff --git a/includes/funktion_db_list.php b/includes/funktion_db_list.php index 44e3d865..3e2878da 100644 --- a/includes/funktion_db_list.php +++ b/includes/funktion_db_list.php @@ -34,32 +34,31 @@ function funktion_db_element_list_2row( $TopicName, $SQL) { - global $con; + $html = ""; + $html .= "\n"; + $html .= ""; +# $html .= "\n"; - echo "
$TopicName

$TopicName

\n"; - echo ""; -# echo "\n"; - - $Erg = mysql_query($SQL, $con); - echo mysql_error($con); + $Erg = sql_query($SQL); - echo ""; + $html .= ""; for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) { - echo ""; + $html .= ""; } - echo ""; + $html .= ""; for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++) { - echo ""; + $html .= ""; for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) { - echo ""; + $html .= ""; } - echo ""; + $html .= ""; } - echo "
$TopicName

$TopicName

". mysql_field_name($Erg, $m). "". mysql_field_name($Erg, $m). "
".mysql_result($Erg, $n, $m). "".mysql_result($Erg, $n, $m). "
\n"; + $html .= "\n"; + return $html; } ?> diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php new file mode 100644 index 00000000..b64c9678 --- /dev/null +++ b/includes/pages/admin_user.php @@ -0,0 +1,111 @@ +Neuen Engel eintragen »

\n"; + + if (!isset ($_GET["OrderBy"])) + $_GET["OrderBy"] = "Nick"; + $SQL = "SELECT * FROM `User` ORDER BY `" . $_GET["OrderBy"] . "` ASC"; + $Erg = sql_query($SQL); + + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); + + $html .= "Anzahl Engel: $Zeilen

\n"; + $html .= ' + + + + + + + + + + + + + '; + $Gekommen = 0; + $Active = 0; + $Tshirt = 0; + + for ($n = 0; $n < $Zeilen; $n++) { + $title = ""; + $user_groups = sql_select("SELECT * FROM `UserGroups` JOIN `Groups` ON (`Groups`.`UID` = `UserGroups`.`group_id`) WHERE `UserGroups`.`uid`=" . sql_escape(mysql_result($Erg, $n, "UID")) . " ORDER BY `Groups`.`Name`"); + $groups = array (); + foreach ($user_groups as $user_group) { + $groups[] = $user_group['Name']; + } + $title .= 'Groups: ' . join(", ", $groups) . "
"; + if (strlen(mysql_result($Erg, $n, "Telefon")) > 0) + $title .= "Tel: " . mysql_result($Erg, $n, "Telefon") . "
"; + if (strlen(mysql_result($Erg, $n, "Handy")) > 0) + $title .= "Handy: " . mysql_result($Erg, $n, "Handy") . "
"; + if (strlen(mysql_result($Erg, $n, "DECT")) > 0) + $title .= "DECT: " . + mysql_result($Erg, $n, "DECT") . "
"; + if (strlen(mysql_result($Erg, $n, "Hometown")) > 0) + $title .= "Hometown: " . mysql_result($Erg, $n, "Hometown") . "
"; + if (strlen(mysql_result($Erg, $n, "lastLogIn")) > 0) + $title .= "Last login: " . date("Y-m-d H:i", mysql_result($Erg, $n, "lastLogIn")) . "
"; + if (strlen(mysql_result($Erg, $n, "Art")) > 0) + $title .= "Type: " . mysql_result($Erg, $n, "Art") . "
"; + if (strlen(mysql_result($Erg, $n, "ICQ")) > 0) + $title .= "ICQ: " . mysql_result($Erg, $n, "ICQ") . "
"; + if (strlen(mysql_result($Erg, $n, "jabber")) > 0) + $title .= "jabber: " . mysql_result($Erg, $n, "jabber") . "
"; + + $html .= "\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $html .= "\t\n"; + $Gekommen += mysql_result($Erg, $n, "Gekommen"); + $html .= "\t\n"; + $Active += mysql_result($Erg, $n, "Aktiv"); + $html .= "\t\n"; + $Tshirt += mysql_result($Erg, $n, "Tshirt"); + $html .= "\t\n"; + $html .= ""; + $html .= "\t\n"; + $html .= "\n"; + } + $html .= "" . + "" . + "\n"; + $html .= "\t
+ Nick + Vorname NameAlter + E-Mail + GrößeGekommenAktivT-ShirtRegistrierÄnd.
" . mysql_result($Erg, $n, "Nick") . "" . mysql_result($Erg, $n, "Vorname") . " " . mysql_result($Erg, $n, "Name") . "" . mysql_result($Erg, $n, "Alter") . ""; + if (strlen(mysql_result($Erg, $n, "email")) > 0) + $html .= "" . + mysql_result($Erg, $n, "email") . ""; + $html .= ''; + $html .= "" . mysql_result($Erg, $n, "Size") . "" . mysql_result($Erg, $n, "Gekommen") . "" . mysql_result($Erg, $n, "Aktiv") . "" . mysql_result($Erg, $n, "Tshirt") . "" . mysql_result($Erg, $n, "CreateDate") . "" . 'Edit' . + "
$Gekommen$Active$Tshirt
\n"; + // Ende Userliste + + $html .= "

Statistics

"; + $html .= funktion_db_element_list_2row("Hometown", "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); + + $html .= "
\n"; + + $html .= funktion_db_element_list_2row("Engeltypen", "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); + + $html .= "
\n"; + + $html .= funktion_db_element_list_2row("Used Groups", "SELECT Groups.Name AS 'GroupName', COUNT(Groups.Name) AS Count FROM `UserGroups` " . + "LEFT JOIN `Groups` ON Groups.UID = UserGroups.group_id " . + "WHERE (UserGroups.group_id!='NULL') " . + "GROUP BY `GroupName` " . + ""); + return $html; +} +?> \ No newline at end of file diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 2a05fdb4..6a10c32b 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -31,6 +31,7 @@ function make_navigation() { // Admin Navigation $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_user", "admin_usershifts", "admin_questions", "admin_angel_types", diff --git a/www-ssl/css/base.css b/www-ssl/css/base.css index 0a137099..236eba81 100644 --- a/www-ssl/css/base.css +++ b/www-ssl/css/base.css @@ -120,6 +120,22 @@ textarea { width: 300px; } +.hidden { + background: #fff; + border: 1px solid #888; + display: none; + font-size: 12px; + padding: 4px; +} + +td .hidden { + position: absolute; +} + +tr:hover .hidden { + display: block; +} + .clear { clear: both; } diff --git a/www-ssl/index.php b/www-ssl/index.php index c62b03e0..f6c6aaa2 100644 --- a/www-ssl/index.php +++ b/www-ssl/index.php @@ -66,6 +66,10 @@ if (in_array($p, $privileges)) { elseif ($p == "admin_questions") { $content = admin_questions(); } + elseif ($p == "admin_user") { + require_once ('includes/pages/admin_user.php'); + $content = admin_user(); + } elseif ($p == "admin_news") { require_once ('includes/pages/admin_news.php'); $content = admin_news(); -- cgit v1.2.3-70-g09d2