diff --git a/includes/funktion_db_list.php b/includes/funktion_db_list.php index fbf1c821..8b64297e 100755 --- a/includes/funktion_db_list.php +++ b/includes/funktion_db_list.php @@ -1,34 +1,66 @@ "; + echo ""; -echo ""; -for ($m = 0 ; $m < $Anzahl_Felder ; $m++) { - echo ""; - } -echo ""; + echo ""; + for ($m = 0 ; $m < $Anzahl_Felder ; $m++) + { + echo ""; + } + echo ""; -for ($n = 0 ; $n < $Zeilen ; $n++) { - echo ""; - for ($m = 0 ; $m < $Anzahl_Felder ; $m++) { - echo ""; - } - echo ""; + for ($n = 0 ; $n < $Zeilen ; $n++) + { + echo ""; + for ($m = 0 ; $m < $Anzahl_Felder ; $m++) + { + echo ""; + } + echo ""; + } + echo "
". mysql_field_name($Erg, $m). "
". mysql_field_name($Erg, $m). "
".mysql_result($Erg, $n, $m). "
".mysql_result($Erg, $n, $m). "
"; } -echo ""; +function funktion_db_element_list_2row( $TopicName, $SQL) +{ + global $con; + + echo "\n"; + echo ""; +# echo "\t\n"; + + $Erg = mysql_query($SQL, $con); + echo mysql_error($con); + + echo ""; + for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) + { + echo ""; + } + echo ""; + + for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++) + { + echo ""; + for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) + { + echo ""; + } + echo ""; + } + echo "
$TopicName

$TopicName

". mysql_field_name($Erg, $m). "
".mysql_result($Erg, $n, $m). "
\n"; } ?> diff --git a/www-ssl/admin/debug.php b/www-ssl/admin/debug.php index afc394eb..af42dd20 100755 --- a/www-ssl/admin/debug.php +++ b/www-ssl/admin/debug.php @@ -30,33 +30,26 @@ funktion_db_list("FAQ"); echo "Deaktiviert"; */ +echo "
\n"; +funktion_db_element_list_2row( "Tshirt-Size aller engel", + "SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`"); -echo "

Tshirt-Size aller engel

"; -$SQL="SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`"; -$Erg = mysql_query($SQL, $con); -echo mysql_error($con); -$rowcount = mysql_num_rows($Erg); +echo "
\n"; +funktion_db_element_list_2row( "Tshirt ausgegeben", + "SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"); -for ($i=0; $i<$rowcount; $i++) - echo mysql_result($Erg, $i, 1). "x '". mysql_result($Erg, $i, 0). "'
\n"; +echo "
\n"; +funktion_db_element_list_2row( "Tshirt nicht ausgegeben (Gekommen=1)", + "SELECT COUNT(`Size`), `Size` FROM `User` WHERE `Gekommen`='1' and `Tshirt`='0' GROUP BY `Size`"); -echo "

Tshirt ausgegeben

"; -$SQL="SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"; -$Erg = mysql_query($SQL, $con); -echo mysql_error($con); -$rowcount = mysql_num_rows($Erg); +echo "
\n"; +funktion_db_element_list_2row( "Hometown", + "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); -for ($i=0; $i<$rowcount; $i++) - echo mysql_result($Erg, $i, 1). "x '". mysql_result($Erg, $i, 0). "'
\n"; +echo "
\n"; +funktion_db_element_list_2row( "Engeltypen", + "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); -echo "

Tshirt nicht ausgegeben (Gekommen=1)

"; -$SQL="SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Gekommen`='1' and `Tshirt`='0' GROUP BY `Size`"; -$Erg = mysql_query($SQL, $con); -echo mysql_error($con); -$rowcount = mysql_num_rows($Erg); - -for ($i=0; $i<$rowcount; $i++) - echo mysql_result($Erg, $i, 1). "x '". mysql_result($Erg, $i, 0). "'
\n"; include ("../../includes/footer.php"); ?> diff --git a/www-ssl/admin/user.php b/www-ssl/admin/user.php index 1b99ec4b..a792f864 100755 --- a/www-ssl/admin/user.php +++ b/www-ssl/admin/user.php @@ -101,6 +101,15 @@ if (!IsSet($_GET["enterUID"])) "$Gekommen$Active$Tshirt\n"; echo "\t\n"; // Ende Userliste + + echo "

Statistics

"; + funktion_db_element_list_2row( "Hometown", + "SELECT COUNT(`Hometown`), `Hometown` FROM `User` GROUP BY `Hometown`"); + + echo "
\n"; + + funktion_db_element_list_2row( "Engeltypen", + "SELECT COUNT(`Art`), `Art` FROM `User` GROUP BY `Art`"); } else {