| 70 |
|
} |
| 71 |
|
|
| 72 |
|
function printReports($machine) { |
| 73 |
< |
# Get a list of all files in the machine's directory. |
| 74 |
< |
include("alerts_config.inc.php"); |
| 75 |
< |
$alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); |
| 73 |
> |
# Get a list of all files in the machine's directory. |
| 74 |
> |
include("alerts_config.inc.php"); |
| 75 |
> |
$alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); |
| 76 |
> |
|
| 77 |
> |
echo <<<EOT |
| 78 |
> |
<center> |
| 79 |
> |
<font size="4"> |
| 80 |
> |
<b> |
| 81 |
> |
Current alerts for $machine |
| 82 |
> |
</b> |
| 83 |
> |
</font> |
| 84 |
> |
<font size="2"> |
| 85 |
> |
<br>Sorted by time, latest first. |
| 86 |
> |
</font> |
| 87 |
> |
</center> |
| 88 |
> |
|
| 89 |
> |
EOT; |
| 90 |
> |
|
| 91 |
> |
printLine(""); |
| 92 |
> |
|
| 93 |
> |
foreach($alertArray as $file_name) { |
| 94 |
> |
$input = file("$alertDirectory/$machine/$file_name"); |
| 95 |
> |
$input = $input[0]; |
| 96 |
> |
$alerts[] = $input; |
| 97 |
> |
} |
| 98 |
|
|
| 99 |
< |
foreach($alertArray as $file_name) { |
| 100 |
< |
$input = file("$alertDirectory/$machine/$file_name"); |
| 101 |
< |
$input = $input[0]; |
| 80 |
< |
$alerts[] = $input; |
| 81 |
< |
} |
| 82 |
< |
|
| 83 |
< |
foreach ($alerts as $alert) { |
| 84 |
< |
printAlert($machine, $alert); |
| 85 |
< |
} |
| 99 |
> |
foreach ($alerts as $alert) { |
| 100 |
> |
printAlert($machine, $alert); |
| 101 |
> |
} |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
|