case 'graph_diff': include_once("./include/top_header.php"); graph_diff(); include_once("./include/bottom_footer.php"); break; case 'item': include_once("./include/top_header.php"); item(); include_once("./include/bottom_footer.php"); break; case 'graph_remove': graph_remove(); header("Location: graphs.php"); break; case 'graph_edit': include_once("./include/top_header.php"); graph_edit(); include_once("./include/bottom_footer.php"); break; default: include_once("./include/top_header.php"); graph();
echo __("ERROR: No matching Devices found") . "\n"; echo __("Try php -q device_list.php") . "\n"; exit(1); } /* form a valid sql statement for device_id */ $selection = "WHERE " . str_replace("id", "device_id", array_to_sql_or($devices, "id")) . " "; } if (isset($graph_template_id) && !($graph_template_id === 0) && (db_fetch_cell("SELECT id FROM graph_templates WHERE id=$graph_template_id"))) { /* form a valid sql statement for device_id */ $selection .= (strlen($selection) ? " AND " : " WHERE ") . " graph_templates.id=" . $graph_template_id; } $graphs = getGraphs($selection, $columns); foreach ($graphs as $graph) { graph_remove($graph["local_graph_id"], $force); } } }else{ display_help($me); exit(0); } function graph_remove ($id, $delete_ds) { # get the data sources and graphs to act on if ($delete_ds) { /* delete all data sources referenced by this graph */