# | Line 4 | Line 4 | |
---|---|---|
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) ) { | |
# | Line 64 | Line 71 | function getdirArray($dir='./',$sort='asort') { | |
71 | ||
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 | ||
# | Line 90 | Line 107 | function getdirArray($dir='./',$sort='asort') { | |
107 | include("$day/$machine_name/$report/i-maxmin.txt"); | |
108 | ||
109 | $url = escapeshellcmd("$day/$machine_name/$report/i-chart.gif"); | |
110 | < | if (file_exists($url)) { ?> |
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 | ||
# | Line 131 | Line 151 | function getdirArray($dir='./',$sort='asort') { | |
151 | ||
152 | ?> | |
153 | ||
154 | < | <? include("bottom.inc"); ?> |
154 | > | <? include("bottom.inc"); ?> |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |