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.31 by pjm2, Thu Mar 8 20:55:29 2001 UTC vs.
Revision 1.40 by pjm2, Wed Mar 21 18:48:27 2001 UTC

# Line 5 | Line 5
5   #
6   # CONFIGURABLE CONSTANTS: -
7  
8 < # The report directory, and the number of days to display.
9 < $reportDirectory = "/home/cut/pjm2/webpages/reports/historical";
10 < $maxDaysShown = 7;
8 > include("browser_config.inc.php");
9  
12 # Page appearance.
13 $scaleImage = "24hour.gif";
14 $lineColor = "#9999ff";
15
16 # Files to include
17 $titleHTML = "title.inc";
18 $bottomHTML = "bottom.inc";
19 $machineNameHTML = "machine_name.inc";
20 $reportHTML = "report.inc";
21
22 # What are the names of the report files?
23 $reportLimitsFile = "i-maxmin.txt";
24 $reportChartFile = "i-chart.gif";
25 $reportChartDataFile = "i-data.txt";
26
27 # Submission details.
28 $formMethod = "GET";
29 $thisPage = "browser.php";
30
31 # Leave this alone unless you know what you're doing ;)
32 $minFileSize = 33;
33
10   #
11   # END CONFIGURATION
12  
# Line 47 | Line 23 | function isReportEmpty($filename, $minFileSize) {
23   }
24  
25  
26 < # return an array of subdirectories in the current directory.
51 < function getdirArray($dir='./',$sort='asort') {
52 <    global $dir_file_count;
53 <    if ( is_dir($dir) ) {
54 <        $fd = @opendir($dir);
55 <        while ( ($part = @readdir($fd)) == TRUE ) {
56 <            clearstatcache();
57 <            if ($part != "." && $part != "..") {
58 <                if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $part)) {
59 <                    $dir_array[] = $part;
60 <                }
61 <            }
62 <        }
63 <        if($fd == TRUE) {
64 <            closedir($fd);
65 <        }
66 <        if (is_array($dir_array)) {
67 <            $sort($dir_array);
68 <            $dir_file_count = count($dir_array);
69 <            Return $dir_array;
70 <        } else {
71 <            Return FALSE;
72 <        }
73 <    } else {
74 <        Return FALSE;
75 <    }
76 < }
26 > include("iutils.inc.php");
27  
28   ?>
29  
# Line 92 | Line 42 | function getdirArray($dir='./',$sort='asort') {
42          <option value="">----------------</option>
43      <? }
44      foreach($file_array as $file_name) {
45 <        if (is_dir($file_name)) {
45 >        #if (is_dir($file_name)) {
46 >        if (preg_match("/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/", $file_name)) {
47              $i++;
48              print "<option value=\"$file_name\">$file_name</option>";
49          }
# Line 120 | Line 71 | function getdirArray($dir='./',$sort='asort') {
71        <? } else { ?>
72          <option selected value="">[select machine]</option>
73        <? } ?>
74 <      <? include("$day/$machineNameHTML"); ?>
74 >      <? include("$reportDirectory/$day/$machineNameHTML"); ?>
75       </select>
76  
77       <select size="1" name="report">
# Line 130 | Line 81 | function getdirArray($dir='./',$sort='asort') {
81        <? } else { ?>
82          <option selected value="">[select report]</option>
83        <? } ?>
84 <      <? include("$day/$reportHTML"); ?>
84 >      <? include("$reportDirectory/$day/$reportHTML"); ?>
85       </select>
86  
87       <input type="hidden" name="day" value="<? echo $day ?>">
# Line 147 | Line 98 | function getdirArray($dir='./',$sort='asort') {
98   <?
99      if ($submit == "Show" && $machine_name && $report) {
100          
101 <        include("$day/$machine_name/$report/$reportLimitsFile");
102 <        
152 <        $url = escapeshellcmd("$day/$machine_name/$report/$reportChartFile");
153 <        if (isReportEmpty("$day/$machine_name/$report/$reportChartDataFile", $minFileSize)) {
101 >        $url = "$webRoot/$day/$machine_name/$report/$reportChartFile";
102 >        if (isReportEmpty("$reportDirectory/$day/$machine_name/$report/$reportChartDataFile", $minFileSize)) {
103              echo "Host <b>$machine_name</b> did not send any information about <b>$report</b> on <b>$day</b>.  Please select another report.";
104          }
105 <        else if (file_exists($url)) {  ?>
106 <          
105 >        else if (file_exists("$reportDirectory/$day/$machine_name/$report/$reportChartFile")) {  
106 >
107 >            include("$reportDirectory/$day/$machine_name/$report/$reportLimitsFile");
108 >            
109 >            ?>
110 >            
111              <center><b>[<? echo $machine_name; ?>] - <? echo $report; ?></b></center>
112            
113              <table border="0" cellpadding="0" cellspacing="0">
# Line 177 | Line 130 | function getdirArray($dir='./',$sort='asort') {
130               </tr>
131              </table>
132              
133 <            <hr weigth="1" color="<? echo $lineColor ?>">
133 >            <hr weight="1" color="<? echo $lineColor ?>">
134              
135 +            <b>Latest data</b>
136 +            <p>
137 +            Latest set of data received from
138 +            <a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a>
139 +            <br>
140 +            Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a>
141 +
142 +
143 +            <hr weight="1" color="<? echo $lineColor ?>">
144 +            
145              <b>Extra data</b>
146              <p>
147 <            <a href="<? echo "$day/$machine_name/$report/$reportChartDataFile" ?>">Raw plot data</a><br>
148 <            <a href="<? echo "$day/$machine_name/$report/$reportChartFile" ?>">GIF chart</a><br>
149 <            <a href="<? echo "$day/$machine_name/$report/$reportLimitsFile" ?>">PHP y-axis limits include</a>
147 >            <a href="<? echo "$webRoot/$day/$machine_name/$report/$reportChartDataFile" ?>">Raw plot data</a><br>
148 >            <a href="<? echo "$webRoot/$day/$machine_name/$report/$reportChartFile" ?>">GIF chart</a><br>
149 >            <a href="<? echo "$webRoot/$day/$machine_name/$report/$reportLimitsFile" ?>">PHP y-axis limits include</a>
150              
151          <? }
152          else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines