<?php
/**************************************************************************
+** (c) Copyright 2003, Andromeda Technology & Automation
** This is free software; you can redistribute it and/or modify it under the
** terms of the GNU General Public License, see the file COPYING.
-***************************************************************************/
-
-/*
- *
- * Objects Administration page.
- * Input parameters: action (POST) : empty, 'Create'
- * objname (POST) : name of the object to create or remove
- */
+***************************************************************************
+** MODULE INFORMATION *
+***********************
+** FILE NAME : objects.php
+** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
+** VERSION NUMBER : $Revision: 1.3 $
+**
+** DESCRIPTION : Objects Administration page.
+** Input parameters: action (POST) : empty, 'Create'
+** objname (POST) : name of the object to create or remove
+**
+** EXPORTED OBJECTS :
+** LOCAL OBJECTS :
+** MODULES USED :
+***************************************************************************
+** ADMINISTRATIVE INFORMATION *
+********************************
+** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
+** CREATION DATE : Dec 04, 2002
+** LAST UPDATE : Feb 03, 2003
+** MODIFICATIONS :
+**************************************************************************/
+
+/*****************************
+ $Log: objects.php,v $
+ Revision 1.3 2003-02-10 15:42:24 arjen
+ Show the total number of Log entries, parameters and notifications
+
+ Revision 1.2 2003/02/05 09:48:14 arjen
+ Added display and handling of notifications
+
+******************************/
+
+// RCSID = "$Id: objects.php,v 1.3 2003-02-10 15:42:24 arjen Exp $";
session_start();
require_once('classes/gnucomo_config.php');
echo "<table>";
$obj = 0;
+
+ //The counters are set to zero
+ $count_logs = 0;
+ $count_notifications = 0;
+ $count_parameters = 0;
+
while ($obj < pg_numrows($res))
{
$u = pg_fetch_object($res, $obj);
$r = pg_fetch_object($r, 0);
$nr_logs = $r->count;
+ $count_logs = $count_logs + $nr_logs;
$r = pg_exec ($conn, "SELECT count(paramid) FROM parameter WHERE objectid='"
. $u->objectid . "'");
$r = pg_fetch_object($r, 0);
$nr_params = $r->count;
+ $count_parameters = $count_parameters + $nr_params;
+
+ $r = pg_exec ($conn, "SELECT count(notificationid) FROM notification WHERE objectid='"
+ . $u->objectid . "'");
+ $r = pg_fetch_object($r, 0);
+
+ $nr_notifications = $r->count;
+ $count_notifications = $count_notifications + $nr_notifications;
?>
<tr><td align='center'><img src='server.png'><br>
<b><?php echo $u->objectname ?></b>
</td><td>
<?php echo $nr_params?> <a href='parameter.php?oid=<?php echo $u->objectid?>'>Parameters</a>
</td><td>
+ <?php echo $nr_notifications?> <a href='notification.php?oid=<?php echo $u->objectid?>'>Notifications</a>
+ </td><td>
<form action='objects.php' method='post' onSubmit='return CheckRemove(this)'>
<input type='hidden' name='objectname' value='<?php echo $u->objectname ?>'>
<input type='submit' name='action' value='Remove'>
<?php
$obj++;
}
+
+ //Show the totals
+ echo "<tr><td><strong><br><br>TOTALS</strong></td>";
+ echo "<td>$count_logs Log entries</td>";
+ echo "<td>$count_parameters Parameters</td>";
+ echo "<td>$count_notifications Notifications</td></tr>";
echo "</table>";
}