0 && $data['monitor_checks'] > 0) { $data['monitor_health'] = format_numeric((100 - ($data['monitor_not_normal'] / ($data['monitor_checks'] / 100))), 1); } else { $data['monitor_health'] = 100; } if ($data['monitor_not_init'] > 0 && $data['monitor_checks'] > 0) { $data['module_sanity'] = format_numeric((100 - ($data['monitor_not_init'] / ($data['monitor_checks'] / 100))), 1); } else { $data['module_sanity'] = 100; } if (isset($data['alerts'])) { if ($data['monitor_alerts_fired'] > 0 && $data['alerts'] > 0) { $data['alert_level'] = format_numeric((100 - ($data['monitor_alerts_fired'] / ($data['alerts'] / 100))), 1); } else { $data['alert_level'] = 100; } } else { $data['alert_level'] = 100; $data['alerts'] = 0; } $data['monitor_bad'] = ($data['monitor_critical'] + $data['monitor_warning']); if ($data['monitor_bad'] > 0 && $data['monitor_checks'] > 0) { $data['global_health'] = format_numeric((100 - ($data['monitor_bad'] / ($data['monitor_checks'] / 100))), 1); } else { $data['global_health'] = 100; } $data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1); } ?>
class = 'databox';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head[0] = ''.__('%s Overview', get_product_name()).'';
$table->head_colspan[0] = 4;
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '
|
';
echo '
'; // END OF NEWS BOARD. } $nots = messages_get_overview('utimestamp', 'DESC', false); if (!empty($nots)) { // Notifications board. echo ' ';
echo ' ';
echo '
'; // EO Notifications board. } // LAST ACTIVITY. // Show last activity from this user. echo ' ';
$table = new stdClass();
$table->class = 'databox data';
$table->width = '100%';
// Don't specify px.
$table->data = [];
$table->size = [];
$table->size[0] = '5%';
$table->size[1] = '15%';
$table->size[2] = '15%';
$table->size[3] = '10%';
$table->size[4] = '25%';
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->title = ''.__('This is your last activity performed on the %s console', get_product_name()).'';
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql);
if ($sessions === false) {
$sessions = [];
}
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
$data[0] = ''.$session_id_usuario.'';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = str_replace([',', ', '], ', ', $session['descripcion']);
if (strlen($description) > 100) {
$data[4] = ' ';
// END OF LAST ACTIVIYY.
?>
'.io_safe_output(substr($description, 0, 150).'...').' ';
} else {
$data[4] = ''.io_safe_output($description).' ';
}
array_push($table->data, $data);
}
echo "";
html_print_table($table);
unset($table);
echo ' ';
echo ' |