<%
Config conf = new Config();
out.println("");
String nompag[] = request.getRequestURI().split("/");
%>
<%=conf.getParametro("nombre_sistema")%>
<%
/****** P�gina principal del sistema, aqui se despliega el framework principal y los iframes que contienen los menus y contenidos ******/
/********************************************creado por: Ing. Martha*******************************************************/
Connection lcnt_con = null;
ResultSet lrs_res = null;
Statement lst_stm = null;
String ls_query = new String("");
String emergent_error = new String("");
boolean lb_connection = false;
String debug = new String("si");
String id_supermodulos = new String("");
String script_reload = new String("");
// Conexi�n a la base de datos
try {
if (!conf.getParametro("debug").equals("si")) {
debug = "no";
}
Conexion c = new Conexion();
lcnt_con = c.getConnection();
lst_stm = lcnt_con.createStatement();
lb_connection = true;
} catch (Exception e) {
emergent_error = "Error al conectarse a la base de datos ";
if (debug.equals("si")) {
emergent_error += e;
}
lb_connection = false;
}
%>
<%
//********* Validaci�n fundamental para evitar ejecuci�n de c�digo sin privilegios suficientes **********//
Permisos permisos = new Permisos();
try {
if (!permisos.PermisoModulo(nompag[nompag.length - 1].toString(), Integer.parseInt(session.getAttribute("id_user").toString()))) {
if (lb_connection) {
lst_stm.close();
lcnt_con.close();
}
emergent_error += " Privilegios insuficientes. ";
lb_connection = false;
}
} catch (Exception e) {
emergent_error += " Privilegios insuficientes. ";
if (debug.equals("si")) {
emergent_error += "Trace: " + e.toString();
}
lb_connection = false;
}
//*******************************************************************************************************//
if (lb_connection) {
try {
id_supermodulos = request.getParameter("id_supermodulos").toString();
} catch (Exception e) {
id_supermodulos = "1";
}
%>
<%-- --%>
<%
// ls_query = "SELECT * FROM configuracion WHERE parametro LIKE 'opcion%' ORDER BY parametro;";
//lrs_res = lst_stm.executeQuery(ls_query);
%>
<%
script_reload += "cframe = document.getElementById('contentframe');\n"
+ "if (cframe.contentWindow.location.search.indexOf('id_variantes') >= 0)\n"
+ " search_string = cframe.contentWindow.location.search.substring(0,cframe.contentWindow.location.search.length-1)+GetSelectedVariant();\n "
+ "else if (cframe.contentWindow.location.search.indexOf('?') >= 0)\n"
+ " search_string = cframe.contentWindow.location.search+'&id_variantes='+GetSelectedVariant();\n"
+ "else\n"
+ " search_string = cframe.contentWindow.location.search+'?id_variantes='+GetSelectedVariant();\n"
+ "cframe.setAttribute('src', cframe.contentWindow.location.pathname+search_string);\n\n";
ls_query = "SELECT * FROM configuracion WHERE parametro LIKE 'opcion%' ORDER BY parametro;";
lrs_res = lst_stm.executeQuery(ls_query);
//Crea los frames para todos los m�dulos disponibles, extraidas de la base de datos
while (lrs_res.next()) {
String opc_validacion[] = lrs_res.getString("valor").split("/");
if (permisos.PermisoModuloSM(opc_validacion[opc_validacion.length - 1].toString(), Integer.parseInt(session.getAttribute("id_user").toString()), Integer.parseInt(id_supermodulos))) //if (Permisos.PermisoModulo(opc_validacion[opc_validacion.length-1].toString(), Integer.parseInt(session.getAttribute("id_user").toString())))
{
script_reload += "cframe = document.getElementById('contentframe_" + opc_validacion[opc_validacion.length - 1].toString() + "');\n"
+ "if (cframe.contentWindow.location.search.indexOf('id_variantes') >= 0)\n"
+ " search_string = cframe.contentWindow.location.search.substring(0,cframe.contentWindow.location.search.length-1)+GetSelectedVariant();\n "
+ "else if (cframe.contentWindow.location.search.indexOf('?') >= 0)\n"
+ " search_string = cframe.contentWindow.location.search+'&id_variantes='+GetSelectedVariant();\n"
+ "else\n"
+ " search_string = cframe.contentWindow.location.search+'?id_variantes='+GetSelectedVariant()\n"
+ "cframe.setAttribute('src', cframe.contentWindow.location.pathname+search_string);\n\n";
%>
<%
}
}
// Verifica si tiene privilegios de entrar a la Administracionde Usuarios
if (permisos.PermisoModulo("desp_mostrar_usuarios_PRINC.jsp", Integer.parseInt(session.getAttribute("id_user").toString()))) {
%>
<%
}
if (conf.getParametro("mostrar_panel_derecho").equals("si")) {
%>