From ded7bcb0b49e101c0414034fe1ff168a043b6a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Fri, 3 Jun 2011 14:48:05 +0200 Subject: [PATCH] debug -> admin log --- includes/funktion_db_list.php | 100 +++++++++++++++++----------------- includes/pages/admin_log.php | 51 +++++++++++++++++ www-ssl/admin/debug.php | 58 -------------------- 3 files changed, 100 insertions(+), 109 deletions(-) delete mode 100644 www-ssl/admin/debug.php diff --git a/includes/funktion_db_list.php b/includes/funktion_db_list.php index 3e2878da..35bb7255 100644 --- a/includes/funktion_db_list.php +++ b/includes/funktion_db_list.php @@ -1,64 +1,62 @@ "; - echo "DB: $Table_Name"; + $SQL = "SELECT * FROM `" . $Table_Name . "`"; + $Erg = mysql_query($SQL, $con); - echo ""; - for ($m = 0 ; $m < $Anzahl_Felder ; $m++) - { - echo "". mysql_field_name($Erg, $m). ""; - } - echo ""; + // anzahl zeilen + $Zeilen = mysql_num_rows($Erg); - for ($n = 0 ; $n < $Zeilen ; $n++) - { - echo ""; - for ($m = 0 ; $m < $Anzahl_Felder ; $m++) - { - echo "".mysql_result($Erg, $n, $m). ""; - } - echo ""; - } - echo ""; -} + $Anzahl_Felder = mysql_num_fields($Erg); -function funktion_db_element_list_2row( $TopicName, $SQL) -{ - $html = ""; - $html .= "\n"; - $html .= ""; -# $html .= "\n"; + $html .= "
$TopicName

$TopicName

"; + $html .= ""; - $Erg = sql_query($SQL); - - $html .= ""; - for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) - { - $html .= ""; - } - $html .= ""; + $html .= ""; + for ($m = 0; $m < $Anzahl_Felder; $m++) { + $html .= ""; + } + $html .= ""; - for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++) - { - $html .= ""; - for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++) - { - $html .= ""; - } - $html .= ""; - } - $html .= "
DB: $Table_Name
". mysql_field_name($Erg, $m). "
" . mysql_field_name($Erg, $m) . "
".mysql_result($Erg, $n, $m). "
\n"; - return $html; + for ($n = 0; $n < $Zeilen; $n++) { + $html .= ""; + for ($m = 0; $m < $Anzahl_Felder; $m++) { + $html .= "" . mysql_result($Erg, $n, $m) . ""; + } + $html .= ""; + } + $html .= ""; + return $html; } +function funktion_db_element_list_2row($TopicName, $SQL) { + $html = ""; + $html .= "\n"; + $html .= ""; + # $html .= "\n"; + + $Erg = sql_query($SQL); + + $html .= ""; + for ($m = 0; $m < mysql_num_fields($Erg); $m++) { + $html .= ""; + } + $html .= ""; + + for ($n = 0; $n < mysql_num_rows($Erg); $n++) { + $html .= ""; + for ($m = 0; $m < mysql_num_fields($Erg); $m++) { + $html .= ""; + } + $html .= ""; + } + $html .= "
$TopicName

$TopicName

" . mysql_field_name($Erg, $m) . "
" . mysql_result($Erg, $n, $m) . "
\n"; + return $html; +} ?> diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index 5f112f03..2798b2cf 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -1,5 +1,7 @@ "; + + $html .= "

Web Counter

"; + $html .= funktion_db_list("Counter"); + + /* + $html .= "

Raeume


"; + funktion_db_list("Raeume"); + + $html .= "

Schichtbelegung


"; + funktion_db_list("Schichtbelegung"); + + $html .= "

Schichtplan


Hier findest du alle bisher eingetragenen Schichten:"; + funktion_db_list("Schichtplan"); + + $html .= "

User


"; + funktion_db_list("User"); + + $html .= "

News


"; + funktion_db_list("News"); + + $html .= "

FAQ


"; + funktion_db_list("FAQ"); + + $html .= "Deaktiviert"; + */ + + $html .= "
\n"; + $html .= funktion_db_element_list_2row("Tshirt-Size aller engel", "SELECT `Size`, COUNT(`Size`) FROM `User` GROUP BY `Size`"); + $html .= "
\n"; + $html .= funktion_db_element_list_2row("Tshirt ausgegeben", "SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"); + $html .= "
\n"; + $html .= 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`"); + + $html .= "
\n"; + $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("Gesamte Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID)"); + $html .= "
\n"; + $html .= funktion_db_element_list_2row("Geleisteter Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0)"); + + $html .= "
\n"; + $html .= funktion_db_element_list_2row("Gesamte Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (Shifts.RID!=7)"); + $html .= "
\n"; + $html .= funktion_db_element_list_2row("Geleisteter Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0) AND (Shifts.RID!=7)"); + return $html; } ?> diff --git a/www-ssl/admin/debug.php b/www-ssl/admin/debug.php deleted file mode 100644 index ec1b2c9f..00000000 --- a/www-ssl/admin/debug.php +++ /dev/null @@ -1,58 +0,0 @@ -Web Counter"; -funktion_db_list("Counter"); - -/* -echo "

Raeume


"; -funktion_db_list("Raeume"); - -echo "

Schichtbelegung


"; -funktion_db_list("Schichtbelegung"); - -echo "

Schichtplan


Hier findest du alle bisher eingetragenen Schichten:"; -funktion_db_list("Schichtplan"); - -echo "

User


"; -funktion_db_list("User"); - -echo "

News


"; -funktion_db_list("News"); - -echo "

FAQ


"; -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 "
\n"; -funktion_db_element_list_2row("Tshirt ausgegeben", "SELECT `Size`, COUNT(`Size`) FROM `User` WHERE `Tshirt`='1' GROUP BY `Size`"); -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 "
\n"; -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`"); - -echo "
\n"; -funktion_db_element_list_2row("Gesamte Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID)"); -echo "
\n"; -funktion_db_element_list_2row("Geleisteter Arbeit", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0)"); - -echo "
\n"; -funktion_db_element_list_2row("Gesamte Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (Shifts.RID!=7)"); -echo "
\n"; -funktion_db_element_list_2row("Geleisteter Arbeit (Ohne Raum aufabau (RID=7)", "SELECT COUNT(*) AS `Count [x]`, SUM(Shifts.Len) as `Sum [h]` from Shifts LEFT JOIN ShiftEntry USING(SID) WHERE (ShiftEntry.UID!=0) AND (Shifts.RID!=7)"); - -include ("includes/footer.php"); -?> -