ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/graphs/graphs.php
Revision: 1.1
Committed: Mon Mar 18 13:24:31 2002 UTC (22 years, 8 months ago) by tdb
Branch: MAIN
Log Message:
Merged in the code from the experimental tree. Still a few more things that
I'd like to do, but it's all working now, which is good.

File Contents

# User Rev Content
1 tdb 1.1 <?php
2    
3     # Navigation for the i-scream graphs
4     # tim@i-scream.org.uk
5     #
6     # CONFIGURABLE CONSTANTS: -
7    
8     include("graphs_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     $file_array = getdirArray($imgdir,'asort');
34     foreach($file_array as $file_name) {
35     if(is_dir("$imgdir/$file_name")) { ?>
36     <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     <? if ($graph) { ?>
54     <option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option>
55     <option value="">----------------</option>
56     <? } else { ?>
57     <option selected value="">[select graph]</option>
58     <? } ?>
59     <?
60     $file_array = getdirArray("$imgdir/$machine_name",'asort');
61     foreach($file_array as $file_name) {
62     if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?>
63     <option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option>
64     <? }
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     <center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center>
85    
86     <center>
87     <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     <p><b>Last year :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p>
92     </center>
93    
94     <hr weight="1" color="<? echo $lineColor ?>">
95    
96     <b>Latest data</b>
97     <p>
98     Latest set of data received from
99     <a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a>
100     <br>
101     Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a>
102    
103    
104     <hr weight="1" color="<? echo $lineColor ?>">
105     <? }
106    
107     ?>
108    
109     <? include($bottomHTML); ?>