blob: c08582de020e8ec52957488db97f236d3abe9e65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
<?
include "include/config.inc";
$page["title"] = "User defined graphs";
$page["file"] = "charts.html";
$nomenu=0;
if(isset($fullscreen))
{
$nomenu=1;
}
if(isset($graphid))
{
show_header($page["title"],30,$nomenu);
}
else
{
show_header($page["title"],0,$nomenu);
}
?>
<?
if(!isset($fullscreen))
{
show_table_header_begin();
echo "GRAPHS";
show_table_v_delimiter();
echo "<font size=2>";
$lasthost="";
$result=DBselect("select graphid,name from graphs order by name");
for($i=0;$i<DBnum_rows($result);$i++)
{
$graphid_=DBget_field($result,$i,0);
$name=DBget_field($result,$i,1);
if( isset($graphid) && ($graphid == $graphid_) )
{
echo "<b>[";
}
echo "<a href='charts.html?graphid=$graphid_'>$name</a>";
if(isset($graphid) && ($graphid == $graphid_) )
{
echo "]</b>";
}
echo " ";
}
if(DBnum_rows($result) == 0)
{
echo "No graphs to display";
}
echo "</font>";
show_table_header_end();
echo "<br>";
}
?>
<?
if(isset($graphid))
{
$result=DBselect("select name from graphs where graphid=$graphid");
$map=DBget_field($result,0,0);
if(isset($fullscreen))
{
$map="<a href=\"charts.html?graphid=$graphid\">".$map."</a>";
}
else
{
$map="<a href=\"charts.html?graphid=$graphid&fullscreen=1\">".$map."</a>";
}
}
else
{
$map="Select graph to display";
}
if(!isset($from))
{
$from=0;
}
if(!isset($period))
{
$period=3600;
}
show_table_header($map);
echo "<TABLE BORDER=0 COLS=4 WIDTH=\"100%\" BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR BGCOLOR=#EEEEEE>";
echo "<TR BGCOLOR=#DDDDDD>";
echo "<TD ALIGN=CENTER>";
if(isset($graphid))
{
echo "<IMG SRC=\"chart2.html?graphid=$graphid&period=$period&from=$from\">";
}
else
{
echo "...";
}
echo "</TD>";
echo "</TR>";
echo "</TABLE>";
if(isset($graphid)&&(!isset($fullscreen)))
{
echo("<center>");
echo("<hr>");
$tmp=$from+12*14;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("Week back</A>] ");
$tmp=$from+12;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("12h back</A>] ");
$tmp=$from+1;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("1h back</A>] ");
$tmp=$period+3600;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$from&period=$tmp\">");
echo("+1h</A>] ");
if ($period>3600)
{
$tmp=$period-3600;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$from&period=$tmp\">");
echo("-1h</A>] ");
}
else
{
echo("[-1h]");
}
if ($from>0) // HOUR FORWARD
{
$tmp=$from-1;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("1h forward</A>] ");
}
else
{
echo("[1h forward]");
}
if (isset($From) && ($From>0))
{
$tmp=$from-12;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("12h forward</A>] ");
}
else
{
echo("[12h forward]");
}
if (isset($From) && ($From>0))
{
$tmp=$from-12*14;
echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">");
echo("Week forward</A>] ");
}
else
{
echo("[Week forward]");
}
echo("</center>");
}
?>
<?
show_footer();
?>
|