mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-08 21:16:17 +09:00
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@446 860744bd-22fc-0310-8c96-e9fe5004b5ca
72 lines
3.0 KiB
PHP
72 lines
3.0 KiB
PHP
<?php
|
|
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2003 Ian Berry |
|
|
| |
|
|
| This program is free software; you can redistribute it and/or |
|
|
| modify it under the terms of the GNU General Public License |
|
|
| as published by the Free Software Foundation; either version 2 |
|
|
| of the License, or (at your option) any later version. |
|
|
| |
|
|
| This program is distributed in the hope that it will be useful, |
|
|
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
| GNU General Public License for more details. |
|
|
+-------------------------------------------------------------------------+
|
|
| cacti: a php-based graphing solution |
|
|
+-------------------------------------------------------------------------+
|
|
| Most of this code has been designed, written and is maintained by |
|
|
| Ian Berry. See about.php for specific developer credit. Any questions |
|
|
| or comments regarding this code should be directed to: |
|
|
| - iberry@raxnet.net |
|
|
+-------------------------------------------------------------------------+
|
|
| - raXnet - http://www.raxnet.net/ |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
include_once ("include/rrd_functions.php");
|
|
include_once ("include/functions.php");
|
|
$action = "preview";
|
|
include ("export_header.php");
|
|
|
|
$array_settings = LoadSettingsIntoArray("","");
|
|
|
|
|
|
print "<tr><td bgcolor='#$colors[light]' width='1%' rowspan='99999'></td>\n";
|
|
|
|
$graphs = db_fetch_assoc("select
|
|
g.id,g.title,g.imageformatid,
|
|
t.name
|
|
from rrd_graph g
|
|
left join def_image_type t
|
|
on g.imageformatid=t.id
|
|
and g.export=\"on\"
|
|
order by g.title");
|
|
|
|
if (sizeof($graphs) > 0) {
|
|
foreach ($graphs as $graph) {
|
|
$graph_data_array["graph_width"] = $array_settings[width];
|
|
$graph_data_array["graph_height"] = $array_settings[height];
|
|
$graph_data_array["use"] = true;
|
|
$graph_data_array["graph_nolegend"] = true;
|
|
$graph_data_array["graph_start"] = -$array_settings[time_span];
|
|
|
|
$image_filename = "prev_".$graph[ID] .".". $graph[Name];
|
|
|
|
$graph_data_array["export"] = true;
|
|
$graph_data_array["export_filename"] = $image_filename;
|
|
|
|
/* use rraid of 1 (daily) for now as default */
|
|
rrdtool_function_graph($graph[ID],1,$graph_data_array);
|
|
|
|
print "<td width='25%'><a href='graph_$graph[ID].html'><img src='$image_filename' border='0' alt='rrdtool Graph'></a></td>\n";
|
|
$k++;
|
|
|
|
if ($k % $array_settings[column_number] == 0) {
|
|
print "</tr><tr height='10'><td> </td></tr><tr>\n";
|
|
}
|
|
}
|
|
print "</tr>\n";
|
|
|
|
include_once ("include/bottom_footer.php");
|