juanmanuelr a206db6db7 2011-07-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_html.php
	include/styles/dialog.css
	include/styles/pandora_blackmetal.css
	include/styles/menu.css
	include/styles/pandora_black.css
	include/styles/pandora.css
	include/functions_ui.php
	extensions/update_manager/main.php
	operation/visual_console/index.php
	operation/agentes/status_monitor.php
	operation/agentes/estado_ultimopaquete.php
	operation/agentes/alerts_status.php
	operation/agentes/estado_generalagente.php
	operation/agentes/estado_agente.php
	operation/agentes/gis_view.php
	operation/agentes/estado_monitores.php
	operation/agentes/ver_agente.php
	operation/agentes/graphs.php
	operation/agentes/group_view.php
	operation/users/user_edit.php
	operation/events/events_list.php
	operation/messages/message.php
	operation/reporting/graph_viewer.php
	pandoradb.data.postgreSQL.sql
	pandoradb.data.oracle.sql
	images/agents_group.png
	images/application_double.png
	images/sitemap.png
	images/application_edit.png
	images/file.png
	images/page_white_text.png
	images/zoom.png
	images/page_refresh.png
	images/cog_del.png
	images/setup.png
	images/tag_red.png
	images/computer_error.png
	images/ok.png
	images/link_delete.png
	images/attachment.png
	images/god5.png
	images/god9.png
	images/down.png
	images/lightbulb.png
	images/help.png
	images/brick.png
	images/pill.png
	images/link_edit.png
	images/database_gear.png
	images/b_white.png
	images/wrench_orange.png
	images/up.png
	images/link_add.png
	images/chart_curve.png
	images/email_open.png
	images/page_white.png
	images/link2.png
	images/box.png
	images/clock.png
	images/note.png
	images/rss.png
	images/skin/skin_default/include/styles/pandora.css
	images/extensions.png
	images/flag_red.png
	images/database.png
	images/images.png
	images/cog.png
	images/b_yellow.png
	images/groups_small/clock.png
	images/groups_small/world.png
	images/groups_small/server_database.png
	images/groups_small/computer.png
	images/cancel.png
	images/add.png
	images/mouse.png
	images/server_database.png
	images/computer.png
	images/book_edit.png
	images/lupa.png
	images/heart.png
	images/database_lightning.png
	images/user.png
	images/link_break.png
	images/edit.png
	images/page_white_magnify.png
	images/normalscreen.png
	images/sitemap_color.png
	images/go.png
	images/config.png
	images/database_refresh.png
	images/link_go.png
	images/comments.png
	images/email.png
	images/lock.png
	images/os_icons/so_linux.png
	images/os_icons/android_small.png
	images/os_icons/android.png
	images/os_icons/so_linux_small.png
	images/error.png
	images/god3.png
	images/god7.png
	images/calendar_view_day.png
	images/data.png
	images/fullscreen.png
	images/server_web.png
	images/lupa_15x15.png
	images/lightning_go.png
	images/star.png
	images/user_suit.png
	images/upd.png
	images/application.png
	images/music_note.png
	images/lightbulb_off.png
	images/application_not_writable.png
	images/sort_down.png
	images/eye.png
	images/lightning.png
	images/header.jpg
	images/wrench.png
	images/mimetypes/unknown.png
	images/mimetypes/image.png
	images/mimetypes/zip.png
	images/mimetypes/directory.png
	images/mimetypes/text.png
	images/delete.png
	images/bricks.png
	images/world.png
	images/wand.png
	images/delete_modules.png
	images/disk.png
	images/group.png
	images/god8.png
	images/server.png
	images/bug.png
	images/page_lightning.png
	images/house.png
	images/log-out.png
	images/monitor.png
	images/information.png
	images/cross.png
	images/sort_up.png
	general/login_page.php
	general/logon_ok.php
	general/logoff.php
	godmode/groups/group_list.php
	godmode/admin_access_logs.php
	godmode/db/db_audit.php
	godmode/db/db_refine.php
	godmode/db/db_event.php
	godmode/agentes/agent_template.php
	godmode/agentes/module_manager_editor_common.php
	godmode/agentes/fields_manager.php
	godmode/agentes/module_manager.php
	godmode/agentes/modificar_agente.php
	godmode/agentes/agent_manager.php
	godmode/servers/recon_script.php
	godmode/servers/plugin.php
	godmode/servers/manage_recontask.php
	godmode/servers/modificar_server.php
	godmode/alerts/alert_list.list.php
	godmode/alerts/alert_templates.php
	godmode/alerts/alert_actions.php
	godmode/alerts/alert_commands.php
	godmode/snmpconsole/snmp_alert.php
	godmode/snmpconsole/snmp_filters.php
	godmode/users/user_list.php
	godmode/users/profile_list.php
	godmode/gis_maps/index.php
	godmode/massive/massive_operations.php
	godmode/modules/manage_network_templates.php
	godmode/modules/manage_network_components.php
	godmode/reporting/reporting_builder.list_items.php
	godmode/reporting/reporting_builder.main.php
	godmode/reporting/visual_console_builder.data.php
	godmode/reporting/reporting_builder.php
	godmode/reporting/graph_builder.preview.php
	godmode/tag/tag.php
	godmode/tag/edit_tag.php: Improved Css styles.

	* images/splash_pandora.png
	images/black_red_header.png
	images/black_background.png: Added images for new styles. 
	
	*include/styles/pandora_red.css
	include/styles/pandora_width.css: Deleted old styles.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4514 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-07-06 11:57:27 +00:00

