Reportes de Declaraciones de los Funcionarios
<%
/********************* Despliega el formulario de captura y validación de datos de un nuevo usuario del sistema*************************/
out.println("");
String nompag[] = request.getRequestURI().split("/");
/********************** tomo la fecha del sistema *************************/
Date hoy = new Date();
SimpleDateFormat formato = new SimpleDateFormat("yyyy-MM-dd");
String fecha_hoy = formato.format(hoy);
%>
<%
//Connection lcnt_con = null;
ResultSet lrs_res = null;
Statement lst_stm = null;
String ls_query = new String("");
/*INICIO. Segunda Conexión*/
ConexionDeclaranet cd = null;
Connection lcd_connection = null;
//Statement lstg_conecta=null;
/*FIN. SEGUNDA CONEXIÓN*/
String emergent_error = new String("");
boolean lb_connection = false;
String debug = new String("si");
//********* INICIO. Conexión a la base de datos ********/
try {
if (!Config.getParametro("debug").equals("si")) {
debug = "no";
}
cd = new ConexionDeclaranet();
lcd_connection = cd.getConnection();
lst_stm = lcd_connection.createStatement();
lb_connection = true;
}catch (Exception e) {
emergent_error = "Error al conectarse a la base de datos 2 ";
}
/**********FIN. CONEXIÓN A LA BASE DE DATOS*******/
//********* Validación fundamental para evitar ejecución de código sin privilegios suficientes **********//
try {
if (!Permisos.PermisoModulo(nompag[nompag.length - 1].toString(), Integer.parseInt(session.getAttribute("id_user").toString()))) {
if (lb_connection) {
lst_stm.close();
//lst_stm2.close();
lcd_connection.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 { //obtengo la dependencia la que pertenece el usuario
%>
REPORTES - OFICIOS
<%
} catch (Exception e) {
emergent_error = "Error al actualizar la base de datos ";
if (debug.equals("si")) {
emergent_error += e + " Query actual: " + ls_query;
}
%>