File: export_index.php

package info (click to toggle)
cacti 0.6.7-2.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,000 kB
  • ctags: 1,120
  • sloc: php: 5,059; sql: 922; sh: 302; perl: 81; makefile: 56
file content (75 lines) | stat: -rw-r--r-- 3,268 bytes parent folder | download
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
<?/* 
+-------------------------------------------------------------------------+
| Copyright (C) 2002 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: the rrdtool frontend [php-auth, php-tree, php-form]              |
+-------------------------------------------------------------------------+
| This code is currently maintained and debugged by Ian Berry, any        |
| questions or comments regarding this code should be directed to:        |
| - iberry@raxnet.net                                                     |
+-------------------------------------------------------------------------+
| - raXnet - http://www.raxnet.net/                                       |
+-------------------------------------------------------------------------+
*/?>
<?

include ("include/database.php");
include_once ("include/rrd_functions.php");
include_once ("include/functions.php");
include ('include/config.php');
$action = "preview"; include ("export_header.php");

$array_settings = LoadSettingsIntoArray("","");


?><tr><td bgcolor="#<?print $color_light;?>" width="1%" rowspan="99999"></td><?

$sql_id = mysql_query("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",$cnn_id);

while ($graph_query_res = mysql_fetch_array($sql_id)) {
	$graphid = $graph_query_res[id];
	$graph_data_array["graph_width"] = $array_settings["preview"]["width"];
	$graph_data_array["graph_height"] = $array_settings["preview"]["height"];
	$graph_data_array["use"] = true;
	$graph_data_array["graph_nolegend"] = true;
	$graph_data_array["graph_start"] = -$array_settings["preview"]["timespan"];
	
	$image_filename = "prev_$graphid." . $graph_query_res[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_query_res[id],1,$graph_data_array);
	
	?><td width="25%"><a href="graph_<?print mysql_result($sql_id, $i, "id");?>.html"><img src="<?print $image_filename;?>" border="0" alt="rrdtool Graph"></a><?
	?></td><?
	$i++;
	$k++;
	
	if ($k==$array_settings["preview"]["columnnumber"]) {
	    $k = 0;
	    ?></tr><tr height="10"><td>&nbsp;</td></tr><tr><?
	}
	$i_rra = 0;
}
?></tr><?

include_once ("include/bottom_footer.php");