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.11 by pjm2, Fri Mar 9 09:30:54 2001 UTC vs.
Revision 1.15 by pjm2, Sun Mar 11 21:46:46 2001 UTC

# Line 52 | Line 52 | function showStat($title, $value, $input) {
52      ?>
53          <table border="0" width="100%">
54            <tr>
55 <            <td width="50%" align="right" valign="top"><b><font size="2"><?=$title?>:</font></b></td>
56 <            <td width="50%" align="left" valign="top"><font size="2"><?=$value?></font></td>
55 >            <td width="50%" align="right" valign="top"><b><?=$title?></b></td>
56 >            <td width="50%" align="left" valign="top"><?=$value?></td>
57            </tr>
58          </table>
59      <?
# Line 61 | Line 61 | function showStat($title, $value, $input) {
61  
62  
63   # show a bar-represented value.
64 < function showBar($title, $value, $max, $input) {
64 > function showBar($title, $value, $max, $units, $input) {
65  
66      include("latest_config.inc.php");
67  
# Line 80 | Line 80 | function showBar($title, $value, $max, $input) {
80      ?>
81          <table border="0" cellpadding="0" cellspacing="0" align="center">
82            <tr>
83 <            <td colspan="2"><b><?=$title?></b></td>
83 >            <td colspan="2"><b><?=$title?></b> <font size="2">(<?=$value?><?=$units?>)</font></td>
84            </tr>
85            <tr>
86              <td colspan="2" bgcolor="#eeeeff"><img src="<?=$barImage?>" border="0" height="20" width="<?=$width?>"></td>
# Line 89 | Line 89 | function showBar($title, $value, $max, $input) {
89              <td colspan="2"><img src="<?=$scaleImage?>" border="0" height="11" width="<?=$max_width?>"></td>
90            </tr>
91            <tr>
92 <            <td align="left">0</td>
93 <            <td align="right"><?=$max?></td>
92 >            <td align="left">0<?=$units?></td>
93 >            <td align="right"><?=$max?><?=$units?></td>
94            </tr>
95 +          <tr>
96 +            <td colspan="2">&nbsp;</td>
97 +          </tr>
98          </table>
99      <?
100   }
# Line 101 | Line 104 | function showBar($title, $value, $max, $input) {
104  
105   <? include($titleHTML); ?>
106  
107 < <? printLine("Display the latest information received from a host."); ?>
107 > <? printLine("Display the latest information received from a host"); ?>
108  
109   <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
110   <?
# Line 123 | Line 126 | function showBar($title, $value, $max, $input) {
126   <input type="submit" name="submit" value="Display">
127   </form>
128  
129 + <hr weight="1" color="<? echo $lineColor ?>">
130 +
131   <? if ($machine) {
132  
133 +       $last_modified = filemtime("$latestDirectory/$machine/$latestData");
134 +       clearstatcache();
135 +       $data_age = time() - $last_modified;
136 +
137 +       $last_modified = strftime("%a %d %b %Y at %T", $last_modified);
138 +
139 +       if ($data_age > $warning_age) {
140 +           $warning = <<<EOT
141 +               <br>
142 +               <font color="red"><b>
143 +                   Warning:
144 +               </b></font>
145 +                   This realtime report is too old to be considered recent
146 + EOT;
147 +       }
148 +
149 + echo <<<EOT
150 +       <table border="0" bgcolor="#000066" cellpadding="3" cellspacing="1" align="center">
151 +         <tr>
152 +           <td bgcolor="#000066">
153 +             &nbsp;
154 +           </td>
155 +           <td bgcolor="#ffffcc">
156 +             <font face="arial,sans-serif" size="2">
157 +               <b>Recipt date:</b> $last_modified
158 +               $warning
159 +             </font>
160 +           </td>
161 +         </tr>
162 +       </table>
163 + EOT;
164 +
165         # Read the file.
166         #$input = "packet.attributes.machine_name=raptor.ukc.ac.uk,packet.memory.free=10,packet.memory.total=100,";
167         $input = file("$latestDirectory/$machine/$latestData");
# Line 138 | Line 175 | function showBar($title, $value, $max, $input) {
175             # Display the data specified in the display include.
176             include("latest_display.inc.php");
177         }
178 +      
179 +       printLine("");
180     }
181 <   printLine("");
181 >
182   ?>
183  
184  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines