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

Comparing projects/cms/source/reports/php/alerts/alerts.php (file contents):
Revision 1.14 by pjm2, Wed Mar 21 12:07:59 2001 UTC vs.
Revision 1.21 by pjm2, Wed Mar 21 17:41:31 2001 UTC

# Line 26 | Line 26 | function printAlert($machine, $alert, $small="") {
26  
27      include("alerts_config.inc.php");
28  
29 <    $alertLevel = getValue("alertLevel", $alert);
29 >    $alertLevelNum = getValue("alertLevel", $alert);
30      $lastAlert = getValue("lastAlert", $alert);
31      $thresholdLevel = getValue("thresholdLevel", $alert);
32      $source = getValue("source", $alert);
# Line 36 | Line 36 | function printAlert($machine, $alert, $small="") {
36      $timeTillNextAlert = getValue("timeTillNextAlert", $alert);
37      $initialAlertTime = getValue("initialAlertTime", $alert);
38  
39 <    $alertColour = $alertLevelColours[$alertLevel];
40 <    $alertLevel = $alertLevelNames[$alertLevel];
39 >    $alertColour = $alertLevelColours[$alertLevelNum];
40 >    $alertLevel = $alertLevelNames[$alertLevelNum];
41      $initialAlertTime = strftime("%x %X", intval($initialAlertTime / 1000));
42  
43      if ($small == "true") {
44 <        echo "small";
44 >        echo <<<EOT
45 >            <tr>
46 >             <td width="50">
47 >              &nbsp;
48 >             </td>
49 >             <td align="left">
50 >              <img src="level$alertLevelNum.gif" width="41" height="9" border="0" alt="$alertLevel">
51 >             </td>
52 >             <td align="left">
53 >              <font size="3" color="$alertColour"><b>$alertLevel</b></font>
54 >             </td>
55 >             <td align="left">
56 >              <font size="3">$attributeName</font>
57 >             </td>
58 >             <td>
59 >              &nbsp;
60 >             </td>
61 >            </tr>
62 > EOT;
63      }
64      else {
65          echo <<<EOT
# Line 50 | Line 68 | function printAlert($machine, $alert, $small="") {
68            <tr>
69              <td><b>$attributeName</b></td>
70              <td>&nbsp;</td>
71 <            <td><font color="$alertColour" size="2"><b>$alertLevel</b></font></td>
71 >            <td>
72 >              <img src="level$alertLevelNum.gif" width="41" height="9" border="0" alt="$alertLevel">
73 >              <font color="$alertColour" size="2"><b>$alertLevel</b></font>
74 >            </td>
75              <td>&nbsp;</td>
76            </tr>
77            <tr>
# Line 79 | Line 100 | function printReports($machine, $small="") {
100      $alertArray = getdirArray("$alertDirectory/$machine", 'rsort');
101    
102      if ($small == "true") {
103 <        
103 >        echo <<<EOT
104 >           <table border="0" cellpadding="2" cellspacing="0">
105 >            <tr>
106 >             <td colspan="5">
107 >              <font size="+1"><b>$machine</b></font>
108 >             </td>
109 >            </tr>
110 > EOT;
111      }
112      else {
113          echo <<<EOT
# Line 118 | Line 146 | EOT;
146          }
147      }
148      else {
149 <        echo "There are currently no alerts held about <b>$machine</b>";
150 <        printLine("");
149 >        if ($small != "true") {
150 >            echo "There are currently no alerts held about <b>$machine</b>";
151 >            printLine("");
152 >        }
153      }
154  
155      if ($small == "true") {
156 <        
156 >        echo "</table>";
157      }
158      else {
159          echo <<<EOT
# Line 139 | Line 169 | EOT;
169  
170   <? include($titleHTML); ?>
171  
172 < <? printLine("Display the latest alerts for a host"); ?>
172 > <? if (!$hideform) { ?>
173  
174 + <? printLine("Latest alerts for hosts"); ?>
175 +
176   <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
177   <?
178  
# Line 161 | Line 193 | EOT;
193   <input type="hidden" name="small" value="<?=$small?>">
194   <input type="submit" name="submit" value="Display">
195   </form>
196 +
197 + <? } ?>
198  
199   <? if ($machine) {
200  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines