ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/reports/graphing/browser2.php
Revision: 1.2
Committed: Sun Mar 10 23:47:22 2002 UTC (22 years, 2 months ago) by tdb
Branch: MAIN
Changes since 1.1: +14 -26 lines
Log Message:
Represent the "types" with nicer names now. Also put bits into the config.

File Contents

# User Rev Content
1 tdb 1.1 <?php
2    
3 tdb 1.2 # Navigation for the i-scream graphs
4     # tim@i-scream.org.uk
5 tdb 1.1 #
6     # CONFIGURABLE CONSTANTS: -
7    
8     include("browser2_config.inc.php");
9    
10     #
11     # END CONFIGURATION
12    
13    
14     include("iutils.inc.php");
15    
16     ?>
17    
18     <? include($titleHTML); ?>
19    
20     <hr weight="1" color="<? echo $lineColor ?>">
21    
22     <b>Graphs available for these machines:</b>
23    
24     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
25     <select size="1" name="machine_name">
26     <? if ($machine_name) { ?>
27     <option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option>
28     <option value="">----------------</option>
29     <? } else { ?>
30     <option selected value="">[select machine]</option>
31     <? } ?>
32     <?
33 tdb 1.2 $file_array = getdirArray($imgdir,'asort');
34 tdb 1.1 foreach($file_array as $file_name) {
35 tdb 1.2 if(is_dir("$imgdir/$file_name")) { ?>
36 tdb 1.1 <option value="<? echo $file_name ?>"><? echo $file_name ?></option>
37     <? }
38     }
39     ?>
40     </select>
41    
42     <input type="submit" name="submit" value="Go">
43     </form>
44    
45     <hr weight="1" color="<? echo $lineColor ?>">
46    
47     <? if ($machine_name) { ?>
48    
49     <b>Available graphs for <? echo $machine_name ?></b>
50    
51     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
52     <select size="1" name="graph">
53 tdb 1.2 <? if ($graph) { ?>
54     <option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option>
55 tdb 1.1 <option value="">----------------</option>
56     <? } else { ?>
57 tdb 1.2 <option selected value="">[select graph]</option>
58 tdb 1.1 <? } ?>
59     <?
60 tdb 1.2 $file_array = getdirArray("$imgdir/$machine_name",'asort');
61 tdb 1.1 foreach($file_array as $file_name) {
62     if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?>
63 tdb 1.2 <option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option>
64 tdb 1.1 <? }
65     }
66     ?>
67     </select>
68    
69     <input type="hidden" name="machine_name" value="<? echo $machine_name ?>">
70     <input type="submit" name="submit" value="Show">
71     </form>
72    
73     <hr weight="1" color="<? echo $lineColor ?>">
74    
75     <? } ?>
76    
77     </p>
78    
79    
80     <?
81     if ($submit == "Show" && $machine_name && $graph) {
82    
83     ?>
84 tdb 1.2 <center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center>
85 tdb 1.1
86     <center>
87 tdb 1.2 <p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p>
88     <p><b>Last day :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p>
89     <p><b>Last week :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p>
90     <p><b>Last month :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p>
91 tdb 1.1 </center>
92    
93     <hr weight="1" color="<? echo $lineColor ?>">
94    
95     <b>Latest data</b>
96     <p>
97     Latest set of data received from
98     <a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a>
99     <br>
100     Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a>
101    
102    
103     <hr weight="1" color="<? echo $lineColor ?>">
104     <? }
105    
106     ?>
107    
108     <? include($bottomHTML); ?>