| 4 |
|
// pjm2@ukc.ac.uk |
| 5 |
|
|
| 6 |
|
|
| 7 |
+ |
function isReportEmpty($filename) { |
| 8 |
+ |
if (filesize($filename) < 33) { |
| 9 |
+ |
return TRUE; |
| 10 |
+ |
} |
| 11 |
+ |
return FALSE; |
| 12 |
+ |
} |
| 13 |
+ |
|
| 14 |
|
function getdirArray($dir='./',$sort='asort') { |
| 15 |
|
global $dir_file_count; |
| 16 |
|
if ( is_dir($dir) ) { |
| 43 |
|
<hr weight="1" color="#9999ff"> |
| 44 |
|
|
| 45 |
|
<b>Most recent reports available</b> |
| 46 |
< |
<form method="GET" action=""> |
| 46 |
> |
<form method="GET" action="browser.php"> |
| 47 |
|
<? |
| 48 |
|
|
| 49 |
|
$file_array = getdirArray('/home/cut/pjm2/webpages/reports','rsort'); |
| 69 |
|
|
| 70 |
|
<b>Available reports for <? echo $day ?></b> |
| 71 |
|
|
| 72 |
< |
<form method="GET" action=""> |
| 72 |
> |
<form method="GET" action="browser.php"> |
| 73 |
|
<select size="1" name="machine_name"> |
| 74 |
< |
<option selected value="">[select machine]</option> |
| 74 |
> |
<? if ($machine_name) { ?> |
| 75 |
> |
<option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option> |
| 76 |
> |
<option value="">----------------</option> |
| 77 |
> |
<? } else { ?> |
| 78 |
> |
<option selected value="">[select machine]</option> |
| 79 |
> |
<? } ?> |
| 80 |
|
<? include("$day/machine_name.inc"); ?> |
| 81 |
|
</select> |
| 82 |
|
|
| 83 |
|
<select size="1" name="report"> |
| 84 |
< |
<option selected value="">[select report]</option> |
| 84 |
> |
<? if ($report) { ?> |
| 85 |
> |
<option selected value="<? echo $report ?>"><? echo $report ?></option> |
| 86 |
> |
<option value="">----------------</option> |
| 87 |
> |
<? } else { ?> |
| 88 |
> |
<option selected value="">[select report]</option> |
| 89 |
> |
<? } ?> |
| 90 |
|
<? include("$day/report.inc"); ?> |
| 91 |
|
</select> |
| 92 |
|
|
| 106 |
|
|
| 107 |
|
include("$day/$machine_name/$report/i-maxmin.txt"); |
| 108 |
|
|
| 109 |
< |
$url = escapeshellcmd("$day/$machine_name/$report/chart.gif"); |
| 110 |
< |
if (file_exists($url)) { ?> |
| 109 |
> |
$url = escapeshellcmd("$day/$machine_name/$report/i-chart.gif"); |
| 110 |
> |
if (isReportEmpty("$day/$machine_name/$report/i-data.txt")) { |
| 111 |
> |
echo "Host <b>$machine_name</b> did not send any information about <b>$report</b> on <b>$day</b>. Please select another report."; |
| 112 |
> |
} |
| 113 |
> |
else if (file_exists($url)) { ?> |
| 114 |
|
|
| 115 |
|
<center><b>[<? echo $machine_name; ?>] - <? echo $report; ?></b></center> |
| 116 |
|
|
| 151 |
|
|
| 152 |
|
?> |
| 153 |
|
|
| 154 |
< |
<? include("bottom.inc"); ?> |
| 154 |
> |
<? include("bottom.inc"); ?> |