diff --git a/includes/model/LogEntries_model.php b/includes/model/LogEntries_model.php index d8615f0e..5659c0ee 100644 --- a/includes/model/LogEntries_model.php +++ b/includes/model/LogEntries_model.php @@ -6,10 +6,15 @@ * @param $message Log Message */ function LogEntry_create($nick, $message) { - $timestamp = date(); + $timestamp = time(); sql_query("INSERT INTO `LogEntries` SET `timestamp`=" . sql_escape($timestamp) . ", `nick`='" . sql_escape($nick) . "', `message`='" . sql_escape($message) . "'"); } +function LogEntries() { + $log_entries_source = sql_select("SELECT * FROM `LogEntries` WHERE `timestamp` > " . (time() - 24*60*60) . " LIMIT 1000"); + return $log_entries_source; +} + ?> \ No newline at end of file diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index 4a29a496..ce30a246 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -1,76 +1,20 @@ 0) { - $html .= "\n"; - $html .= "\n\t\n\t\n\t\n\t\n\n"; - for ($n = 0; $n < mysql_num_rows($Erg); $n++) { - $html .= "\n"; - $html .= "\t\n"; - $html .= "\t\n"; - $html .= "\t\n"; - $html .= "\t\n"; - $html .= "\n"; - } - $html .= "
TimeUserCommendSQL Command
" . mysql_result($Erg, $n, "Time") . "" . UID2Nick(mysql_result($Erg, $n, "UID")) . displayavatar(mysql_result($Erg, $n, "UID")) . "" . mysql_result($Erg, $n, "Commend") . "" . mysql_result($Erg, $n, "SQLCommad") . "
\n"; - } else { - $html .= "Log is empty..."; - } - $html .= "
"; - - $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("Geleistete 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 Aufbau (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("Geleistete Arbeit (Ohne Raum Aufbau (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; + return page(array( + msg(), + table(array( + 'date' => "Time", + 'nick' => "Angel", + 'message' => "Log Entry" + ), $log_entries) + )); } ?> diff --git a/public/index.php b/public/index.php index bd7e552d..a7efbd86 100644 --- a/public/index.php +++ b/public/index.php @@ -11,6 +11,9 @@ require_once ('includes/sys_shift.php'); require_once ('includes/sys_template.php'); require_once ('includes/sys_user.php'); +require_once ('includes/model/LogEntries_model.php'); +require_once ('includes/model/User_model.php'); + require_once ('config/config.php'); require_once ('config/config_db.php');