-<?php
+<?php
/**************************************************************************
** (c) Copyright 2003, Andromeda Technology & Automation
***********************
** FILE NAME : objects.php
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.5 $
+** VERSION NUMBER : $Revision: 1.6 $
**
** DESCRIPTION : Objects Administration page.
** Input parameters: action (POST) : empty, 'Create'
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Dec 04, 2002
-** LAST UPDATE : Feb 08, 2003
+** LAST UPDATE : Feb 14, 2003
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: objects.php,v $
- Revision 1.5 2003-02-13 09:01:29 arjen
+ Revision 1.6 2003-02-21 08:46:58 arjen
+ Improved the table layout.
+
+ Revision 1.5 2003/02/13 09:01:29 arjen
All web interface pages use the page class.
Revision 1.4 2003/02/13 08:48:23 arjen
******************************/
-// RCSID = "$Id: objects.php,v 1.5 2003-02-13 09:01:29 arjen Exp $";
+// RCSID = "$Id: objects.php,v 1.6 2003-02-21 08:46:58 arjen Exp $";
ini_set('include_path', '.:./classes:../phpclasses');
$res = pg_exec($this->database, "SELECT objectid,objectname, log_count, notification_count
FROM object ORDER BY objectname");
+?>
+
+ <table>
+ <tr><th>Object</th><th>Log entries</th>
+ <th>Parameters</th><th>Notifications</th>
+ </tr>
- echo "<table>";
+<?php
$obj = 0;
//The counters are set to zero
{
$u = pg_fetch_object($res, $obj);
$nr_logs = $u->log_count;
- $count_logs = $count_logs + $nr_logs;
+ $count_logs = $count_logs + $nr_logs;
- $r = pg_exec ($this->database, "SELECT count(paramid) FROM parameter WHERE objectid='"
- . $u->objectid . "'");
+ $r = pg_exec ($this->database, "SELECT count(paramid) FROM parameter WHERE objectid=CAST('"
+ . $u->objectid . "' AS BIGINT)");
$r = pg_fetch_object($r, 0);
$nr_params = $r->count;
$nr_notifications = $u->notification_count;
$count_notifications = $count_notifications + $nr_notifications;
?>
- <tr><td align='center'><img src='server.png'><br>
- <b><?php echo $u->objectname ?></b>
- </td><td align='right'>
- <?php echo $nr_logs?> <a href='log.php?oid=<?php echo $u->objectid?>'>Log entries</a>
- </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>
+ <tr><td><center><img src='server.png'><br>
+ <b><?php echo $u->objectname ?></b></center>
+ </td><td class='number'>
+ <?php echo "<a href='log.php?oid=$u->objectid'> $nr_logs </a>" ?>
+ </td><td class='number'>
+ <?php echo "<a href='parameter.php?oid=$u->objectid'> $nr_params </a>" ?>
+ </td><td class='number'>
+ <?php echo "<a href='notification.php?oid=$u->objectid'> $nr_notifications </a>" ?>
</td><td>
<form action='objects.php' method='post' onSubmit='return CheckRemove(this)'>
<input type='hidden' name='objectname' value='<?php echo $u->objectname ?>'>
<?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 "<tr><td><strong><B><br><br>TOTALS</B></strong></td>";
+ echo "<td class='number'>$count_logs</td>";
+ echo "<td class='number'>$count_parameters</td>";
+ echo "<td class='number'>$count_notifications</td></tr>";
echo "</table>";
?>