, 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.5 2003-08-11 17:59:17 arjen Exp $";
ini_set('include_path', '.:./classes:../phpclasses');
require_once('page.class.php');
class log_page extends page
{
function Body()
{
if (!empty($_GET['oid']))
{
$res = pg_exec($this->database, "SELECT objectname FROM object
WHERE objectid=CAST('" . $_GET['oid']. "' AS BIGINT)");
$obj = pg_fetch_object($res, 0);
echo "
Log for " . $obj->objectname . "
";
// 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($_POST['logday']))
{
$res = pg_exec($this->database, "SELECT date_trunc('day',object_timestamp) FROM log
WHERE objectid='". $_GET['oid'] ."'
ORDER BY object_timestamp DESC LIMIT 1");
$last_time = pg_fetch_object($res, 0);
$logday = strtotime($last_time->date_trunc);
}
else
{
$logday = $_POST['logday'];
}
// Make buttons to request the previous and the next day of logs.
echo "";
echo "" . date('F d, Y', $logday) ."
";
echo "";
// Show the log for one day only.
$res = pg_exec($this->database, "SELECT object_timestamp, servicecode, rawdata FROM log "
."WHERE objectid = CAST('" . $_GET['oid'] . "' AS BIGINT)
AND date_trunc('day', object_timestamp)='" . date('Y-m-d', $logday) . "'
ORDER BY object_timestamp, logid");
echo "\n";
echo "Date | Service | Log |
\n";
$row = 0;
while ($row < pg_numrows($res))
{
$log = pg_fetch_object($res, $row);
?>
object_timestamp?>
|
servicecode?>
|
rawdata)?>
|
";
}
}
}
$page = new log_page("Gnucomo system logs");
$page->Showpage();
?>