'; echo '
'.__('Group').' | '; echo ''; print_select_groups(false, "AR", true, "ag_group", $ag_group, 'this.form.submit();', '', '0', false, false, false, 'w130', false, 'width:150px;'); echo " | "; echo "".__('Monitor status')." | "; $fields = array (); $fields[0] = __('Normal'); $fields[1] = __('Warning'); $fields[2] = __('Critical'); $fields[3] = __('Unknown'); $fields[4] = __('Not normal'); //default $fields[5] = __('Not init'); print_select ($fields, "status", $status, 'this.form.submit();', __('All'), -1, false, false, true, '', false, 'width: 125px;'); echo ' | '; echo ''.__('Module group').' | '; echo ''; print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name", 'modulegroup', $modulegroup, 'this.form.submit();',__('All'), 0, false, false, true, false, 'width: 100px;'); echo ' |
'.__('Module name').' | '; echo ''; $user_groups = implode (",", array_keys (get_user_groups ())); //$user_agents = array_keys (get_group_agents($user_groups)); //$modules = get_db_all_rows_filter ('tagente_modulo', array('id_agente' => $user_agents, 'nombre' => '<>delete_pending'), 'DISTINCT(nombre)'); switch ($config["dbtype"]) { case "mysql": $sql = ' SELECT distinct(nombre) FROM tagente_modulo WHERE nombre <> "delete_pending" and id_agente in ( select id_agente from tagente where id_grupo IN ( select id_grupo from tusuario_perfil where id_usuario = "' . $config['id_user'] . '" and id_perfil IN ( select id_perfil from tperfil where agent_view = 1 ) ) OR (1 = ( SELECT is_admin FROM tusuario WHERE id_user = "' . $config['id_user'] . '" ) ) OR 0 IN ( select id_grupo from tusuario_perfil where id_usuario = "' . $config['id_user'] . '" and id_perfil IN ( select id_perfil from tperfil where agent_view = 1 ) ) )'; break; case "postgresql": $sql = ' select distinct(nombre) from tagente_modulo where nombre <> \'delete_pending\' and id_agente in ( select id_agente from tagente where id_grupo IN ( select id_grupo from tusuario_perfil where id_usuario = \'' . $config['id_user'] . '\' and id_perfil IN ( select id_perfil from tperfil where agent_view = 1 ) ) OR (1 = ( SELECT is_admin FROM tusuario WHERE id_user = \'' . $config['id_user'] . '\' ) ) OR 0 IN ( select id_grupo from tusuario_perfil where id_usuario = \'' . $config['id_user'] . '\' and id_perfil IN ( select id_perfil from tperfil where agent_view = 1 ) ) )'; break; } $modules = get_db_all_rows_sql($sql); print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename", $ag_modulename, 'this.form.submit();', __('All'), '', false, false, true, '', false, 'width: 150px;'); echo ' | '.__('Search').' | '; echo ''; print_input_text ("ag_freestring", $ag_freestring, '', 20,30, false); echo ' | '; print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"'); echo " | |