ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/latest/latest.php
(Generate patch)

Comparing projects/cms/source/reports/php/latest/latest.php (file contents):
Revision 1.24 by pjm2, Tue Mar 13 20:55:43 2001 UTC vs.
Revision 1.27 by pjm2, Sat Mar 17 22:03:33 2001 UTC

# Line 54 | Line 54 | EOT;
54  
55  
56   # show a bar-represented value.
57 < function showBar($title, $value, $max, $units, $input) {
57 > function showBar($title, $value, $max, $units, $input, $arrange='normal') {
58  
59      include("latest_config.inc.php");
60  
# Line 70 | Line 70 | function showBar($title, $value, $max, $units, $input)
70          return;
71      }
72  
73 +    if ($arrange == 'swap') {
74 +        $value = $max - $value;
75 +    }
76 +
77      $width = intval($max_width * $value / $max);
78  
79      ?>
# Line 156 | Line 160 | echo <<<EOT
160   EOT;
161  
162         # Read the file.
163 <       #$input = "packet.attributes.machine_name=raptor.ukc.ac.uk,packet.memory.free=10,packet.memory.total=100,";
164 <       $input = file("$latestDirectory/$machine/$latestData");
165 <       # All we need is the first line if there is more than one line.
166 <       $input = $input[0];
163 >       if (file_exists("$latestDirectory/$machine/$latestData")) {
164 >           $input = file("$latestDirectory/$machine/$latestData");
165 >           # All we need is the first line if there is more than one line.
166 >           $input = $input[0];
167 >       }
168  
169         if (empty($input)) {
170 <           echo "<br><br>There was an error reading from the latest packet received.  Please notify your i-scream server administrator.";
170 >           echo "<br><br>There are currently no latest details about <b>$machine</b>.  Please notify your i-scream server administrator if you believe this to be incorrect.";
171         }
172         else {
173             # Display the data specified in the display include.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines