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.12 by pjm2, Sun Mar 11 21:38:57 2001 UTC vs.
Revision 1.23 by pjm2, Tue Mar 13 20:31:39 2001 UTC

# Line 10 | Line 10 | include("latest_config.inc.php");
10   #
11   # END CONFIGURATION
12  
13 + include("iutils.inc.php");
14  
14 # return an array of subdirectories from a directory.
15 function getdirArray($dir='./',$sort='asort') {
16    global $dir_file_count;
17    if ( is_dir($dir) ) {
18        $fd = @opendir($dir);
19        while ( ($part = @readdir($fd)) == TRUE ) {
20            clearstatcache();
21            if ($part != "." && $part != "..") {
22                $dir_array[] = $part;
23            }
24        }
25        if($fd == TRUE) {
26            closedir($fd);
27        }
28        if (is_array($dir_array)) {
29            $sort($dir_array);
30            $dir_file_count = count($dir_array);
31            Return $dir_array;
32        } else {
33            Return FALSE;
34        }
35    } else {
36        Return FALSE;
37    }
38 }
39
15   function printLine($title) {
16 <    echo "<hr color=\"#9999ff\">";
16 >    echo "<hr style=\"color:#9999ff;\">";
17      echo "<b>$title</b>";
18   }
19  
# Line 60 | Line 35 | function showStat($title, $value, $input) {
35   }
36  
37  
38 + function linkToHistory($report) {
39 +    global $machine;
40 +    $yesterday = date("Y-m-d", time() - 86400);
41 +    echo <<<EOT
42 +        <a href="browser.php?machine_name=$machine&report=$report&day=$yesterday&submit=Show"><img src="minichart.gif" alt="View yesterday's 24-hour chart" width="20" height="20" border="0"></a>
43 + EOT;
44 + }
45 +
46 +
47   # show a bar-represented value.
48 < function showBar($title, $value, $max, $input) {
48 > function showBar($title, $value, $max, $units, $input) {
49  
50      include("latest_config.inc.php");
51  
52 +    $report = $value;
53 +
54      preg_match("/$value=([^\,]*)\,/", $input, $matches);
55      $value = $matches[1];
56      if (!is_int($max)) {
# Line 80 | Line 66 | function showBar($title, $value, $max, $input) {
66      ?>
67          <table border="0" cellpadding="0" cellspacing="0" align="center">
68            <tr>
69 <            <td colspan="2"><b><?=$title?></b></td>
69 >            <td colspan="2"><? linkToHistory($report); ?> <b><?=$title?></b> <font size="2">(<?=$value?><?=$units?>)</font></td>
70            </tr>
71            <tr>
72              <td colspan="2" bgcolor="#eeeeff"><img src="<?=$barImage?>" border="0" height="20" width="<?=$width?>"></td>
# Line 89 | Line 75 | function showBar($title, $value, $max, $input) {
75              <td colspan="2"><img src="<?=$scaleImage?>" border="0" height="11" width="<?=$max_width?>"></td>
76            </tr>
77            <tr>
78 <            <td align="left">0</td>
79 <            <td align="right"><?=$max?></td>
78 >            <td align="left">0<?=$units?></td>
79 >            <td align="right"><?=$max?><?=$units?></td>
80            </tr>
81 +          <tr>
82 +            <td colspan="2">&nbsp;</td>
83 +          </tr>
84          </table>
85      <?
86   }
# Line 123 | Line 112 | function showBar($title, $value, $max, $input) {
112   <input type="submit" name="submit" value="Display">
113   </form>
114  
126 <hr weight="1" color="<? echo $lineColor ?>">
127
115   <? if ($machine) {
116  
117         $last_modified = filemtime("$latestDirectory/$machine/$latestData");
118         clearstatcache();
119         $data_age = time() - $last_modified;
120  
121 <       $last_modified = strftime("%a %d %b %Y at %T", $last_modified);
121 >       $last_modified = date("l jS F - g:ia", $last_modified);
122  
123         if ($data_age > $warning_age) {
124             $warning = <<<EOT
# Line 144 | Line 131 | EOT;
131         }
132  
133   echo <<<EOT
134 <       <table border="0" bgcolor="#000066" cellpadding="3" cellspacing="1" align="center">
134 >       <table border="0" bgcolor="#000066" cellpadding="3" cellspacing="1">
135           <tr>
136             <td bgcolor="#000066">
137               &nbsp;
# Line 172 | Line 159 | EOT;
159             # Display the data specified in the display include.
160             include("latest_display.inc.php");
161         }
175      
176       printLine("");
162     }
163  
164   ?>
165  
166 + <? printLine(""); ?>
167  
168   <? include($bottomHTML); ?>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines