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

Comparing projects/cms/source/reports/php/historical/browser.php (file contents):
Revision 1.11 by pjm2, Sun Feb 25 16:21:19 2001 UTC vs.
Revision 1.15 by pjm2, Fri Mar 2 09:25:05 2001 UTC

# Line 3 | Line 3
3   // Navigation for the i-scream reports.
4   // pjm2@ukc.ac.uk
5  
6 + # CONSTANTS
7  
8 + $minFileSize = 33;
9 +
10 +
11 + function isReportEmpty($filename) {
12 +    if (filesize($filename) < minFileSize) {
13 +        return TRUE;
14 +    }
15 +    return FALSE;
16 + }
17 +
18   function getdirArray($dir='./',$sort='asort') {
19      global $dir_file_count;
20      if ( is_dir($dir) ) {
# Line 36 | Line 47 | function getdirArray($dir='./',$sort='asort') {
47   <hr weight="1" color="#9999ff">
48  
49   <b>Most recent reports available</b>
50 < <form method="GET" action="">
50 > <form method="GET" action="browser.php">
51   <?
52  
53      $file_array = getdirArray('/home/cut/pjm2/webpages/reports','rsort');
# Line 62 | Line 73 | function getdirArray($dir='./',$sort='asort') {
73  
74      <b>Available reports for <? echo $day ?></b>
75  
76 <    <form method="GET" action="">
76 >    <form method="GET" action="browser.php">
77       <select size="1" name="machine_name">
78 <      <option selected value="">[select machine]</option>
78 >      <? if ($machine_name) { ?>
79 >        <option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option>
80 >        <option value="">----------------</option>
81 >      <? } else { ?>
82 >        <option selected value="">[select machine]</option>
83 >      <? } ?>
84        <? include("$day/machine_name.inc"); ?>
85       </select>
86  
87       <select size="1" name="report">
88 <      <option selected value="">[select report]</option>
88 >      <? if ($report) { ?>
89 >        <option selected value="<? echo $report ?>"><? echo $report ?></option>
90 >        <option value="">----------------</option>
91 >      <? } else { ?>
92 >        <option selected value="">[select report]</option>
93 >      <? } ?>
94        <? include("$day/report.inc"); ?>
95       </select>
96  
# Line 89 | Line 110 | function getdirArray($dir='./',$sort='asort') {
110          
111          include("$day/$machine_name/$report/i-maxmin.txt");
112          
113 <        $url = escapeshellcmd("$day/$machine_name/$report/chart.gif");
114 <        if (file_exists($url)) {  ?>
113 >        $url = escapeshellcmd("$day/$machine_name/$report/i-chart.gif");
114 >        if (isReportEmpty("$day/$machine_name/$report/i-data.txt")) {
115 >            echo "Host <b>$machine_name</b> did not send any information about <b>$report</b> on <b>$day</b>.  Please select another report.";
116 >        }
117 >        else if (file_exists($url)) {  ?>
118            
119              <center><b>[<? echo $machine_name; ?>] - <? echo $report; ?></b></center>
120            
# Line 124 | Line 148 | function getdirArray($dir='./',$sort='asort') {
148              
149          <? }
150          else {
151 <            echo "<p>The report could not be found.</p>";
151 >            echo "<p>The report could not be found.  Somebody must have deleted it!</p>";
152          }
153          echo "<hr weight=\"1\" color=\"#9999ff\">";
154      }
155      
156   ?>
157  
158 < <? include("bottom.inc"); ?>
158 > <? include("bottom.inc"); ?>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines