2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-08-22 20:07:32 +02:00
|
|
|
|
2009-06-08 20:26:14 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2006-07-06 19:06:59 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-08-22 20:07:32 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2006-07-06 19:06:59 +02:00
|
|
|
// 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.
|
2018-11-21 13:08:58 +01:00
|
|
|
// Don't start a session before this import.
|
|
|
|
// The session is configured and started inside the config process.
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once '../../include/config.php';
|
|
|
|
require_once $config['homedir'].'/include/auth/mysql.php';
|
|
|
|
require_once $config['homedir'].'/include/functions.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_db.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_reporting.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_graph.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_modules.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_agents.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_tags.php';
|
2018-08-01 13:16:21 +02:00
|
|
|
enterprise_include_once('include/functions_agents.php');
|
2006-07-09 01:32:38 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2015-03-23 19:51:59 +01:00
|
|
|
|
|
|
|
// Metaconsole connection to the node
|
2019-01-30 16:18:44 +01:00
|
|
|
$server_id = (int) get_parameter('server');
|
2015-08-10 17:04:53 +02:00
|
|
|
if (is_metaconsole() && !empty($server_id)) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$server = metaconsole_get_connection_by_id($server_id);
|
|
|
|
// Error connecting
|
|
|
|
if (metaconsole_connect($server) !== NOERR) {
|
|
|
|
echo '<html>';
|
|
|
|
echo '<body>';
|
|
|
|
ui_print_error_message(__('There was a problem connecting with the node'));
|
|
|
|
echo '</body>';
|
|
|
|
echo '</html>';
|
|
|
|
exit;
|
|
|
|
}
|
2012-07-26 18:06:52 +02:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$user_language = get_user_language($config['id_user']);
|
|
|
|
if (file_exists('../../include/languages/'.$user_language.'.mo')) {
|
|
|
|
$l10n = new gettext_reader(new CachedFileReader('../../include/languages/'.$user_language.'.mo'));
|
|
|
|
$l10n->load_tables();
|
2012-04-14 04:30:59 +02:00
|
|
|
}
|
|
|
|
|
2012-03-01 17:41:02 +01:00
|
|
|
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
|
2015-04-20 15:32:12 +02:00
|
|
|
|
2018-04-26 10:24:37 +02:00
|
|
|
$label = get_parameter('label');
|
|
|
|
$label = base64_decode($label);
|
|
|
|
$id = get_parameter('id');
|
2019-01-30 16:18:44 +01:00
|
|
|
$id_agent = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $id);
|
|
|
|
$alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
|
|
|
|
// $agent = agents_get_agent_with_ip ("192.168.50.31");
|
|
|
|
// $label = rawurldecode(urldecode(base64_decode(get_parameter('label', ''))));
|
2009-10-06 21:33:25 +02:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
2019-01-30 16:18:44 +01:00
|
|
|
<head>
|
|
|
|
<?php
|
|
|
|
// Parsing the refresh before sending any header
|
|
|
|
$refresh = (int) get_parameter('refresh', -1);
|
|
|
|
if ($refresh > 0) {
|
|
|
|
$query = ui_get_url_refresh(false);
|
|
|
|
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title><?php echo __('%s Graph', get_product_name()).' ('.$alias.' - '.$label; ?>)</title>
|
|
|
|
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
|
2019-02-05 09:23:53 +01:00
|
|
|
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
|
2019-01-30 16:18:44 +01:00
|
|
|
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery-3.3.1.min.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
|
|
|
|
<?php
|
|
|
|
require_once $config['homedir'].'/include/graphs/functions_flot.php';
|
|
|
|
echo include_javascript_dependencies_flot_graph(true, '../');
|
|
|
|
?>
|
|
|
|
<script type='text/javascript'>
|
|
|
|
window.onload = function() {
|
|
|
|
// Hack to repeat the init process to period select
|
|
|
|
var periodSelectId = $('[name="period"]').attr('class');
|
|
|
|
|
|
|
|
period_select_init(periodSelectId);
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</head>
|
2019-05-07 16:07:07 +02:00
|
|
|
<body style='background:#ffffff;'>
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
<?php
|
|
|
|
echo "<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>";
|
|
|
|
echo '<p>'.__('The CSV export has been successful.').'</p>';
|
|
|
|
echo '</div>';
|
|
|
|
// Module id
|
|
|
|
$id = (int) get_parameter('id', 0);
|
|
|
|
// Agent id
|
|
|
|
$agent_id = (int) modules_get_agentmodule_agent($id);
|
|
|
|
|
|
|
|
if (empty($id) || empty($agent_id)) {
|
|
|
|
ui_print_error_message(__('There was a problem locating the source of the graph'));
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ACL
|
|
|
|
$all_groups = agents_get_all_groups_agent($agent_id);
|
|
|
|
if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')) {
|
|
|
|
include $config['homedir'].'/general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$draw_alerts = get_parameter('draw_alerts', 0);
|
|
|
|
|
|
|
|
$period = get_parameter('period');
|
|
|
|
$id = get_parameter('id', 0);
|
|
|
|
$label = get_parameter('label', '');
|
|
|
|
$label_graph = base64_decode(get_parameter('label', ''));
|
|
|
|
$start_date = get_parameter('start_date', date('Y/m/d'));
|
|
|
|
$start_time = get_parameter('start_time', date('H:i:s'));
|
|
|
|
$draw_events = get_parameter('draw_events', 0);
|
|
|
|
$graph_type = get_parameter('type', 'sparse');
|
|
|
|
$zoom = get_parameter('zoom', $config['zoom_graph']);
|
|
|
|
$baseline = get_parameter('baseline', 0);
|
|
|
|
$show_events_graph = get_parameter('show_events_graph', 0);
|
|
|
|
$show_percentil = get_parameter('show_percentil', 0);
|
|
|
|
$time_compare_separated = get_parameter('time_compare_separated', 0);
|
|
|
|
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
|
|
|
|
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
|
|
|
|
|
|
|
|
$fullscale_sent = get_parameter('fullscale_sent', 0);
|
|
|
|
if (!$fullscale_sent) {
|
|
|
|
if (!isset($config['full_scale_option']) || $config['full_scale_option'] == 0) {
|
|
|
|
$fullscale = 0;
|
|
|
|
} else if ($config['full_scale_option'] == 1) {
|
|
|
|
$fullscale = 1;
|
|
|
|
} else if ($config['full_scale_option'] == 2) {
|
|
|
|
if ($graph_type == 'boolean') {
|
|
|
|
$fullscale = 1;
|
|
|
|
} else {
|
|
|
|
$fullscale = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$fullscale = get_parameter('fullscale', 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// To avoid the horizontal overflow
|
|
|
|
$width -= 20;
|
|
|
|
|
|
|
|
$time_compare = false;
|
|
|
|
|
|
|
|
if ($time_compare_separated) {
|
|
|
|
$time_compare = 'separated';
|
|
|
|
} else if ($time_compare_overlapped) {
|
|
|
|
$time_compare = 'overlapped';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($zoom > 1) {
|
|
|
|
$height = ($height * ($zoom / 2.1));
|
|
|
|
$width = ($width * ($zoom / 1.4));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Build date
|
|
|
|
$date = strtotime("$start_date $start_time");
|
|
|
|
$now = time();
|
|
|
|
|
|
|
|
if ($date > $now) {
|
|
|
|
$date = $now;
|
|
|
|
}
|
|
|
|
|
|
|
|
$urlImage = ui_get_full_url(false, false, false, false);
|
|
|
|
|
|
|
|
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
|
|
|
|
|
|
|
|
|
2019-05-08 09:35:28 +02:00
|
|
|
// Graph.
|
2019-05-07 16:07:07 +02:00
|
|
|
echo '<div style="padding-top: 60px;">';
|
2019-01-30 16:18:44 +01:00
|
|
|
$width = '90%';
|
|
|
|
$height = '450';
|
|
|
|
|
|
|
|
switch ($graph_type) {
|
|
|
|
case 'boolean':
|
|
|
|
case 'sparse':
|
|
|
|
case 'string':
|
|
|
|
$params = [
|
|
|
|
'agent_module_id' => $id,
|
|
|
|
'period' => $period,
|
|
|
|
'show_events' => $draw_events,
|
|
|
|
'title' => $label_graph,
|
|
|
|
'unit_name' => $unit,
|
|
|
|
'show_alerts' => $draw_alerts,
|
|
|
|
'date' => $date,
|
|
|
|
'unit' => $unit,
|
|
|
|
'baseline' => $baseline,
|
|
|
|
'homeurl' => $urlImage,
|
|
|
|
'adapt_key' => 'adapter_'.$graph_type,
|
|
|
|
'compare' => $time_compare,
|
|
|
|
'show_unknown' => $unknown_graph,
|
|
|
|
'percentil' => (($show_percentil) ? $config['percentil'] : null),
|
|
|
|
'type_graph' => $config['type_module_charts'],
|
|
|
|
'fullscale' => $fullscale,
|
|
|
|
'zoom' => $zoom,
|
|
|
|
];
|
|
|
|
echo grafico_modulo_sparse($params);
|
|
|
|
echo '<br>';
|
|
|
|
if ($show_events_graph) {
|
|
|
|
$width = '500';
|
|
|
|
echo graphic_module_events(
|
|
|
|
$id,
|
|
|
|
$width,
|
|
|
|
$height,
|
|
|
|
$period,
|
|
|
|
$config['homeurl'],
|
|
|
|
$zoom,
|
|
|
|
'adapted_'.$graph_type,
|
|
|
|
$date,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
echo fs_error_image('../images');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-08 09:35:28 +02:00
|
|
|
// FORM TABLE.
|
2019-01-30 16:18:44 +01:00
|
|
|
$table = html_get_predefined_table('transparent', 2);
|
2019-05-07 16:07:07 +02:00
|
|
|
$table->width = '100%';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->id = 'stat_win_form_div';
|
2019-05-07 16:07:07 +02:00
|
|
|
$table->style[0] = 'text-align:left;';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->style[1] = 'text-align:left;';
|
2019-05-07 16:07:07 +02:00
|
|
|
$table->styleTable = 'margin-bottom: 20px;';
|
2019-05-27 16:18:10 +02:00
|
|
|
$table->class = 'table_modal_alternate';
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Refresh time');
|
|
|
|
$data[1] = html_print_extended_select_for_time(
|
|
|
|
'refresh',
|
|
|
|
$refresh,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
0,
|
|
|
|
7,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Begin date');
|
|
|
|
$data[1] = html_print_input_text('start_date', $start_date, '', 10, 20, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Begin time');
|
|
|
|
$data[1] = html_print_input_text('start_time', $start_time, '', 10, 10, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
if (!modules_is_boolean($id)) {
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Zoom');
|
|
|
|
$options = [];
|
|
|
|
$options[$zoom] = 'x'.$zoom;
|
|
|
|
$options[1] = 'x1';
|
|
|
|
$options[2] = 'x2';
|
|
|
|
$options[3] = 'x3';
|
|
|
|
$options[4] = 'x4';
|
|
|
|
$options[5] = 'x5';
|
|
|
|
$data[1] = html_print_select($options, 'zoom', $zoom, '', '', 0, true, false, false);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Time range');
|
|
|
|
$data[1] = html_print_extended_select_for_time(
|
|
|
|
'period',
|
|
|
|
$period,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
0,
|
|
|
|
7,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Show events');
|
|
|
|
$disabled = false;
|
|
|
|
if (isset($config['event_replication'])) {
|
|
|
|
if ($config['event_replication'] && !$config['show_events_in_local']) {
|
|
|
|
$disabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch(
|
2019-01-30 16:18:44 +01:00
|
|
|
'draw_events',
|
|
|
|
1,
|
|
|
|
(bool) $draw_events,
|
|
|
|
true,
|
|
|
|
$disabled
|
|
|
|
);
|
|
|
|
if ($disabled) {
|
|
|
|
$data[1] .= ui_print_help_tip(
|
|
|
|
__("'Show events' is disabled because this %s node is set to event replication.", get_product_name()),
|
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Show alerts');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch('draw_alerts', 1, (bool) $draw_alerts, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
/*
|
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Show event graph');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch ("show_events_graph", 1, (bool) $show_events_graph, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
*/
|
|
|
|
|
|
|
|
switch ($graph_type) {
|
|
|
|
case 'boolean':
|
|
|
|
case 'sparse':
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Show percentil');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch('show_percentil', 1, (bool) $show_percentil, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Time compare (Overlapped)');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch('time_compare_overlapped', 1, (bool) $time_compare_overlapped, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Time compare (Separated)');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch('time_compare_separated', 1, (bool) $time_compare_separated, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Show unknown graph');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch('unknown_graph', 1, (bool) $unknown_graph, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$data = [];
|
|
|
|
$data[0] = __('Show full scale graph (TIP)');
|
2019-05-27 17:37:57 +02:00
|
|
|
$data[1] = html_print_checkbox_switch(
|
2019-01-30 16:18:44 +01:00
|
|
|
'fullscale',
|
|
|
|
1,
|
|
|
|
(bool) $fullscale,
|
|
|
|
true,
|
|
|
|
false
|
|
|
|
);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$form_table = html_print_table($table, true);
|
|
|
|
$form_table .= '<div style="width:100%; text-align:right;">'.html_print_submit_button(
|
|
|
|
__('Reload'),
|
|
|
|
'submit',
|
|
|
|
false,
|
|
|
|
'class="sub upd"',
|
|
|
|
true
|
|
|
|
).'</div>';
|
|
|
|
|
|
|
|
|
2019-05-08 09:35:28 +02:00
|
|
|
// Menu.
|
|
|
|
$menu_form = "<form method='get' action='stat_win.php'>".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true);
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2019-05-08 09:35:28 +02:00
|
|
|
if (!empty($server_id)) {
|
|
|
|
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_GET['type'])) {
|
|
|
|
$type = get_parameter_get('type');
|
|
|
|
$menu_form .= html_print_input_hidden('type', $type, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
echo $menu_form;
|
|
|
|
echo '<div class="module_graph_menu_dropdown">
|
2019-05-07 16:07:07 +02:00
|
|
|
<div id="module_graph_menu_header" class="module_graph_menu_header">
|
2019-05-08 09:35:28 +02:00
|
|
|
'.html_print_image('images/arrow_down_green.png', true, ['class' => 'module_graph_menu_arrow', 'float' => 'left'], false, false, true).'
|
2019-05-07 16:07:07 +02:00
|
|
|
<span>'.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).'</span>
|
2019-05-08 09:35:28 +02:00
|
|
|
'.html_print_image('images/config.png', true, ['float' => 'right'], false, false, true).'
|
2019-05-07 16:07:07 +02:00
|
|
|
</div>
|
|
|
|
<div class="module_graph_menu_content module_graph_menu_content_closed" style="display:none;">'.$form_table.'</div>
|
|
|
|
</div>';
|
2019-05-08 09:35:28 +02:00
|
|
|
echo '</form>';
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
// Hidden div to forced title
|
|
|
|
html_print_div(
|
|
|
|
[
|
|
|
|
'id' => 'forced_title_layer',
|
|
|
|
'class' => 'forced_title_layer',
|
|
|
|
'hidden' => true,
|
|
|
|
]
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
|
|
|
|
</body>
|
2010-09-13 12:26:33 +02:00
|
|
|
</html>
|
2015-08-10 17:04:53 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
// Echo the script tags of the datepicker and the timepicker
|
|
|
|
// Modify the user language cause the ui.datepicker language files use - instead _
|
|
|
|
$custom_user_language = str_replace('_', '-', $user_language);
|
2019-01-30 16:18:44 +01:00
|
|
|
ui_require_jquery_file('ui.datepicker-'.$custom_user_language, 'include/javascript/i18n/', true);
|
2015-08-10 17:04:53 +02:00
|
|
|
ui_include_time_picker(true);
|
|
|
|
?>
|
|
|
|
|
2012-08-31 13:59:46 +02:00
|
|
|
<script>
|
2019-01-30 16:18:44 +01:00
|
|
|
$('#checkbox-time_compare_separated').click(function() {
|
|
|
|
$('#checkbox-time_compare_overlapped').removeAttr('checked');
|
|
|
|
});
|
|
|
|
$('#checkbox-time_compare_overlapped').click(function() {
|
|
|
|
$('#checkbox-time_compare_separated').removeAttr('checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
// Add datepicker and timepicker
|
|
|
|
$("#text-start_date").datepicker({
|
|
|
|
dateFormat: "<?php echo DATE_FORMAT_JS; ?>"
|
|
|
|
});
|
|
|
|
$("#text-start_time").timepicker({
|
|
|
|
showSecond: true,
|
|
|
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
|
|
|
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
|
|
|
timeText: '<?php echo __('Time'); ?>',
|
|
|
|
hourText: '<?php echo __('Hour'); ?>',
|
|
|
|
minuteText: '<?php echo __('Minute'); ?>',
|
|
|
|
secondText: '<?php echo __('Second'); ?>',
|
|
|
|
currentText: '<?php echo __('Now'); ?>',
|
|
|
|
closeText: '<?php echo __('Close'); ?>'
|
|
|
|
});
|
|
|
|
|
|
|
|
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
|
|
|
|
|
2019-05-08 09:35:28 +02:00
|
|
|
// Menu.
|
2019-05-07 16:07:07 +02:00
|
|
|
$('#module_graph_menu_header').on('click', function(){
|
2019-05-08 10:28:00 +02:00
|
|
|
var arrow = $('#module_graph_menu_header .module_graph_menu_arrow');
|
|
|
|
var arrow_up = 'arrow_up_green';
|
|
|
|
var arrow_down = 'arrow_down_green';
|
2019-05-07 16:07:07 +02:00
|
|
|
if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){
|
|
|
|
$('.module_graph_menu_content').show();
|
|
|
|
$('.module_graph_menu_content').removeClass('module_graph_menu_content_closed');
|
2019-05-08 10:28:00 +02:00
|
|
|
arrow.attr('src',arrow.attr('src').replace(arrow_down, arrow_up));
|
2019-05-07 16:07:07 +02:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
$('.module_graph_menu_content').hide();
|
|
|
|
$('.module_graph_menu_content').addClass('module_graph_menu_content_closed');
|
2019-05-08 10:28:00 +02:00
|
|
|
arrow.attr('src',arrow.attr('src').replace(arrow_up, arrow_down));
|
2019-05-07 16:07:07 +02:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
});
|
2019-05-07 16:07:07 +02:00
|
|
|
|
2018-05-18 14:22:39 +02:00
|
|
|
</script>
|