Line 0
Link Here
|
|
|
1 |
--- etc/rtg.php.orig 2003-09-24 20:42:03 UTC |
2 |
+++ etc/rtg.php |
3 |
@@ -1,146 +1,152 @@ |
4 |
<?php |
5 |
include('./common.php'); |
6 |
|
7 |
- print "<HTML>\n<!-- RTG Version $VERSION -->\n<HEAD>\n"; |
8 |
+ print "<html>\n<!-- RTG Version $VERSION -->\n<head>\n"; |
9 |
|
10 |
/* Connect to RTG MySQL Database */ |
11 |
- $dbc=@mysql_connect ($host, $user, $pass) or |
12 |
- $dbc=@mysql_connect ("$host:/var/lib/mysql/mysql.sock", $user, $pass) or |
13 |
+ $dbc=@mysqli_connect ($host, $user, $pass, $db) or |
14 |
die ("MySQL Connection Failed, Check Configuration."); |
15 |
- mysql_select_db($db,$dbc); |
16 |
|
17 |
- if ($PHP_SELF == "") { |
18 |
+ if (!isset($PHP_SELF) || $PHP_SELF == "") { |
19 |
$PHP_SELF = "rtg.php"; |
20 |
- $errors = $_GET['errors']; |
21 |
- $scalex = $_GET['scalex']; |
22 |
- $scaley = $_GET['scaley']; |
23 |
- $aggr = $_GET['aggr']; |
24 |
- $percentile = $_GET['percentile']; |
25 |
- $nth = $_GET['nth']; |
26 |
- $xplot = $_GET['xplot']; |
27 |
- $yplot = $_GET['yplot']; |
28 |
- $borderb = $_GET['borderb']; |
29 |
- $iid = $_GET['iid']; |
30 |
- $rid = $_GET['rid']; |
31 |
- $syear = $_GET['syear']; |
32 |
- $eyear = $_GET['eyear']; |
33 |
- $smonth = $_GET['smonth']; |
34 |
- $emonth = $_GET['emonth']; |
35 |
- $sday = $_GET['sday']; |
36 |
- $eday = $_GET['eday']; |
37 |
- $shour = $_GET['shour']; |
38 |
- $ehour = $_GET['ehour']; |
39 |
- $smin = $_GET['smin']; |
40 |
- $emin = $_GET['emin']; |
41 |
+ $errors = isset($_GET['errors'])?$_GET['errors']:""; |
42 |
+ $scalex = isset($_GET['scalex'])?$_GET['scalex']:""; |
43 |
+ $scaley = isset($_GET['scaley'])?$_GET['scaley']:""; |
44 |
+ $aggr = isset($_GET['aggr'])?$_GET['aggr']:""; |
45 |
+ $percentile = isset($_GET['percentile'])?$_GET['percentile']:""; |
46 |
+ $nth = isset($_GET['nth'])?$_GET['nth']:""; |
47 |
+ $xplot = isset($_GET['xplot'])?$_GET['xplot']:""; |
48 |
+ $yplot = isset($_GET['yplot'])?$_GET['yplot']:""; |
49 |
+ $borderb = isset($_GET['borderb'])?$_GET['borderb']:""; |
50 |
+ $iid = isset($_GET['iid'])?$_GET['iid']:""; |
51 |
+ $rid = isset($_GET['rid'])?$_GET['rid']:""; |
52 |
+ $syear = isset($_GET['syear'])?$_GET['syear']:""; |
53 |
+ $eyear = isset($_GET['eyear'])?$_GET['eyear']:""; |
54 |
+ $smonth = isset($_GET['smonth'])?$_GET['smonth']:""; |
55 |
+ $emonth = isset($_GET['emonth'])?$_GET['emonth']:""; |
56 |
+ $sday = isset($_GET['sday'])?$_GET['sday']:""; |
57 |
+ $eday = isset($_GET['eday'])?$_GET['eday']:""; |
58 |
+ $shour = isset($_GET['shour'])?$_GET['shour']:""; |
59 |
+ $ehour = isset($_GET['ehour'])?$_GET['ehour']:""; |
60 |
+ $smin = isset($_GET['smin'])?$_GET['smin']:""; |
61 |
+ $emin = isset($_GET['emin'])?$_GET['emin']:""; |
62 |
} |
63 |
|
64 |
# Determine router, interface names as necessary |
65 |
- if ($rid && $iid) { |
66 |
- $selectQuery="SELECT a.name, a.description, a.speed, b.name AS router FROM interface a, router b WHERE a.rid=b.rid AND a.rid=$rid AND a.id=$iid[0]"; |
67 |
- $selectResult=mysql_query($selectQuery, $dbc); |
68 |
- $selectRow=mysql_fetch_object($selectResult); |
69 |
- $interfaces = mysql_num_rows($selectResult); |
70 |
+ if (($rid != "") && ($iid != "")) { |
71 |
+ $selectQuery="SELECT `a`.`name`, `a`.`description`, `a`.`speed`, `b`.`name` " . |
72 |
+ "AS `router` FROM `interface` `a`, `router` `b` WHERE `a`.`rid`=`b`.`rid` " . |
73 |
+ "AND `a`.`rid`=" . mysqli_real_escape_string($dbc, $rid) . " AND `a`.`id`=" . |
74 |
+ mysqli_real_escape_string($dbc, $iid[0]); |
75 |
+ $selectResult=mysqli_query($dbc, $selectQuery); |
76 |
+ $selectRow=mysqli_fetch_object($selectResult); |
77 |
+ $interfaces = mysqli_num_rows($selectResult); |
78 |
$name = $selectRow->name; |
79 |
$description = $selectRow->description; |
80 |
$speed = ($selectRow->speed)/1000000; |
81 |
$router = $selectRow->router; |
82 |
- } else if ($rid && !$iid) { |
83 |
- $selectQuery="SELECT name AS router from router where rid=$rid"; |
84 |
- $selectResult=mysql_query($selectQuery, $dbc); |
85 |
- $selectRow=mysql_fetch_object($selectResult); |
86 |
+ } else if (($rid != "") && ($iid == "")) { |
87 |
+ $selectQuery="SELECT `name` AS `router` FROM `router` WHERE `rid`=" . |
88 |
+ mysqli_real_escape_string($dbc, $rid); |
89 |
+ $selectResult=mysqli_query($dbc, $selectQuery); |
90 |
+ $selectRow=mysqli_fetch_object($selectResult); |
91 |
$router = $selectRow->router; |
92 |
} |
93 |
|
94 |
# Generate Title |
95 |
- echo "<TITLE>RTG: "; |
96 |
- if ($rid && $iid) echo "$router: $name"; |
97 |
- else if ($rid && !$iid) echo "$router"; |
98 |
- echo "</TITLE>\n"; |
99 |
+ echo "<title>RTG: "; |
100 |
+ if (($rid != "") && ($iid != "")) echo "$router: $name"; |
101 |
+ else if (($rid != "") && ($iid == "")) echo "$router"; |
102 |
+ echo "</title>\n"; |
103 |
?> |
104 |
|
105 |
-</HEAD> |
106 |
-<BODY BACKGROUND="rtgback.png" BGCOLOR="ffffff"> |
107 |
-<A HREF="http://rtg.sourceforge.net" ALT="[RTG Home Page]"> |
108 |
-<IMG SRC="rtg.png" BORDER="0"> |
109 |
-</A> |
110 |
-<P> |
111 |
+</head> |
112 |
+<body background="rtgback.png" bgcolor="ffffff"> |
113 |
+<a href="http://rtg.sourceforge.net" alt="[RTG Home Page]"><img src="rtg.png" border="0" /></a> |
114 |
+<p> |
115 |
|
116 |
<?php |
117 |
-echo "<FORM ACTION=\"$PHP_SELF\" METHOD=\"get\">\n"; |
118 |
+echo "<form action=\"$PHP_SELF\" method=\"get\">\n"; |
119 |
|
120 |
-if (!$rid && !$iid) { |
121 |
- echo "<SELECT NAME=\"rid\" SIZE=10>\n"; |
122 |
- $selectQuery="SELECT DISTINCT name, rid FROM router ORDER BY name"; |
123 |
- $selectResult=mysql_query($selectQuery, $dbc); |
124 |
- while ($selectRow=mysql_fetch_object($selectResult)){ |
125 |
- echo "<OPTION VALUE=\"$selectRow->rid\">$selectRow->name\n"; |
126 |
+if (($rid == "") && ($iid == "")) { |
127 |
+ echo "<select name=\"rid\" size=\"10\">\n"; |
128 |
+ $selectQuery="SELECT DISTINCT `name`, `rid` FROM `router` ORDER BY `name`"; |
129 |
+ $selectResult=mysqli_query($dbc, $selectQuery); |
130 |
+ while ($selectRow=mysqli_fetch_object($selectResult)){ |
131 |
+ echo "<option value=\"$selectRow->rid\">$selectRow->name</option>\n"; |
132 |
} |
133 |
- echo "</SELECT>\n"; |
134 |
+ echo "</select>\n"; |
135 |
} |
136 |
|
137 |
-if ($smonth != "" && $iid == "") { |
138 |
- echo "<BLOCKQUOTE><FONT SIZE=+1><STRONG>\n"; |
139 |
+if (($smonth != "") && ($iid == "")) { |
140 |
+ echo "<blockquote><font size=\"+1\"><b>\n"; |
141 |
echo "Please select an interface!\n"; |
142 |
- echo "</FONT></STRONG></BLOCKQUOTE>\n"; |
143 |
+ echo "</b></font></blockquote>\n"; |
144 |
} |
145 |
|
146 |
-if ($rid && !$iid) { |
147 |
- echo "<SELECT NAME=\"rid\" SIZE=10>\n"; |
148 |
- echo "<OPTION SELECTED VALUE=\"$rid\">$router\n"; |
149 |
- echo "</SELECT>\n"; |
150 |
+if (($rid != "") && ($iid == "")) { |
151 |
+ echo "<select name=\"rid\" size=\"10\">\n"; |
152 |
+ echo "<option selected value=\"$rid\">$router</option>\n"; |
153 |
+ echo "</select>\n"; |
154 |
|
155 |
- echo "<SELECT MULTIPLE NAME=\"iid[]\" SIZE=10>\n"; |
156 |
- $selectQuery="SELECT id, name, description FROM interface WHERE rid=$rid ORDER BY name"; |
157 |
- $selectResult=mysql_query($selectQuery, $dbc); |
158 |
- while ($selectRow=mysql_fetch_object($selectResult)){ |
159 |
- echo "<OPTION VALUE=\"$selectRow->id\">$selectRow->name ($selectRow->description)\n"; |
160 |
+ echo "<select multiple name=\"iid[]\" size=\"10\">\n"; |
161 |
+ $selectQuery="SELECT `id`, `name`, `description` FROM `interface` WHERE " . |
162 |
+ "`rid`=" . mysqli_real_escape_string($dbc, $rid) . " ORDER BY `name`"; |
163 |
+ $selectResult=mysqli_query($dbc, $selectQuery); |
164 |
+ while ($selectRow=mysqli_fetch_object($selectResult)){ |
165 |
+ echo "<option value=\"$selectRow->id\">$selectRow->name ($selectRow->description)</option>\n"; |
166 |
} |
167 |
- echo "</SELECT>\n"; |
168 |
+ echo "</select>\n"; |
169 |
|
170 |
- echo "<P><TABLE>\n"; |
171 |
- echo "<TD>From: \n"; |
172 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"smonth\" SIZE=3 MAXLENGTH=2 VALUE=\""; |
173 |
+ echo "<p><table>\n"; |
174 |
+ echo "<tr><td>From: </td>\n"; |
175 |
+ echo "<td><input type=\"text\" name=\"smonth\" size=\"3\" maxlength=\"2\" value=\""; |
176 |
print (date("m")); |
177 |
- echo "\"> / \n"; |
178 |
- echo "<INPUT TYPE=TEXT NAME=\"sday\" SIZE=3 MAXLENGTH=2 VALUE=\""; |
179 |
+ echo "\" /> / \n"; |
180 |
+ echo "<input type=\"text\" name=\"sday\" size=\"3\" maxlength=\"2\" value=\""; |
181 |
print (date("d")); |
182 |
- echo "\"> / \n"; |
183 |
- echo "<INPUT TYPE=TEXT NAME=\"syear\" SIZE=5 MAXLENGTH=4 VALUE=\""; |
184 |
+ echo "\" /> / \n"; |
185 |
+ echo "<input type=\"text\" name=\"syear\" size=\"5\" maxlength=\"4\" value=\""; |
186 |
print (date("Y")); |
187 |
- echo "\">\n"; |
188 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"shour\" SIZE=3 MAXLENGTH=2 VALUE=\"00\">:\n"; |
189 |
- echo "<INPUT TYPE=TEXT NAME=\"smin\" SIZE=3 MAXLENGTH=2 VALUE=\"00\">\n"; |
190 |
+ echo "\" />\n"; |
191 |
+ echo "</td>"; |
192 |
+ echo "<td><input type=\"text\" name=\"shour\" size=\"3\" maxlength=\"2\" value=\"00\" />:\n"; |
193 |
+ echo "<input type=\"text\" name=\"smin\" size=\"3\" maxlength=\"2\" value=\"00\" />\n"; |
194 |
+ echo "</td></tr>\n"; |
195 |
|
196 |
- echo "<TR><TD>To: \n"; |
197 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"emonth\" SIZE=3 MAXLENGTH=2 VALUE=\""; |
198 |
+ echo "<tr><td>To: </td>\n"; |
199 |
+ echo "<td><input type=\"text\" name=\"emonth\" size=\"3\" maxlength=\"2\" value=\""; |
200 |
print (date("m")); |
201 |
- echo "\"> / \n"; |
202 |
- echo "<INPUT TYPE=TEXT NAME=\"eday\" SIZE=3 MAXLENGTH=2 VALUE=\""; |
203 |
+ echo "\" /> / \n"; |
204 |
+ echo "<input type=\"text\" name=\"eday\" size=\"3\" maxlength=\"2\" value=\""; |
205 |
print (date("d")); |
206 |
- echo "\"> / \n"; |
207 |
- echo "<INPUT TYPE=TEXT NAME=\"eyear\" SIZE=5 MAXLENGTH=4 VALUE=\""; |
208 |
+ echo "\" /> / \n"; |
209 |
+ echo "<input type=\"text\" name=\"eyear\" size=\"5\" maxlength=\"4\" value=\""; |
210 |
print (date("Y")); |
211 |
- echo "\">\n"; |
212 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"ehour\" SIZE=3 MAXLENGTH=2 VALUE=\"23\">:\n"; |
213 |
- echo "<INPUT TYPE=TEXT NAME=\"emin\" SIZE=3 MAXLENGTH=2 VALUE=\"59\">\n"; |
214 |
- echo "<TR><TD>Aggregate Interfaces: \n"; |
215 |
- echo "<TD><INPUT TYPE=CHECKBOX NAME=\"aggr\">\n"; |
216 |
- echo "<TR><TD><INPUT TYPE=TEXT NAME=\"nth\" SIZE=2 MAXLENGTH=2 VALUE=\"95\">th Percentile: \n"; |
217 |
- echo "<TD><INPUT TYPE=CHECKBOX NAME=\"percentile\">\n"; |
218 |
- echo "<TR><TD>Fit to Data: \n"; |
219 |
- echo "<TD><INPUT TYPE=CHECKBOX NAME=\"scalex\">\n"; |
220 |
- echo "<TR><TD>Fit to Speed: \n"; |
221 |
- echo "<TD><INPUT TYPE=CHECKBOX NAME=\"scaley\">\n"; |
222 |
- echo "<TR><TD>X Size: \n"; |
223 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"xplot\" SIZE=3 VALUE=\"500\">\n"; |
224 |
- echo "<TR><TD>Y Size: \n"; |
225 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"yplot\" SIZE=3 VALUE=\"150\">\n"; |
226 |
- echo "<TR><TD>BorderB: \n"; |
227 |
- echo "<TD><INPUT TYPE=TEXT NAME=\"borderb\" SIZE=3 VALUE=\"70\">\n"; |
228 |
- echo "</TABLE>\n"; |
229 |
+ echo "\" />\n"; |
230 |
+ echo "</td>"; |
231 |
+ echo "<td><input type=\"text\" name=\"ehour\" size=\"3\" maxlength=\"2\" value=\"23\" />:\n"; |
232 |
+ echo "<input type=\"text\" name=\"emin\" size=\"3\" maxlength=\"2\" value=\"59\" />\n"; |
233 |
+ echo "</td></tr>\n"; |
234 |
+ |
235 |
+ echo "<tr><td>Aggregate Interfaces: </td>\n"; |
236 |
+ echo "<td><input type=\"checkbox\" name=\"aggr\" /></td></tr>\n"; |
237 |
+ echo "<tr><td><input type=\"text\" name=\"nth\" size=\"2\" maxlength=\"2\" value=\"95\" />th Percentile: </td>\n"; |
238 |
+ echo "<td><input type=\"checkbox\" name=\"percentile\" /></td></tr>\n"; |
239 |
+ echo "<tr><td>Fit to Data: </td>\n"; |
240 |
+ echo "<td><input type=\"checkbox\" name=\"scalex\" /></td></tr>\n"; |
241 |
+ echo "<tr><td>Fit to Speed: </td>\n"; |
242 |
+ echo "<td><input type=\"checkbox\" name=\"scaley\" /></td></tr>\n"; |
243 |
+ echo "<tr><td>X Size: </td>\n"; |
244 |
+ echo "<td><input type=\"text\" name=\"xplot\" size=\"3\" value=\"500\" /></td></tr>\n"; |
245 |
+ echo "<tr><td>Y Size: </td>\n"; |
246 |
+ echo "<td><input type=\"text\" name=\"yplot\" size=\"3\" value=\"150\" /></td></tr>\n"; |
247 |
+ echo "<tr><td>BorderB: </td>\n"; |
248 |
+ echo "<td><input type=\"text\" name=\"borderb\" size=\"3\" value=\"70\" /></td></tr>\n"; |
249 |
+ echo "</table>\n"; |
250 |
} |
251 |
|
252 |
-if (($bt || $smonth) && $iid) { |
253 |
+if (($bt != "" || $smonth != "") && ($iid != "")) { |
254 |
|
255 |
/* Format into GNU date syntax */ |
256 |
if ($bt == "") { |
257 |
@@ -148,67 +154,84 @@ if (($bt || $smonth) && $iid) { |
258 |
$et = strtotime("$eyear-$emonth-$eday $ehour:$emin:59"); |
259 |
} |
260 |
|
261 |
- $range="dtime>FROM_UNIXTIME($bt) AND dtime<=FROM_UNIXTIME($et)"; |
262 |
- $range="$range AND id=$iid[0]"; |
263 |
+ $range="`dtime`>FROM_UNIXTIME(" . mysqli_real_escape_string($dbc, $bt) . ") AND " . |
264 |
+ "`dtime`<=FROM_UNIXTIME(" . mysqli_real_escape_string($dbc, $et) . ") " . |
265 |
+ "AND `id`=" . mysqli_real_escape_string($dbc, $iid[0]); |
266 |
|
267 |
- $selectQuery="SELECT description, name, speed FROM interface WHERE rid=$rid AND id=$iid[0]"; |
268 |
- $selectResult=mysql_query($selectQuery, $dbc); |
269 |
- $selectRow=mysql_fetch_object($selectResult); |
270 |
- echo "<TABLE BORDER=0>\n"; |
271 |
- echo "<TD><I>Device</I>:</TD><TD>$router ($rid)</TD><TR>\n"; |
272 |
- echo "<TD><I>Interface</I>:</TD><TD>$selectRow->name ($iid[0])</TD><TR>\n"; |
273 |
- printf ("<TD><I>Speed</I>:</TD><TD>%2.3f Mbps</TD><TR>\n", $selectRow->speed / 1000000); |
274 |
- echo "<TD><I>Description</I>:</TD><TD>$selectRow->description</TD><TR>\n"; |
275 |
- print strftime("<TD><I>Period</I>:</TD><TD>%m/%d/%Y %H:%M - ", $bt); |
276 |
- print strftime("%m/%d/%Y %H:%M</TD>\n", $et); |
277 |
- echo "</TABLE>\n"; |
278 |
- echo "<P>\n"; |
279 |
+ $selectQuery="SELECT `description`, `name`, `speed` FROM `interface` WHERE " . |
280 |
+ "`rid`=" . mysqli_real_escape_string($dbc, $rid) . " AND `id`=" . |
281 |
+ mysqli_real_escape_string($dbc, $iid[0]); |
282 |
+ $selectResult=mysqli_query($dbc, $selectQuery); |
283 |
+ $selectRow=mysqli_fetch_object($selectResult); |
284 |
+ echo "<table border=\"0\">\n"; |
285 |
+ echo "<tr><td><i>Device</i>:</td><td>$router ($rid)</td></tr>\n"; |
286 |
+ echo "<tr><td><i>Interface</i>:</td><td>$selectRow->name ($iid[0])</td></tr>\n"; |
287 |
+ printf ("<tr><td><i>Speed</i>:</td><td>%2.3f Mbps</td></tr>\n", $selectRow->speed / 1000000); |
288 |
+ echo "<tr><td><i>Description</i>:</td><td>$selectRow->description</td></tr>\n"; |
289 |
+ print strftime("<tr><td><i>Period</i>:</td><td>%m/%d/%Y %H:%M - ", $bt); |
290 |
+ print strftime("%m/%d/%Y %H:%M</td>\n", $et); |
291 |
+ echo "</tr>\n"; |
292 |
+ echo "</table>\n"; |
293 |
+ echo "<p>\n"; |
294 |
|
295 |
#$selectQuery="SELECT DISTINCT id FROM ifInOctets_$rid WHERE $range"; |
296 |
- #$selectResult=mysql_query($selectQuery, $dbc); |
297 |
- #if (mysql_num_rows($selectResult) <= 0) { |
298 |
+ #$selectResult=mysqli_query($dbc, $selectQuery); |
299 |
+ #if (mysqli_num_rows($selectResult) <= 0) { |
300 |
# print "<BR>No Data Found on Interface for Given Range.<BR>\n"; |
301 |
#} |
302 |
#else { |
303 |
- $args = "t1=ifInOctets_$rid&t2=ifOutOctets_$rid&begin=$bt&end=$et&units=bits/s&factor=8"; |
304 |
+ $args = "t1=ifInOctets_$rid&t2=ifOutOctets_$rid&begin=$bt&"; |
305 |
+ $args .= "end=$et&units=bits/s&factor=8"; |
306 |
+ $args .= "&title=" . urlencode($selectRow->description); |
307 |
+ $args .= "&t1_name=" . urlencode("Input Octets"); |
308 |
+ $args .= "&t2_name=" . urlencode("Output Octets"); |
309 |
foreach ($iid as $value) { |
310 |
- $args="$args&iid=$value"; |
311 |
+ $args="$args&iid=" . urlencode($value); |
312 |
} |
313 |
- if ($scalex) $args = "$args&scalex=yes"; |
314 |
- if ($scaley) $args = "$args&scaley=yes"; |
315 |
- if ($xplot) $args = "$args&xplot=$xplot"; |
316 |
- if ($yplot) $args = "$args&yplot=$yplot"; |
317 |
- if ($borderb) $args = "$args&borderb=$borderb"; |
318 |
- if ($aggr) $args = "$args&aggr=yes"; |
319 |
- if ($percentile) $args = "$args&percentile=$nth"; |
320 |
- print "<IMG SRC=rtgplot.cgi?$args><BR>\n"; |
321 |
- $args = "t1=ifInUcastPkts_$rid&t2=ifOutUcastPkts_$rid&begin=$bt&end=$et&units=pkts/s"; |
322 |
+ if ($scalex != "") $args = "$args&scalex=yes"; |
323 |
+ if ($scaley != "") $args = "$args&scaley=yes"; |
324 |
+ if ($xplot != "") $args = "$args&xplot=$xplot"; |
325 |
+ if ($yplot != "") $args = "$args&yplot=$yplot"; |
326 |
+ if ($borderb != "") $args = "$args&borderb=$borderb"; |
327 |
+ if ($aggr != "") $args = "$args&aggr=yes"; |
328 |
+ if ($percentile != "") $args = "$args&percentile=$nth"; |
329 |
+ print "<img src=\"/cgi-bin/rtgplot.cgi?$args\" alt=\"graph\" /><br />\n"; |
330 |
+ $args = "t1=ifInUcastPkts_$rid&t2=ifOutUcastPkts_$rid&begin=$bt&"; |
331 |
+ $args .= "end=$et&units=pkts/s"; |
332 |
+ $args .= "&title=" . urlencode($selectRow->description); |
333 |
+ $args .= "&t1_name=" . urlencode("Input Packets"); |
334 |
+ $args .= "&t2_name=" . urlencode("Output Packets"); |
335 |
foreach ($iid as $value) { |
336 |
- $args="$args&iid=$value"; |
337 |
+ $args="$args&iid=" . urlencode($value); |
338 |
+ } |
339 |
+ if ($scalex != "") $args = "$args&scalex=yes"; |
340 |
+ if ($xplot != "") $args = "$args&xplot=$xplot"; |
341 |
+ if ($yplot != "") $args = "$args&yplot=$yplot"; |
342 |
+ if ($borderb != "") $args = "$args&borderb=$borderb"; |
343 |
+ if ($aggr != "") $args = "$args&aggr=yes"; |
344 |
+ if ($percentile != "") $args = "$args&percentile=$nth"; |
345 |
+ print "<img src=\"/cgi-bin/rtgplot.cgi?$args\" alt=\"graph\" /><br />\n"; |
346 |
+ if ($errors != "") |
347 |
+ { |
348 |
+ print "<img src=\"/cgi-bin/rtgplot.cgi?t1=ifInErrors_$rid&begin=$bt"; |
349 |
+ print "&end=$et&units=errors&impulses=yes"; |
350 |
+ print "&title=" . urlencode($selectRow->description); |
351 |
+ print "&t1_name=" . urlencode("Errors") . "\" alt=\"graph\" />\n"; |
352 |
} |
353 |
- if ($scalex) $args = "$args&scalex=yes"; |
354 |
- if ($xplot) $args = "$args&xplot=$xplot"; |
355 |
- if ($yplot) $args = "$args&yplot=$yplot"; |
356 |
- if ($borderb) $args = "$args&borderb=$borderb"; |
357 |
- if ($aggr) $args = "$args&aggr=yes"; |
358 |
- if ($percentile) $args = "$args&percentile=$nth"; |
359 |
- print "<IMG SRC=rtgplot.cgi?$args><BR>\n"; |
360 |
- if ($errors) |
361 |
- print "<IMG SRC=rtgplot.cgi?t1=ifInErrors_$rid&begin=$bt&end=$et&units=errors&impulses=yes>\n"; |
362 |
# } |
363 |
} |
364 |
|
365 |
-mysql_close($dbc); |
366 |
+mysqli_close($dbc); |
367 |
?> |
368 |
|
369 |
-<P> |
370 |
-<INPUT TYPE="SUBMIT" VALUE="Ok"> |
371 |
-</FORM> |
372 |
-<BR> |
373 |
-<HR> |
374 |
-<FONT FACE="Arial" SIZE="2"> |
375 |
+<p> |
376 |
+<input type="submit" value="Ok" /> |
377 |
+</form> |
378 |
+<br /> |
379 |
+<hr /> |
380 |
+<font face="Arial" size="2"> |
381 |
<?php |
382 |
- print "<A HREF=\"http://rtg.sourceforge.net\">RTG</A> Version $VERSION</FONT>"; |
383 |
-?> |
384 |
-</BODY> |
385 |
-</HTML> |
386 |
+ print "<a href=\"http://rtg.sourceforge.net\">RTG</a> Version $VERSION</font>"; |
387 |
+?></p> |
388 |
+</body> |
389 |
+</html> |