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 ('Y-m-j')); $time = (string) get_parameter ('time', date ('h:iA')); $unixdate = strtotime ($date.' '.$time); $period = (int) get_parameter ('period'); if (! $period) $period = $graph["period"]; else $period = 3600 * $period; $events = $graph["events"]; $description = $graph["description"]; $stacked = (int) get_parameter ('stacked', -1); if ($stacked == -1) $stacked = $graph["stacked"]; $name = $graph["name"]; $graphRows = db_get_all_rows_sql("SELECT t1.*, (SELECT t3.nombre FROM tagente AS t3 WHERE t3.id_agente = (SELECT t2.id_agente FROM tagente_modulo AS t2 WHERE t2.id_agente_modulo = t1.id_agent_module)) AS agent_name FROM tgraph_source AS t1 WHERE t1.id_graph = " . $id); $module_array = array(); $weight_array = array(); $agent_array = array(); if($graphRows === false) { $graphRows = array(); } foreach ($graphRows as $graphRow) { $module_array[] = $graphRow['id_agent_module']; $weight_array[] = $graphRow['weight']; $agent_array[] = $graphRow['agent_name']; } $modules = implode(',', $module_array); $weights = implode(',', $weight_array); echo ""; echo "
"; if(!empty($modules)) { require_once ($config["homedir"] . '/include/functions_graph.php'); echo graphic_combined_module2(explode (',', $modules), explode (',', $weights), $period, $width, $height, 'Combined%20Sample%20Graph', '', $events, 0, 0, $stacked, $unixdate); } else { echo "
".__('Empty graph')."
"; } 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 "".__('Period').""; echo ""; html_print_select (custom_graphs_get_periods (), 'period', intval ($period / 3600), '', '', 0, false, false, false); echo ""; $stackeds = array (); $stackeds[0] = __('Graph defined'); $stackeds[0] = __('Area'); $stackeds[1] = __('Stacked area'); $stackeds[2] = __('Line'); $stackeds[3] = __('Stacked line'); html_print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false); 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_require_css_file ('datepicker'); ui_require_jquery_file ('ui.core'); ui_require_jquery_file ('ui.datepicker'); ui_require_jquery_file ('timeentry'); ?> '.__('Invalid date selected').''; return; } ?>