add more .gitignore files so that we only track what needs to be tracked
[php-utility-classes.git] / testbed / rrd / rrd-stat.php
CommitLineData
4a778b7e 1<?php
2$myfile = $_SERVER['SCRIPT_FILENAME'];
3while (is_link($myfile)) { $myfile = readlink($myfile); }
4if (getcwd() != dirname($myfile)) {
5 // change to directory of the script if called from different directory
6 $orig_workingdir = getcwd();
7 chdir(dirname($myfile));
8}
9
10include_once('rrdstat.php-class');
11include_once('rrd-config.inc.php');
12
13// view stats
14$sname = isset($_GET['stat'])?$_GET['stat']:null;
15if (is_null($sname) || !strlen($sname)) { $sname = 'index'; }
16
17// call RRD module
18$rrds = new rrdstat($rrd_info, $sname);
19
20$psub = isset($_GET['sub'])?$_GET['sub']:null;
21print($rrds->page($psub));
22?>