Improved the table layout.
authorarjen <arjen>
Fri, 21 Feb 2003 08:46:58 +0000 (08:46 +0000)
committerarjen <arjen>
Fri, 21 Feb 2003 08:46:58 +0000 (08:46 +0000)
src/web/objects.php

index d7d7c33..e53e686 100644 (file)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 
 /**************************************************************************
 **  (c) Copyright 2003, Andromeda Technology & Automation
@@ -9,7 +9,7 @@
 ***********************
 **      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
@@ -46,7 +49,7 @@
 
 ******************************/
 
-// 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');
 
@@ -104,8 +107,14 @@ class object_page extends page
 
    $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
@@ -117,10 +126,10 @@ class object_page extends page
    {
       $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;
@@ -129,14 +138,14 @@ class object_page extends page
       $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 ?>'>
@@ -146,12 +155,12 @@ class object_page extends page
       <?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>";
 
 ?>