<%-- Document : frm_modificar_declarantes Created on : 28/09/2012, 03:53:36 PM Author : Martha --%> <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import = "conexion.*" import = "java.sql.*" import = "general.Config" import = "general.Permisos" import = "java.util.Date" import = "java.text.SimpleDateFormat" %> Actualizando el sistema... <% /*********************************** Permite modificar los datos de un usuario existente ***********************************************/ /********************************************creado por: Ing Martha Garcia*******************************************************/ out.println(""); String nompag[] = request.getRequestURI().split("/"); 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; ResultSet lrs_res2 = null; Statement lst_stm2 = null; ResultSet lrs_res3 = null; Statement lst_stm3 = null; ResultSet lrs_res4 = null; Statement lst_stm4 = null; /*Segunda Conexión*/ ConexionDeclaranet cd = null; Connection lcd_connection = null; //Statement lstg_conecta=null; /*FIN. SEGUNDA CONEXIÓN*/ String ls_query = new String(""); String emergent_error = new String(""); boolean lb_connection = false; String debug = new String("si"); String lower_limit = new String("0"); String upper_limit = new String("1"); String total_funcionarios = new String("0"); //Integer x=1, y=1; // Conexión a la base de datos /*try { if (!Config.getParametro("debug").equals("si")) { debug = "no"; } Conexion c = new Conexion(); lcnt_con = c.getConnection(); /*lst_stm = lcnt_con.createStatement(); lst_stm2 = lcnt_con.createStatement(); lst_stm3 = lcnt_con.createStatement(); lst_stm4 = 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; }*/ /********* 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(); lst_stm2 = lcd_connection.createStatement(); lst_stm3 = lcd_connection.createStatement(); lst_stm4= 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_stm2.close(); lst_stm.close(); lst_stm3.close(); lst_stm4.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 { ls_query = "SELECT" + " f.id_funcionario, " + " f.nombre, " + " f.ap_paterno, " + " f.ap_materno, " + " f.rfc, " + " f.curp, " + " f.sexo, " + " f.id_estadocivil, " + " f.id_nacionalidad, " + " IFNULL (f.tel, '') as tel, " + " a.clave, " + " IFNULL (dom.calle, '') as calle, " + " IFNULL (dom.num, '') as num, " + " IFNULL (dom.col, '') as col, " + " IFNULL (dom.cd, '') as cd, " + " IFNULL (dom.municipio_dom, 834) as municipio_dom, " + " IFNULL (dom.cp, '') as cp, " + " IFNULL (dom.edo_dom, 16) as edo_dom, " + " nac.fecha_nacimiento, " + " IFNULL (nac.cd_nacimiento, 834) as cd_nacimiento, " + " IFNULL (nac.edo_nacimiento, 16) as edo_nacimiento, " + " h.dependencia, " + " h.puesto, " + " if (a.fecha_alta='0000-00-00', '', a.fecha_alta) as fecha_alta, " + " if (a.fecha_baja='0000-00-00', '', a.fecha_baja) as fecha_baja, " + " a.id_altabaja, " + " a.status, " + " h.id_historial " + "FROM altabaja a " + "LEFT JOIN historial h USING(id_historial) " + "LEFT JOIN funcionarios f ON f.id_funcionario=a.id_funcionario " + "LEFT JOIN dom_funcionario dom ON dom.id_funcionario=a.id_funcionario " + "LEFT JOIN nacimiento_funcionario nac ON nac.id_funcionario=a.id_funcionario " + "WHERE a.id_altabaja = " + request.getParameter("id_altabaja")+" ;"; lrs_res = lst_stm.executeQuery(ls_query); if (lrs_res.next()) { %>
Actualización de la Información del Declarante
Datos Generales del Declarante " name="id_funcionario" id="id_funcionario" > " type="hidden">
 Apellido Paterno: " name="ap_paterno" id="ap_paterno" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">  Apellido Materno: " name="ap_materno" id="ap_materno" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">
 Nombre (s): " name="nombre" id="nombre" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">
 CURP: " name="curp" id="curp" class="cuadro_texto" maxlength="18" size="20" style="text-align: right;" onkeyup="javascript:mayusculas(this);">  RFC: " name="rfc" id="rfc" class="cuadro_texto" maxlength="13" size="15" style="text-align: right;" onkeyup="javascript:mayusculas(this);">
  Sexo:  Estado Civil    
 LUGAR DE NACIMIENTO
 Fecha de Nacimiento:  Nacionalidad:
 Entidad de nacimiento:  Ciudad de Nacimiento:
 DOMICILIO PARTICULAR
 Calle: " name="calle" id="calle" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">  Número: " name="num" id="num" class="cuadro_texto" maxlength="5" size="5" style="text-align: right;">  Colonia: " name="col" id="col" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">
 Localidad: " name="cd" id="cd" class="cuadro_texto" maxlength="50" size="50" style="text-align: right;" onkeyup="javascript:mayusculas(this);">  C. P. : " name="cp" id="cp" class="cuadro_texto" maxlength="5" size="5" style="text-align: right;" onkeypress='return acceptNum(this,event,"enteros");'>  Telefono: " name="tel" id="tel" class="cuadro_texto" maxlength="15" size="15" style="text-align: right;">
 Entidad Federativa:  Municipio:
  
<% } } catch (Exception e) { emergent_error = "Error al recuperar datos del historico "; if (debug.equals("si")) { emergent_error += e + " Query actual: " + ls_query; } %>
<%=emergent_error%>
<% } finally { lst_stm4.close(); lst_stm3.close(); lst_stm2.close(); lst_stm.close(); lcnt_con.close(); } } else { %>
<%=emergent_error%>
<% } //Registrar en la bitácora try { String mensaje_log = new String(""); mensaje_log = "Usuario -" + session.getAttribute("username").toString() + "- desplegó formulario para modificar el Equipo -" + request.getParameter("id_altabaja") + "-;"; Config.GuardarLog(Integer.parseInt(session.getAttribute("id_user").toString()), mensaje_log, 3); } catch (Exception e) { } %>