231 lines
7.0 KiB
PHP

<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// 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 for version 2.
// 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.
// Login check
check_login ();
require_once ('include/functions_custom_graphs.php');
$delete_graph = (bool) get_parameter ('delete_graph');
$view_graph = (bool) get_parameter ('view_graph');
$id_graph = (int) get_parameter ('id');
// Delete module SQL code
if ($delete_graph) {
if (check_acl ($config['id_user'], 0, "AW")) {
$res = db_process_sql_delete('tgraph_source', array('id_graph' => $id_graph));
if ($res)
$result = "<h3 class=suc>".__('Successfully deleted')."</h3>";
else
$result = "<h3 class=error>".__('Not deleted. Error deleting data')."</h3>";
$res = db_process_sql_delete('tgraph', array('id_graph' => $id_graph));
if ($res)
$result = "<h3 class=suc>".__('Successfully deleted')."</h3>";
else
$result = "<h3 class=error>".__('Not deleted. Error deleting data')."</h3>";
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 ('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"];
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;
}
$url = "index.php?sec=reporting&sec2=operation/reporting/graph_viewer&id=$id_graph&view_graph=1";
if ($config["pure"] == 0) {
$options['screen'] = "<a href='$url&pure=1'>"
. html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} else {
$options['screen'] = "<a href='$url&pure=0'>"
. html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode')))
. "</a>";
}
// Header
ui_print_page_header (__('Reporting'). " &raquo; ". __('Combined image render'), "images/reporting.png", false, "", false, $options);
echo "<table class='databox_frame' cellpadding='0' cellspacing='0' width='98%'>";
echo "<tr><td>";
custom_graphs_print ($id_graph, $height, $width, $period, $stacked, false, $unixdate);
echo "</td></tr></table>";
$period_label = human_time_description_raw ($period);
echo "<form method='POST' action='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph'>";
echo "<table class='databox_frame' cellpadding='4' cellspacing='4' style='width: 98%'>";
echo "<tr>";
echo "<td>";
echo "<b>".__('Date')."</b>"." ";
echo "</td>";
echo "<td>";
echo html_print_input_text ('date', $date, '', 12, 10, true). ' ';
echo "</td>";
echo "<td>";
echo html_print_input_text ('time', $time, '', 7, 7, true). ' ';
echo "</td>";
echo "<td class='datos'>";
echo "<b>".__('Period')."</b>";
echo "</td>";
echo "<td class='datos'>";
html_print_select (custom_graphs_get_periods (), 'period', intval ($period / 3600),
'', '', 0, false, false, false);
echo "</td>";
echo "<td class='datos'>";
$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 "</td>";
echo "<td class='datos'>";
$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 "</td>";
echo "<td class='datos'>";
echo "<input type=submit value='".__('Update')."' class='sub upd'>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
/* 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');
?>
<script language="javascript" type="text/javascript">
$(document).ready (function () {
$("#loading").slideUp ();
$("#text-time").timeEntry ({spinnerImage: 'images/time-entry.png', spinnerSize: [20, 20, 0]});
$("#text-date").datepicker ();
$.datepicker.regional["<?php echo $config['language']; ?>"];
});
</script>
<?php
$datetime = strtotime ($date.' '.$time);
$report["datetime"] = $datetime;
if ($datetime === false || $datetime == -1) {
echo '<h3 class="error">'.__('Invalid date selected').'</h3>';
return;
}
return;
}
// Header
ui_print_page_header (__('Reporting'). " &raquo; ".__('Custom graph viewer'), "images/reporting.png", false, "", false, "" );
$graphs = custom_graphs_get_user ();
if (! empty ($graphs)) {
$table->width = '98%';
$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] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.
$graph['id_graph'].'">'.$graph['name'].'</a>';
$data[1] = $graph["description"];
array_push ($table->data, $data);
}
html_print_table ($table);
} else {
echo "<div class='nf'>".__('There are no defined reportings')."</div>";
}
?>