2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2009-04-23 21:13:56 +00:00
|
|
|
if($_GET['debug']) {
|
2009-04-13 19:16:22 +00:00
|
|
|
ini_set('display_errors', 1);
|
2008-03-22 16:55:27 +00:00
|
|
|
ini_set('display_startup_errors', 0);
|
|
|
|
ini_set('log_errors', 0);
|
2007-04-03 14:10:23 +00:00
|
|
|
ini_set('allow_url_fopen', 0);
|
2009-04-23 21:13:56 +00:00
|
|
|
ini_set('error_reporting', E_ALL);
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
|
|
|
include("../config.php");
|
2009-05-07 13:47:51 +00:00
|
|
|
include("../includes/common.php");
|
|
|
|
include("../includes/graphing.php");
|
2007-04-03 14:10:23 +00:00
|
|
|
include("includes/authenticate.inc");
|
2009-05-07 13:47:51 +00:00
|
|
|
|
2009-03-11 14:46:55 +00:00
|
|
|
if(!$_SESSION['authenticated']) { echo("not authenticated"); exit; }
|
|
|
|
|
2008-03-09 17:39:14 +00:00
|
|
|
if($_GET['params']) {
|
|
|
|
list($_GET['host'], $_GET['if'], $_GET['from'], $_GET['to'], $_GET['width'], $_GET['height'], $_GET['title'], $_GET['vertical'], $_GET['type'], $_GET['interfaces']) = explode("||", mcrypt_ecb(MCRYPT_DES, $key_value, $_GET['params'], MCRYPT_DECRYPT));
|
|
|
|
}
|
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
if($_GET['host']) {
|
2007-04-08 14:34:19 +00:00
|
|
|
$device_id = $_GET['host'];
|
2007-04-04 14:25:17 +00:00
|
|
|
} elseif($_GET['device']) {
|
2007-04-08 14:34:19 +00:00
|
|
|
$device_id = $_GET['device'];
|
|
|
|
} elseif($_GET['if']) {
|
|
|
|
$device_id = getifhost($_GET['if']);
|
2007-04-03 14:10:23 +00:00
|
|
|
$ifIndex = getifindexbyid($_GET['if']);
|
2008-03-15 17:58:15 +00:00
|
|
|
} elseif($_GET['peer']) {
|
|
|
|
$device_id = getpeerhost($_GET['peer']);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
2008-03-15 17:58:15 +00:00
|
|
|
|
2009-04-23 21:13:56 +00:00
|
|
|
if($_GET['legend']) { $legend = $_GET['legend']; } else { $legend = '1'; }
|
2009-03-30 11:20:18 +00:00
|
|
|
if($_GET['inverse']) { $inverse = $_GET['inverse']; }
|
|
|
|
if($device_id) { $hostname = gethostbyid($device_id); }
|
2007-04-04 22:05:52 +00:00
|
|
|
|
2007-04-03 14:10:23 +00:00
|
|
|
$from = $_GET['from'];
|
|
|
|
$to = $_GET['to'];
|
|
|
|
$width = $_GET['width'];
|
|
|
|
$height = $_GET['height'];
|
|
|
|
$title = $_GET['title'];
|
|
|
|
$vertical = $_GET['vertical'];
|
|
|
|
$type = $_GET['type'];
|
|
|
|
|
2007-11-21 14:26:24 +00:00
|
|
|
$graphfile = strgen() . ".png";
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2007-04-08 14:34:19 +00:00
|
|
|
$os = gethostosbyid($device_id);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
|
|
|
switch ($type) {
|
2009-05-06 16:50:51 +00:00
|
|
|
case 'cisco_entity_sensor':
|
|
|
|
$graph = graph_entity_sensor ($_GET['a'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2008-04-03 21:52:59 +00:00
|
|
|
case 'fortigate_sessions':
|
|
|
|
$graph = graph_fortigate_sessions ($hostname . "/fortigate-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
|
|
|
case 'fortigate_cpu':
|
|
|
|
$graph = graph_fortigate_cpu ($hostname . "/fortigate-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
|
|
|
case 'fortigate_memory':
|
|
|
|
$graph = graph_fortigate_memory ($hostname . "/fortigate-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2008-03-20 11:53:19 +00:00
|
|
|
case 'netscreen_sessions':
|
|
|
|
$graph = graph_netscreen_sessions ($hostname . "/netscreen-sessions.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
|
|
|
case 'netscreen_cpu':
|
|
|
|
$graph = graph_netscreen_cpu ($hostname . "/netscreen-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
|
|
|
case 'netscreen_memory':
|
|
|
|
$graph = graph_netscreen_memory ($hostname . "/netscreen-memory.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2009-07-31 10:53:54 +00:00
|
|
|
case 'multi_bits_duo':
|
|
|
|
$groups = array($_GET['interfaces'], $_GET['interfaces_b']);
|
|
|
|
$graph = graph_multi_bits_duo ($groups, $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
|
|
|
break;
|
|
|
|
case 'multi_bits_trio':
|
|
|
|
$groups = array($_GET['interfaces'], $_GET['interfaces_b'], $_GET['interfaces_c']);
|
|
|
|
$graph = graph_multi_bits_trio ($groups, $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
|
|
|
break;
|
|
|
|
|
2008-09-03 20:04:34 +00:00
|
|
|
case 'adsl_rate':
|
|
|
|
$graph = graph_adsl_rate ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
|
|
|
|
break;
|
|
|
|
case 'adsl_snr':
|
|
|
|
$graph = graph_adsl_snr ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
|
|
|
|
break;
|
|
|
|
case 'adsl_atn':
|
|
|
|
$graph = graph_adsl_atn ($hostname. "/adsl-4.rrd", $graphfile, $from, $to, $width, $height);
|
|
|
|
break;
|
2007-04-04 22:05:52 +00:00
|
|
|
case 'global_bits':
|
|
|
|
$graph = graph_global_bits ("global_bits.png", $from, $to, $width, $height);
|
|
|
|
break;
|
2009-02-02 15:38:34 +00:00
|
|
|
case 'mac_acc_int':
|
|
|
|
$graph = graph_mac_acc_interface ($_GET['if'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2009-09-18 14:45:34 +00:00
|
|
|
case 'mac_acc_pkts':
|
|
|
|
$graph = graph_mac_pkts ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2009-02-02 15:38:34 +00:00
|
|
|
case 'mac_acc':
|
2009-09-18 14:45:34 +00:00
|
|
|
case 'mac_acc_bits':
|
2009-02-02 15:38:34 +00:00
|
|
|
$graph = graph_mac_acc ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'bits':
|
2009-02-04 16:18:11 +00:00
|
|
|
$graph = graph_bits ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical, $inverse, $legend);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'pkts':
|
2008-03-12 13:13:50 +00:00
|
|
|
$graph = pktsgraph ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'errors':
|
2008-03-12 13:13:50 +00:00
|
|
|
$graph = errorgraph ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'nupkts':
|
2008-03-12 13:13:50 +00:00
|
|
|
$graph = nucastgraph ($hostname . "/". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'uptime':
|
2008-03-12 13:13:50 +00:00
|
|
|
$graph = uptimegraph ($hostname . "/uptime.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
2007-06-06 09:23:41 +00:00
|
|
|
case 'unixfs_dev':
|
|
|
|
$graph = unixfsgraph_dev ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'unixfs':
|
2007-06-06 09:23:41 +00:00
|
|
|
$graph = unixfsgraph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
2009-03-30 11:20:18 +00:00
|
|
|
case 'bgp_updates':
|
2008-03-15 17:58:15 +00:00
|
|
|
$bgpPeerIdentifier = mysql_result(mysql_query("SELECT bgpPeerIdentifier FROM bgpPeers WHERE bgpPeer_id = '".$_GET['peer']."'"),0);
|
|
|
|
$graph = bgpupdatesgraph ($hostname . "/bgp-" . $bgpPeerIdentifier . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2009-03-30 11:20:18 +00:00
|
|
|
case 'cbgp_prefixes':
|
|
|
|
$bgpPeerIdentifier = mysql_result(mysql_query("SELECT bgpPeerIdentifier FROM bgpPeers WHERE bgpPeer_id = '".$_GET['peer']."'"),0);
|
|
|
|
$graph = graph_cbgp_prefixes ($hostname . "/cbgp-" . $bgpPeerIdentifier . ".".$_GET['afi'].".".$_GET['safi'].".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'calls':
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'ip_graph':
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = ip_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'icmp_graph':
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = icmp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'tcp_graph':
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = tcp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'udp_graph':
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = udp_graph ($hostname . "/netinfo.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
|
|
|
case 'cpu':
|
|
|
|
if($os == "Linux" || $os == "NetBSD" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "Windows" || $os == "m0n0wall" || $os == "Voswall" || $os == "pfSense" || $os == "DragonFly" || $os == "OpenBSD") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = cpugraphUnix ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2009-04-11 19:10:48 +00:00
|
|
|
} elseif($os == "IOS" || $os == "IOS XE") {
|
2009-04-13 19:16:22 +00:00
|
|
|
$graph = graph_device_cpmCPU ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2009-10-05 12:47:16 +00:00
|
|
|
} elseif($os == "CatOS") {
|
|
|
|
$graph = cpugraph ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Windows") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = cpugraphwin ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "ProCurve") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = cpugraphHP ($hostname . "/cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Snom") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = callsgraphSNOM ($hostname . "/data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2008-04-14 09:32:54 +00:00
|
|
|
} elseif($os == "ScreenOS") {
|
2008-04-25 13:38:52 +00:00
|
|
|
$graph = graph_netscreen_cpu ($hostname . "/netscreen-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2008-04-14 09:32:54 +00:00
|
|
|
} elseif($os == "Fortigate") {
|
2008-04-25 13:38:52 +00:00
|
|
|
$graph = graph_fortigate_cpu ($hostname . "/fortigate-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2008-07-22 08:24:34 +00:00
|
|
|
} elseif($os == "JunOS") {
|
|
|
|
$graph = graph_cpu_generic_single($hostname . "/junos-cpu.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
2009-04-13 19:16:22 +00:00
|
|
|
case 'dev_cpmCPU':
|
|
|
|
$graph = graph_device_cpmCPU ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2009-04-23 21:13:56 +00:00
|
|
|
case 'cpmCPU':
|
|
|
|
$graph = graph_cpmCPU ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'temp':
|
2007-06-06 09:23:41 +00:00
|
|
|
$graph = temp_graph ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
|
|
|
case 'dev_temp':
|
|
|
|
$graph = temp_graph_dev ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
break;
|
2009-04-23 21:13:56 +00:00
|
|
|
case 'cempMemPool':
|
|
|
|
$graph = graph_cempMemPool ($_GET['id'], $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'mem':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = memgraphUnix ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2009-04-11 19:10:48 +00:00
|
|
|
} elseif($os == "IOS" || $os == "IOS XE") {
|
2009-04-23 21:13:56 +00:00
|
|
|
$graph = graph_device_cempMemPool ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2009-10-05 12:47:16 +00:00
|
|
|
} elseif($os == "CatOS") {
|
|
|
|
$graph = memgraph ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Windows") {
|
|
|
|
} elseif($os == "ProCurve") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = memgraphHP ($hostname . "/mem.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'load':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = loadgraphUnix ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2009-04-11 19:10:48 +00:00
|
|
|
} elseif($os == "IOS" || $os == "IOS XE") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = loadgraph ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Windows") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = loadgraphwin ($hostname . "/load.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'users':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = usersgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Windows") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = usersgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'procs':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = procsgraphUnix ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
} elseif($os == "Windows") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = procsgraphwin ($hostname . "/sys.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'unixfs':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
2007-04-08 14:34:19 +00:00
|
|
|
$graph = unixfsgraph ($device_id, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'postfix':
|
2007-11-21 14:26:24 +00:00
|
|
|
case 'mail':
|
2007-04-03 14:10:23 +00:00
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = mailsgraphUnix ($hostname . "/mailstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
2007-11-21 14:26:24 +00:00
|
|
|
case 'mailerrors':
|
2007-04-03 14:10:23 +00:00
|
|
|
case 'postfixerrors':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
|
|
|
$graph = mailerrorgraphUnix ($hostname, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'courier':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = couriergraphUnix ($hostname . "/courierstats.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'apachehits':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = apachehitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'apachebits':
|
|
|
|
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD") {
|
2008-03-12 13:55:50 +00:00
|
|
|
$graph = apachebitsgraphUnix ($hostname . "/apache.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
break;
|
2009-03-30 11:20:18 +00:00
|
|
|
default:
|
2009-04-23 21:13:56 +00:00
|
|
|
if(is_file($config['install_dir'] . "/html/includes/graphs/$type.inc.php")) {
|
|
|
|
include($config['install_dir'] . "/html/includes/graphs/$type.inc.php");
|
|
|
|
} else {
|
|
|
|
echo("INCORRECT GRAPH TYPE");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
break;
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if($graph) {
|
2007-11-21 14:26:24 +00:00
|
|
|
header('Content-type: image/png');
|
2007-04-03 14:10:23 +00:00
|
|
|
echo(`cat graphs/$graphfile`);
|
|
|
|
} else {
|
2007-11-21 14:26:24 +00:00
|
|
|
header('Content-type: image/png');
|
2009-03-30 11:20:18 +00:00
|
|
|
$string = "Graph Generation Error";
|
|
|
|
$im = imagecreate($width, $height);
|
|
|
|
$orange = imagecolorallocate($im, 255, 255, 255);
|
|
|
|
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
|
|
|
|
imagestring($im, 3, $px, $height / 2 - 8, $string, imagecolorallocate($im, 128, 0, 0));
|
|
|
|
imagepng($im);
|
|
|
|
imagedestroy($im);
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$delete = `rm graphs/$graphfile`;
|
|
|
|
|
|
|
|
?>
|