'; echo '
'; echo '

'.__('Refresh').'

'; echo html_print_select( [ '30' => __('30 seconds'), (string) SECONDS_1MINUTE => __('1 minute'), '180' => __('3 minute'), (string) SECONDS_5MINUTES => __('5 minutes'), ], 'refresh', $refresh, '', '', 0, true, false, false, '', false, 'margin-top: 3px;' ); echo '
'; echo '
'; echo '

'.__('Search').'

'; echo html_print_input_text('search', $search, '', 30, 255, true); echo '
'; echo '
'; echo '

'.__('Type').'

'; echo html_print_select( [ 0 => __('Group agents'), 1 => __('Group modules by tag'), 2 => __('Group modules by module group'), ], 'type', $type, '', '', 0, true, false, false, '', false, 'margin-top: 3px;width:70%' ); echo '
'; echo '
'; echo '

'.__('Show groups').'

'; echo html_print_checkbox('group', 1, $group, true); echo '
'; echo ''; } if ($getFilterType === true) { $filter = get_parameter('filter', 0); echo '
'; switch ($type) { case 0: default: echo '

'.__('Group').'

'; echo html_print_input( [ 'type' => 'select_groups', 'returnAllGroup' => true, 'name' => 'filter[]', 'selected' => $filter, 'return' => true, 'required' => true, 'privilege' => 'AR', ] ); break; case 1: echo '

'.__('Tag').'

'; if (tags_has_user_acl_tags($config['id_user']) === false) { echo html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name', 'filter[]', $filter, '', '', '', true, true, false, false, 'width: 200px', '5' ); } else { $user_tags = tags_get_user_tags($config['id_user'], 'AR'); if (!empty($user_tags)) { $id_user_tags = array_keys($user_tags); echo html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag IN ('.implode(',', $id_user_tags).') ORDER BY name', 'filter[]', $filter, '', '', '', true, true, false, false, 'width: 200px', '5' ); } else { echo html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name', 'filter[]', $filter, '', '', '', true, true, false, false, 'width: 200px', '5' ); } } break; case 2: $module_groups = modules_get_modulegroups(); // $module_groups[0] = _('Not assigned'); // hd(current($filter)); echo '

'.__('Module group').'

'; echo html_print_select( $module_groups, 'filter[]', $filter, '', _('Not assigned'), 0, true, false, false, '', false, 'width: 70%', false, false, false, '', true ); break; } echo '
'; } if ($getInfo === true) { $id = get_parameter('id', 0); switch ($type) { case 2: $data = db_get_row('tagente_modulo', 'id_agente_modulo', $id); // Nombre. echo '
'; echo '

'.__('Module name').'

'; echo ''.$data['nombre'].''; echo '
'; // Descripcion. echo '
'; echo '

'.__('Description').'

'; echo '

'.$data['descripcion'].'

'; echo '
'; // Agent. echo '
'; echo '

'.__('Agent').'

'; echo ''.agents_get_alias($data['id_agente']).''; echo '
'; // Group. echo '
'; echo '

'.__('Group').'

'; echo '

'.modules_get_modulegroup_name($data['id_module_group']).'

'; echo '
'; break; case 1: $data = db_get_row('tagente_modulo', 'id_agente_modulo', $id); // Nombre. echo '
'; echo '

'.__('Module name').'

'; echo ''.$data['nombre'].''; echo '
'; // Descripcion. echo '
'; echo '

'.__('Description').'

'; echo '

'.$data['descripcion'].'

'; echo '
'; // Agent. echo '
'; echo '

'.__('Agent').'

'; echo ''.agents_get_alias($data['id_agente']).''; echo '
'; // Group. echo '
'; echo '

'.__('Group').'

'; echo '

'.modules_get_modulegroup_name($data['id_module_group']).'

'; echo '
'; // Tag. $tags = db_get_all_rows_sql('SELECT id_tag FROM ttag_module WHERE id_agente_modulo ='.$id); $tags_name = ''; echo '
'; echo '

'.__('Tag').'

'; foreach ($tags as $key => $tag) { $tags_name .= tags_get_name($tag['id_tag']).', '; } $tags_name = trim($tags_name, ', '); echo '

'.$tags_name.'

'; echo '
'; break; case 0: default: $data = agents_get_agent($id); // Alias. echo '
'; echo '

'.__('Agent').'

'; echo ''.$data['alias'].''; echo '
'; // Ip. echo '
'; echo '

'.__('IP').'

'; echo '

'.$data['direccion'].'

'; echo '
'; // OS. echo '
'; echo '

'.__('OS').'

'; echo '

'.ui_print_os_icon($data['id_os'], true, true).'

'; echo '
'; // Description. echo '
'; echo '

'.__('Description').'

'; echo '

'.$data['comentarios'].'

'; echo '
'; // Group. echo '
'; echo '

'.__('Group').'

'; echo '

'.groups_get_name($data['id_grupo']).'

'; echo '
'; // Events. echo '
'; echo graph_graphic_agentevents( $id, 100, 80, SECONDS_1DAY, '', true, false, false, 1 ); echo '
'; break; } } return; }