, and &) into their entities. Revision 1.4 2003/07/15 11:03:39 arjen Show the log one day at a time. Revision 1.3 2003/02/21 08:50:12 arjen Database optimizations. Revision 1.2 2003/02/13 09:01:29 arjen All web interface pages use the page class. Revision 1.2 2003/02/05 09:48:14 arjen Added display and handling of notifications ******************************/ // RCSID = "$Id: log.php,v 1.8 2007-11-21 14:38:06 arjen Exp $"; ini_set('include_path', '.:./classes:../phpclasses'); require_once('page.class.php'); class log_page extends page { function Body() { if (!empty($_GET['oid'])) { $oid = $_GET['oid']; $res = pg_exec($this->database, "SELECT objectname FROM object WHERE objectid=CAST('$oid' AS BIGINT)"); $obj = pg_fetch_object($res, 0); echo ""; // Determine which day to display. // This is either from a previous button though a _POST[] variable // or the last day in the log table by default. if (empty($_GET['logday'])) { $res = pg_exec($this->database, "SELECT date_trunc('day',object_timestamp) FROM log WHERE objectid='$oid' ORDER BY object_timestamp DESC LIMIT 1"); if( pg_num_rows($res) > 0 ) { $last_time = pg_fetch_object($res, 0); $logday = strtotime($last_time->date_trunc); } else { $logday = ""; } } else { $logday = $_GET['logday']; } // Make buttons to request the previous and the next day of logs. echo "
"; $logday1 = $logday - 24 * 60 * 60; echo "<<"; echo " " . date('F d, Y', $logday) . " "; $logday2 = $logday + 24 * 60 * 60; echo ">>"; echo "
"; // Show the log for one day only. $res = pg_exec($this->database, "SELECT logid, object_timestamp, servicecode, rawdata FROM log " ."WHERE objectid = CAST('$oid' AS BIGINT) AND date_trunc('day', object_timestamp)='" . date('Y-m-d', $logday) . "' ORDER BY object_timestamp, logid"); echo "\n"; echo "\n"; $row = 0; while ($row < pg_numrows($res)) { $log = pg_fetch_object($res, $row); ?> "; } } } $page = new log_page("Gnucomo system logs"); $page->Showpage(); ?>
DateServiceLog
object_timestamp?> servicecode?> rawdata)?>