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.3
Committed: Tue May 21 16:47:15 2002 UTC (22 years, 5 months ago) by tdb
Branch: MAIN
Changes since 1.2: +1 -0 lines
Log Message:
Added URL to GPL headers.

File Contents

# User Rev Content
1 tdb 1.1 <?php
2    
3 tdb 1.2 #
4     # i-scream central monitoring system
5 tdb 1.3 # http://www.i-scream.org.uk
6 tdb 1.2 # Copyright (C) 2000-2002 i-scream
7     #
8     # This program is free software; you can redistribute it and/or
9     # modify it under the terms of the GNU General Public License
10     # as published by the Free Software Foundation; either version 2
11     # of the License, or (at your option) any later version.
12     #
13     # This program is distributed in the hope that it will be useful,
14     # but WITHOUT ANY WARRANTY; without even the implied warranty of
15     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     # GNU General Public License for more details.
17     #
18     # You should have received a copy of the GNU General Public License
19     # along with this program; if not, write to the Free Software
20     # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21     #
22    
23 tdb 1.1 # Navigation for the i-scream graphs
24     # tim@i-scream.org.uk
25     #
26     # CONFIGURABLE CONSTANTS: -
27    
28     include("graphs_config.inc.php");
29    
30     #
31     # END CONFIGURATION
32    
33    
34     include("iutils.inc.php");
35    
36     ?>
37    
38     <? include($titleHTML); ?>
39    
40     <hr weight="1" color="<? echo $lineColor ?>">
41    
42     <b>Graphs available for these machines:</b>
43    
44     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
45     <select size="1" name="machine_name">
46     <? if ($machine_name) { ?>
47     <option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option>
48     <option value="">----------------</option>
49     <? } else { ?>
50     <option selected value="">[select machine]</option>
51     <? } ?>
52     <?
53     $file_array = getdirArray($imgdir,'asort');
54     foreach($file_array as $file_name) {
55     if(is_dir("$imgdir/$file_name")) { ?>
56     <option value="<? echo $file_name ?>"><? echo $file_name ?></option>
57     <? }
58     }
59     ?>
60     </select>
61    
62     <input type="submit" name="submit" value="Go">
63     </form>
64    
65     <hr weight="1" color="<? echo $lineColor ?>">
66    
67     <? if ($machine_name) { ?>
68    
69     <b>Available graphs for <? echo $machine_name ?></b>
70    
71     <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
72     <select size="1" name="graph">
73     <? if ($graph) { ?>
74     <option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option>
75     <option value="">----------------</option>
76     <? } else { ?>
77     <option selected value="">[select graph]</option>
78     <? } ?>
79     <?
80     $file_array = getdirArray("$imgdir/$machine_name",'asort');
81     foreach($file_array as $file_name) {
82     if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?>
83     <option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option>
84     <? }
85     }
86     ?>
87     </select>
88    
89     <input type="hidden" name="machine_name" value="<? echo $machine_name ?>">
90     <input type="submit" name="submit" value="Show">
91     </form>
92    
93     <hr weight="1" color="<? echo $lineColor ?>">
94    
95     <? } ?>
96    
97     </p>
98    
99    
100     <?
101     if ($submit == "Show" && $machine_name && $graph) {
102    
103     ?>
104     <center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center>
105    
106     <center>
107     <p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p>
108     <p><b>Last day :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p>
109     <p><b>Last week :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p>
110     <p><b>Last month :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p>
111     <p><b>Last year :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p>
112     </center>
113    
114     <hr weight="1" color="<? echo $lineColor ?>">
115    
116     <b>Latest data</b>
117     <p>
118     Latest set of data received from
119     <a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a>
120     <br>
121     Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a>
122    
123    
124     <hr weight="1" color="<? echo $lineColor ?>">
125     <? }
126    
127     ?>
128    
129     <? include($bottomHTML); ?>