@ -281,93 +281,65 @@ function admin_user() {
if (!isset ($_GET["OrderBy"]))
if (!isset ($_GET["OrderBy"]))
$_GET["OrderBy"] = "Nick";
$_GET["OrderBy"] = "Nick";
$SQL = "SELECT * FROM `User` ORDER BY `" . sql_escape($_GET["OrderBy"]) . "` ASC";
$SQL = "SELECT * FROM `User` ORDER BY `" . sql_escape($_GET["OrderBy"]) . "` ASC";
$Erg = sql_query ($SQL);
$angels = sql_select ($SQL);
// anzahl zeilen
// anzahl zeilen
$Zeilen = mysql_num_rows($Erg );
$Zeilen = count($angels );
$html .= "Anzahl Engel: $Zeilen< br / > < br / > \n";
$html .= "Anzahl Engel: $Zeilen< br / > < br / > \n";
$html .= '< table width = "100%" class = "border" cellpadding = "2" cellspacing = "1" > < thead >
< tr class = "contenttopic" >
function prepare_angel_table($angel) {
< th >
global $privileges;
< a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Nick" > Nick< / a >
$groups = sql_select_single_col("SELECT `Name` FROM `UserGroups` JOIN `Groups` ON (`Groups`.`UID` = `UserGroups`.`group_id`) WHERE `UserGroups`.`uid`=" . sql_escape($angel["UID"]) . " ORDER BY `Groups`.`Name`");
< / th >
$popup = '< div class = "hidden" > Groups: ' . implode(', ', $groups);
< th > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Vorname" > Vorname< / a > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Name" > Name< / a > < / th >
if (strlen($angel["Telefon"]) > 0)
< th > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = DECT" > DECT< / a > < / th >
$popup .= "< br > Tel: " . $angel["Telefon"];
< th > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Alter" > Alter< / a > < / th >
if (strlen($angel["Handy"]) > 0)
< th > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = email" > E-Mail< / a > < / th >
$popup .= "< br > Handy: " . $angel["Handy"];
< th class = "rotate" > < div > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Gekommen" > Gekommen< / a > < / div > < / th >
if (strlen($angel["DECT"]) > 0)
< th class = "rotate" > < div > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Aktiv" > Aktiv< / a > < / div > < / th >
$popup .= "< br > DECT: " . $angel["DECT"];
< th class = "rotate" > < div > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Tshirt" > T-Shirt< / a > < / div > < / th >
if (strlen($angel["Hometown"]) > 0)
< th class = "rotate" > < div > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = Size" > Grö ß e< / a > < / div > < / th >
$popup .= "< br > Hometown: " . $angel["Hometown"];
< th > < a href = "' . page_link_to(" admin_user " ) . ' & OrderBy = lastLogIn" > Last login< / a > < / th >
if (strlen($angel["CreateDate"]) > 0)
< th > Edit< / th >
$popup .= "< br > Registered: " . $angel["CreateDate"];
< / tr > < / thead > ';
if (strlen($angel["Art"]) > 0)
$Gekommen = 0;
$popup .= "< br > Type: " . $angel["Art"];
$Active = 0;
if (strlen($angel["ICQ"]) > 0)
$Tshirt = 0;
$popup .= "< br > ICQ: " . $angel["ICQ"];
if (strlen($angel["jabber"]) > 0)
for ($n = 0; $n < $Zeilen; $n++) {
$popup .= "< br > Jabber: " . $angel["jabber"];
$title = "";
return array(
$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`");
'Nick' => in_array('user_shifts_admin', $privileges)? '< a href = "' . page_link_to(" user_myshifts " ) . ' & amp ; id = ' . $angel["UID"] . ' " > ' . htmlspecialchars($angel["Nick"]) . '< / a > ' : htmlspecialchars($angel['Nick']),
$groups = array ();
'Name' => htmlspecialchars($angel['Vorname'] . ' ' . $angel['Name']),
foreach ($user_groups as $user_group) {
'DECT' => htmlspecialchars($angel['DECT']),
$groups[] = $user_group['Name'];
'Alter' => htmlspecialchars($angel['Alter']),
}
'email' => '< a href = "mailto:' . htmlspecialchars($angel['email']) . '" > ' . htmlspecialchars($angel['email']) . '< / a > ' . $popup,
$title .= 'Groups: ' . join(", ", $groups) . "< br / > ";
'Gekommen' => '< img src = "pic/icons/' . ($angel['Gekommen'] == 1? 'tick' : 'cross') . '.png" alt = "' . $angel['Gekommen'] . '" > ',
if (strlen(mysql_result($Erg, $n, "Telefon")) > 0)
'Aktiv' => '< img src = "pic/icons/' . ($angel['Aktiv'] == 1? 'tick' : 'cross') . '.png" alt = "' . $angel['Aktiv'] . '" > ',
$title .= "Tel: " . mysql_result($Erg, $n, "Telefon") . "< br / > ";
'Tshirt' => '< img src = "pic/icons/' . ($angel['Tshirt'] == 1? 'tick' : 'cross') . '.png" alt = "' . $angel['Tshirt'] . '" > ',
if (strlen(mysql_result($Erg, $n, "Handy")) > 0)
'Size' => $angel['Size'],
$title .= "Handy: " . mysql_result($Erg, $n, "Handy") . "< br / > ";
'lastLogIn' => date('d.m.&\n\b\s\p; H:i', $angel['lastLogIn']),
if (strlen(mysql_result($Erg, $n, "DECT")) > 0)
'edit' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; id = ' . $angel["UID"] . ' " > < img src = "pic/icons/pencil.png" alt = "' . Get_Text('Edit') . '" title = "' . Get_Text('Edit') . '" > < / a > ',
$title .= "DECT: < a href = \"./dect.php?custum=" . mysql_result ( $ Erg , $ n , " DECT " ) . " \ " > " .
);
mysql_result($Erg, $n, "DECT") . "< / a > < br / > ";
if (strlen(mysql_result($Erg, $n, "Hometown")) > 0)
$title .= "Hometown: " . mysql_result($Erg, $n, "Hometown") . "< br / > ";
if (strlen(mysql_result($Erg, $n, "CreateDate")) > 0)
$title .= "Registered: " . mysql_result($Erg, $n, "CreateDate") . "< br / > ";
if (strlen(mysql_result($Erg, $n, "Art")) > 0)
$title .= "Type: " . mysql_result($Erg, $n, "Art") . "< br / > ";
if (strlen(mysql_result($Erg, $n, "ICQ")) > 0)
$title .= "ICQ: " . mysql_result($Erg, $n, "ICQ") . "< br / > ";
if (strlen(mysql_result($Erg, $n, "jabber")) > 0)
$title .= "jabber: " . mysql_result($Erg, $n, "jabber") . "< br / > ";
$html .= "< tr class = \"content\" > \n";
if (in_array("user_shifts_admin", $privileges))
$html .= "\t< td > < a href = \"" . page_link_to ( " user_myshifts " ) . " & id = " . mysql_result($Erg, $n, " UID " ) . " \ " > " . mysql_result($Erg, $n, "Nick") . "< / a > < / td > \n";
else
$html .= "\t< td > " . mysql_result($Erg, $n, "Nick") . "< / td > \n";
$html .= "\t< td > " . mysql_result($Erg, $n, "Vorname") . " " . mysql_result($Erg, $n, "Name") . "< / td > \n";
$html .= "\t< td > " . mysql_result($Erg, $n, "DECT") . "< / td > \n";
$html .= "\t< td > " . mysql_result($Erg, $n, "Alter") . "< / td > \n";
$html .= "\t< td > ";
if (strlen(mysql_result($Erg, $n, "email")) > 0)
$html .= "< a href = \"mailto:" . mysql_result ( $ Erg , $ n , " email " ) . " \ " > " .
mysql_result($Erg, $n, "email") . "< / a > ";
$html .= '< div class = "hidden" > ' . $title . '< / div > ';
$html .= "< / td > \n";
$Gekommen += mysql_result($Erg, $n, "Gekommen");
$html .= "\t< td class = \"" . ( mysql_result ( $ Erg , $ n , " Gekommen " ) = = 1 ? ' true ' : ' false ' ) . " \ " > " . mysql_result($Erg, $n, "Gekommen") . "< / td > \n";
$Active += mysql_result($Erg, $n, "Aktiv");
$html .= "\t< td class = \"" . ( mysql_result ( $ Erg , $ n , " Aktiv " ) = = 1 ? ' true ' : ' false ' ) . " \ " > " . mysql_result($Erg, $n, "Aktiv") . "< / td > \n";
$Tshirt += mysql_result($Erg, $n, "Tshirt");
$html .= "\t< td class = \"" . ( mysql_result ( $ Erg , $ n , " Tshirt " ) = = 1 ? ' true ' : ' false ' ) . " \ " > " . mysql_result($Erg, $n, "Tshirt") . "< / td > \n";
$html .= "\t< td > " . mysql_result($Erg, $n, "Size") . "< / td > \n";
$last_login = mysql_result($Erg, $n, "lastLogIn");
if($last_login == 0)
$html .= "< td > never< / td > ";
else
$html .= "< td > " . date('d.m.&\n\b\s\p; H:i', $last_login) . "< / td > ";
$html .= "\t< td > " . '< a href = "' . page_link_to(" admin_user " ) . ' & id = ' . mysql_result($Erg, $n, "UID") . ' " > Edit< / a > ' .
"< / td > \n";
$html .= "< / tr > \n";
}
}
$html .= "< tr > " .
$angels = array_map('prepare_angel_table', $angels);
"< th > Summe< / th > < th > < / th > < th > < / th > < th > < / th > < th > < / th > " .
$Gekommen = sql_select_single_cell("SELECT COUNT(*) FROM `User` WHERE `Gekommen` = 1");
"< th > $Gekommen< / th > < th > $Active< / th > < th > $Tshirt< / th > < th > < / th > < th > < / th > < th > < / th > < / tr > \n";
$Active = sql_select_single_cell("SELECT COUNT(*) FROM `User` WHERE `Aktiv` = 1");
$html .= "\t< / table > \n";
$Tshirt = sql_select_single_cell("SELECT COUNT(*) FROM `User` WHERE `Tshirt` = 1");
// Ende Userliste
$angels[] = array('Nick' => '< strong > Summe< / strong > ', 'Gekommen' => $Gekommen, 'Aktiv' => $Active, 'Tshirt' => $Tshirt);
$html .= table(array(
'Nick' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Nick" > Nick< / a > ',
'Name' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Vorname" > Vorname< / a > < a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Name" > Name< / a > ',
'DECT' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = DECT" > DECT< / a > ',
'Alter' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Alter" > Alter< / a > ',
'email' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = email" > E-Mail< / a > ',
'Gekommen' => '< div class = "rotate" > < a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Gekommen" > Gekommen< / a > < / div > ',
'Aktiv' => '< div class = "rotate" > < a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Aktiv" > Aktiv< / a > < / div > ',
'Tshirt' => '< div class = "rotate" > < a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Tshirt" > T-Shirt< / a > < / div > ',
'Size' => '< div class = "rotate" > < a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = Size" > Grö ß e< / a > < / div > ',
'lastLogIn' => '< a href = "' . page_link_to(" admin_user " ) . ' & amp ; OrderBy = lastLogIn" > Last login< / a > ',
'edit' => ''),
$angels);
}
}
return $html;
return $html;
}
}