\n"; if ($preview != 'on') { if ( ! mysql_query($y) ) { print "ERROR on DS import"; exit; } else { if ( ! ($result = mysql_query("SELECT LAST_INSERT_ID()")) ) { print "ERROR on last id"; exit; } else { $rrd_ds_id = mysql_result($result,'',0); } } } else { $rrd_ds_id = 'x'; } print "Setup Graph: $graph_import_query[$x]
\n"; if ($preview != 'on') { if ( ! mysql_query($graph_import_query[$x]) ) { print "ERROR on Graph import"; exit; } else { if ( ! ($result = mysql_query("SELECT LAST_INSERT_ID()")) ) { print "ERROR on last id"; exit; } else { $graph_id = mysql_result($result,'',0); $graph_item_import = "INSERT INTO rrd_graph_item SET DSID = $rrd_ds_id, ColorID = 1, GraphTypeID = 7, GraphID = $graph_id, ConsolidationFunction = 1"; } } } else { $graph_id = 'y'; } print "Setup Graph Items: $graph_item_import
\n"; if ($preview != 'on') { if ( ! mysql_query($graph_item_import) ) { print "ERROR on Graph item import"; exit; } } } } xml_parser_free($xml_parser); break; default: DrawFormHeader("rrdtool Data Source Import",true,false); DrawFormItem("Server File Name","The name for the RRD file to import; this is for files that are already on the server in the $path_rra/ directory."); DrawFormItemTextBox("s_fname","$s_fname","","19"); DrawFormItemCheckBox("preview","$preview","Preview only","off"); DrawFormItemHiddenTextBox("paction","$paction","import"); DrawFormSaveButton(); DrawFormFooter(); break; } include_once ("include/bottom_footer.php"); ?>