33 |
|
|
34 |
|
include("iutils.inc.php"); |
35 |
|
|
36 |
+ |
if ($formMethod == "GET") { |
37 |
+ |
$machine_name = isset($_GET['machine_name']) ? $_GET['machine_name'] : ""; |
38 |
+ |
$graph = isset($_GET['graph']) ? $_GET['graph'] : ""; |
39 |
+ |
$submit = isset($_GET['submit']) ? $_GET['submit'] : ""; |
40 |
+ |
$PHP_SELF = isset($_GET['PHP_SELF']) ? $_GET['PHP_SELF'] : ""; |
41 |
+ |
} |
42 |
+ |
|
43 |
+ |
$file_array = getdirArray($imgdir,'asort'); |
44 |
+ |
|
45 |
|
?> |
46 |
|
|
47 |
< |
<? include($titleHTML); ?> |
47 |
> |
<?php include($titleHTML); ?> |
48 |
|
|
49 |
< |
<hr weight="1" color="<? echo $lineColor ?>"> |
49 |
> |
<hr weight="1" color="<?php echo $lineColor ?>"> |
50 |
|
|
51 |
|
<b>Graphs available for these machines:</b> |
52 |
|
|
53 |
< |
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
53 |
> |
<form method="<?php echo $formMethod ?>" action="<?php echo $thisPage ?>"> |
54 |
|
<select size="1" name="machine_name"> |
55 |
< |
<? if ($machine_name) { ?> |
56 |
< |
<option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option> |
55 |
> |
<?php if ($machine_name) { ?> |
56 |
> |
<option selected value="<?php echo $machine_name ?>"><?php echo $machine_name ?></option> |
57 |
|
<option value="">----------------</option> |
58 |
< |
<? } else { ?> |
58 |
> |
<?php } else { ?> |
59 |
|
<option selected value="">[select machine]</option> |
60 |
< |
<? } ?> |
61 |
< |
<? |
53 |
< |
$file_array = getdirArray($imgdir,'asort'); |
60 |
> |
<?php } ?> |
61 |
> |
<?php |
62 |
|
foreach($file_array as $file_name) { |
63 |
|
if(is_dir("$imgdir/$file_name")) { ?> |
64 |
< |
<option value="<? echo $file_name ?>"><? echo $file_name ?></option> |
65 |
< |
<? } |
64 |
> |
<option value="<?php echo $file_name ?>"><?php echo $file_name ?></option> |
65 |
> |
<?php } |
66 |
|
} |
67 |
|
?> |
68 |
|
</select> |
70 |
|
<input type="submit" name="submit" value="Go"> |
71 |
|
</form> |
72 |
|
|
73 |
< |
<hr weight="1" color="<? echo $lineColor ?>"> |
73 |
> |
<hr weight="1" color="<?php echo $lineColor ?>"> |
74 |
|
|
75 |
< |
<? if ($machine_name) { ?> |
75 |
> |
<?php if ($machine_name) { ?> |
76 |
|
|
77 |
< |
<b>Available graphs for <? echo $machine_name ?></b> |
77 |
> |
<b>Available graphs for <?php echo $machine_name ?></b> |
78 |
|
|
79 |
< |
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
79 |
> |
<form method="<?php echo $formMethod ?>" action="<?php echo $thisPage ?>"> |
80 |
|
<select size="1" name="graph"> |
81 |
< |
<? if ($graph) { ?> |
82 |
< |
<option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option> |
81 |
> |
<?php if ($graph) { ?> |
82 |
> |
<option selected value="<?php echo $graph ?>"><?php echo tidyName($machine_name, $graph) ?></option> |
83 |
|
<option value="">----------------</option> |
84 |
< |
<? } else { ?> |
84 |
> |
<?php } else { ?> |
85 |
|
<option selected value="">[select graph]</option> |
86 |
< |
<? } ?> |
87 |
< |
<? |
86 |
> |
<?php } ?> |
87 |
> |
<option value="ALL">ALL</option> |
88 |
> |
<?php |
89 |
|
$file_array = getdirArray("$imgdir/$machine_name",'asort'); |
90 |
|
foreach($file_array as $file_name) { |
91 |
|
if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?> |
92 |
< |
<option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option> |
93 |
< |
<? } |
92 |
> |
<option value="<?php echo $matches[1] ?>"><?php echo tidyName($machine_name, $matches[1]) ?></option> |
93 |
> |
<?php } |
94 |
|
} |
95 |
|
?> |
96 |
|
</select> |
97 |
|
|
98 |
< |
<input type="hidden" name="machine_name" value="<? echo $machine_name ?>"> |
98 |
> |
<input type="hidden" name="machine_name" value="<?php echo $machine_name ?>"> |
99 |
|
<input type="submit" name="submit" value="Show"> |
100 |
|
</form> |
101 |
|
|
102 |
< |
<hr weight="1" color="<? echo $lineColor ?>"> |
102 |
> |
<hr weight="1" color="<?php echo $lineColor ?>"> |
103 |
|
|
104 |
< |
<? } ?> |
104 |
> |
<?php } ?> |
105 |
|
|
106 |
|
</p> |
107 |
|
|
108 |
|
|
109 |
< |
<? |
109 |
> |
<?php |
110 |
|
if ($submit == "Show" && $machine_name && $graph) { |
111 |
< |
|
111 |
> |
if ($graph == "ALL") { |
112 |
|
?> |
113 |
< |
<center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center> |
113 |
> |
<center><b>[<?php echo $machine_name; ?>] - All graphs</b></center> |
114 |
> |
|
115 |
> |
<center> |
116 |
> |
<?php |
117 |
> |
foreach($file_array as $file_name) { |
118 |
> |
if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?> |
119 |
> |
<p><b><?php echo tidyName($machine_name, $matches[1]) ?>:</b><br> |
120 |
> |
<a href="<?php echo $PHP_SELF.'?'.'graph='.$matches[1].'&machine_name='.$machine_name.'&submit=Show'?>"> |
121 |
> |
<img border="0" src="<?php echo "$imgwebdir/$machine_name/$matches[1]-3h.png" ?>"></a></p> |
122 |
> |
<?php } |
123 |
> |
} |
124 |
> |
?> |
125 |
> |
</center> |
126 |
> |
<?php |
127 |
> |
} else { // if graph== All |
128 |
> |
?> |
129 |
> |
<center><b>[<?php echo $machine_name; ?>] - '<?php echo tidyName($machine_name, $graph) ?>' graphs</b></center> |
130 |
|
|
131 |
|
<center> |
132 |
< |
<p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p> |
133 |
< |
<p><b>Last day :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p> |
134 |
< |
<p><b>Last week :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p> |
135 |
< |
<p><b>Last month :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p> |
136 |
< |
<p><b>Last year :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p> |
132 |
> |
<p><b>Last 3 hours :</b><br><img border="0" src="<?php echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p> |
133 |
> |
<p><b>Last day :</b><br><img border="0" src="<?php echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p> |
134 |
> |
<p><b>Last week :</b><br><img border="0" src="<?php echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p> |
135 |
> |
<p><b>Last month :</b><br><img border="0" src="<?php echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p> |
136 |
> |
<p><b>Last year :</b><br><img border="0" src="<?php echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p> |
137 |
|
</center> |
138 |
+ |
<?php } /* if graph == All */ ?> |
139 |
+ |
<hr weight="1" color="<?php echo $lineColor ?>"> |
140 |
|
|
114 |
– |
<hr weight="1" color="<? echo $lineColor ?>"> |
115 |
– |
|
141 |
|
<b>Latest data</b> |
142 |
|
<p> |
143 |
|
Latest set of data received from |
144 |
< |
<a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a> |
144 |
> |
<a href="<?php echo "latest.php?machine=$machine_name"; ?>"><?php echo $machine_name?></a> |
145 |
|
<br> |
146 |
< |
Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a> |
146 |
> |
Alerts for <a href="alerts.php?machine=<?php echo $machine_name?>"><?php echo $machine_name?></a> |
147 |
|
|
148 |
|
|
149 |
< |
<hr weight="1" color="<? echo $lineColor ?>"> |
150 |
< |
<? } |
126 |
< |
|
149 |
> |
<hr weight="1" color="<?php echo $lineColor ?>"> |
150 |
> |
<?php } // if show, machine and graph |
151 |
|
?> |
152 |
|
|
153 |
< |
<? include($bottomHTML); ?> |
153 |
> |
<?php include($bottomHTML); ?> |