$id_graph)); if ($res) $result = ui_print_success_message(__('Successfully deleted'), '', true); else $result = ui_print_error_message(__('Not deleted. Error deleting data'), '', true); $res = db_process_sql_delete('tgraph', array('id_graph' => $id_graph)); if ($res) $result = ui_print_success_message(__('Successfully deleted'), '', true); else $result = ui_print_error_message(__('Not deleted. Error deleting data'), '', true); echo $result; } else { db_pandora_audit("ACL Violation","Trying to delete a graph from access graph builder"); include ("general/noaccess.php"); exit; } } if ($view_graph) { $sql="SELECT * FROM tgraph_source WHERE id_graph = $id_graph"; $sources = db_get_all_rows_sql($sql); $sql="SELECT * FROM tgraph WHERE id_graph = $id_graph"; $graph = db_get_row_sql($sql); $id_user = $graph["id_user"]; $private = $graph["private"]; $width = $graph["width"]; $height = $graph["height"] + count($sources) * 10; $zoom = (int) get_parameter ('zoom', 0); //Increase the height to fix the leyend rise if ($zoom > 0) { switch ($zoom) { case 1: $width = 500; $height = 200 + count($sources) * 15; break; case 2: $width = 650; $height = 300 + count($sources) * 10; break; case 3: $width = 770; $height = 400 + count($sources) * 5; break; } } // Get different date to search the report. $date = (string) get_parameter ('date', date(DATE_FORMAT)); $time = (string) get_parameter ('time', date(TIME_FORMAT)); $unixdate = strtotime ($date . ' ' . $time); $period = (int) get_parameter ('period'); if (! $period) $period = $graph["period"]; else $period = $period; $events = $graph["events"]; $description = $graph["description"]; $stacked = (int) get_parameter ('stacked', -1); $percentil = ($graph['percentil']) ? 1 : null; $check = get_parameter('threshold',false); $fullscale = ($graph['fullscale']) ? 1 : null; if($check == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $check = true; $stacked = CUSTOM_GRAPH_BULLET_CHART_THRESHOLD; } if ($stacked == -1) $stacked = $graph["stacked"]; if ($stacked == CUSTOM_GRAPH_BULLET_CHART || $stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD) $height = 50; if ($stacked == CUSTOM_GRAPH_GAUGE ){ // Use the defined graph height, that's why // the user can setup graph height. $height = $graph["height"]; } $name = $graph["name"]; if (($graph["private"]==1) && ($graph["id_user"] != $id_user)) { db_pandora_audit("ACL Violation", "Trying to access to a custom graph not allowed"); include ("general/noaccess.php"); exit; } html_print_input_hidden ('line_width_graph', $config['custom_graph_width']); html_print_input_hidden ('custom_graph', 1); $url = "index.php?" . "sec=reporting&" . "sec2=operation/reporting/graph_viewer&" . "id=$id_graph&" . "view_graph=1"; $options = array(); if (check_acl ($config['id_user'], 0, "RW")) { $options = array( 'graph_list' => array('active' => false, 'text' => '' . html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .''), 'main' => array('active' => false, 'text' => '' . html_print_image("images/chart.png", true, array ("title" => __('Main data'))) .''), 'graph_editor' => array('active' => false, 'text' => '' . html_print_image("images/builder.png", true, array ("title" => __('Graph editor'))) .'') ); } $options['view']['text'] = '' . html_print_image("images/operation.png", true, array ("title" => __('View graph'))) .''; $options['view']['active'] = true; if ($config["pure"] == 0) { $options['screen']['text'] = "" . html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode'))) . ""; } else { $options['screen']['text'] = "" . html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode'))) . ""; // In full screen, the manage options are not available $options = array('view' => $options['view'], 'screen' => $options['screen']); } // Header ui_print_page_header ( $graph['name'], "images/chart.png", false, "", false, $options ); $width = null; $height = null; $params =array( 'period' => $period, 'width' => $width, 'height' => $height, 'date' => $unixdate, 'percentil' => $percentil, 'fullscale' => $fullscale ); $params_combined = array( 'stacked' => $stacked, 'id_graph' => $id_graph ); $graph_return = graphic_combined_module( false, $params, $params_combined ); if ($graph_return){ echo ""; echo "
"; echo $graph_return; // Add space to the legend transformation if ($stacked == CUSTOM_GRAPH_VBARS) { echo '



'; } echo "
"; } else { ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No data.') ) ); } if ($stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $stacked = 4; } $period_label = human_time_description_raw ($period); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "" . __('Date') . "" . " "; echo ""; echo html_print_input_text ('date', $date, '', 12, 10, true). ' '; echo ""; echo html_print_input_text ('time', $time, '', 7, 7, true). ' '; echo ""; echo "" . __('Time range') . ""; echo ""; echo html_print_extended_select_for_time ('period', $period, '', '', '0', 10, true); echo ""; $stackeds = array (); $stackeds[0] = __('Graph defined'); $stackeds[CUSTOM_GRAPH_AREA] = __('Area'); $stackeds[CUSTOM_GRAPH_STACKED_AREA] = __('Stacked area'); $stackeds[CUSTOM_GRAPH_LINE] = __('Line'); $stackeds[CUSTOM_GRAPH_STACKED_LINE] = __('Stacked line'); $stackeds[CUSTOM_GRAPH_BULLET_CHART] = __('Bullet chart'); $stackeds[CUSTOM_GRAPH_GAUGE] = __('Gauge'); $stackeds[CUSTOM_GRAPH_HBARS] = __('Horizontal Bars'); $stackeds[CUSTOM_GRAPH_VBARS] = __('Vertical Bars'); $stackeds[CUSTOM_GRAPH_PIE] = __('Pie'); html_print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false); echo ""; echo "
  ".__('Equalize maximum thresholds')."" . ui_print_help_tip (__("If an option is selected, all graphs will have the highest value from all modules included in the graph as a maximum threshold"), true); html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, false, false, '', false); echo "
"; echo "
"; $zooms = array(); $zooms[0] = __('Graph defined'); $zooms[1] = __('Zoom x1'); $zooms[2] = __('Zoom x2'); $zooms[3] = __('Zoom x3'); html_print_select ($zooms, 'zoom', $zoom , '', '', 0); echo ""; echo ""; echo "
"; echo "
"; /* We must add javascript here. Otherwise, the date picker won't work if the date is not correct because php is returning. */ ui_include_time_picker(); ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/"); ui_require_jquery_file(""); ?> width = '100%'; $tale->class = 'databox_frame'; $table->align = array (); $table->align[2] = 'center'; $table->head = array (); $table->head[0] = __('Graph name'); $table->head[1] = __('Description'); $table->data = array (); foreach ($graphs as $graph) { $data = array (); $data[0] = ''.$graph['name'].''; $data[1] = $graph["description"]; array_push ($table->data, $data); } html_print_table ($table); } else { echo "
".__('There are no defined reportings')."
"; } ?>