'; echo '
'.__('Group').' | '; echo ''; html_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'); html_print_select ($fields, "status", $status, 'this.form.submit();', __('All'), -1, false, false, true, '', false, 'width: 125px;'); echo ' | '; echo ''.__('Module group').' | '; echo ''; html_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 (users_get_groups ())); //$user_agents = array_keys (agents_get_group_agents($user_groups)); //$modules = db_get_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; case "oracle": $names = oracle_db_get_all_rows_filter ('user_tab_columns',array ('table_name' => 'TAGENTE_MODULO', 'column_name' => '<>NOMBRE'), 'column_name'); $column_names = ''; foreach ($names as $column_name => $value) { $column_names .= $value['column_name'] . ','; } $column_names = substr($column_names,0,-1); $sql = ' select nombre from (select distinct dbms_lob.substr(nombre,4000,1) as nombre, ' . $column_names .' 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 = db_get_all_rows_sql($sql); html_print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename", $ag_modulename, 'this.form.submit();', __('All'), '', false, false, true, '', false, 'width: 150px;'); echo ' | '.__('Search').' | '; echo ''; html_print_input_text ("ag_freestring", $ag_freestring, '', 20,30, false); echo ' | '; html_print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"'); echo " | |