<%-- Document : frm_modificar_equipo_telefonico Created on : 17/11/2011, 05:50:06 PM Author : psoto --%> <%@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: L.I. Salvador Díaz Parra*******************************************************/ 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; String ls_query = new String(""); String emergent_error = new String(""); boolean lb_connection = false; String debug = new String("si"); String idfuente = new String(""); String nombre_usuario = new String(""); // 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(); 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 **********// 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(); 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 " + " id_equipo_computo, " + " CI, " + " IFNULL(tipo_telefono,'d') as tipo_telefono, " + " modelo, " + " pto_switch, " + " pto_panel, " + " IFNULL(DID,0) as DID, " + " IFNULL(extension,0) as extension, " + " id_usuarios_cargos, " + " id_area," + " tipo_propietario," + " fecha_adquisicion," + " fecha_garantia " + "FROM equipo_computo " + "LEFT JOIN usuarios_cargos cg USING(id_usuarios_cargos) " + "LEFT JOIN cat_areas ca USING(id_area) " + "WHERE id_equipo_computo="+ request.getParameter("id_equipo_computo"); lrs_res = lst_stm.executeQuery(ls_query); if(lrs_res.next()){ %>
Actualización de Teléfonia
Datos Generales " name="id_equipo_computo" id="id_equipo_computo" >
 Numero Contro Interno " name="CI" id="CI" class="cuadro_texto" maxlength="6" size="6" onkeypress='return acceptNum(this,event,"enteros");' >
 Área Responsable:  Usuario Responsable:
 Fecha de Adquisición:  Fecha de Limite de Garantia:
  Propietario de Equipo: checked<% }%> > Propio    checked<% }%> > Rentado    checked<% }%> > Hospedado   
 Tipo de Teléfono: checked<% }%> /> Analógico        checked<% }%> /> Digital  Modelo: " name="modelo" id="modelo" class="cuadro_texto" maxlength="20" size="20" style="text-align: right;">
 DID: " name="DID" id="DID" class="cuadro_texto" maxlength="10" size="12" style="text-align: right;" onkeypress='return acceptNum(this,event,"enteros");'>  No. Extensión: " name="extension" id="extension" class="cuadro_texto" maxlength="4" size="6" style="text-align: right;" onkeypress='return acceptNum(this,event,"enteros");'>
 Puerto en el panel de parcheo: " name="pto_panel" id="pto_panel" class="cuadro_texto" maxlength=8" size="8" style="text-align: right;" >  Puerto Avaya: " name="pto_switch" id="pto_switch" class="cuadro_texto" maxlength="8" size="8" style="text-align: right;" >
  
<% } else { emergent_error = "Error al recuperar datos del equipo de telefonia, debido aque no Existe "; %>
<%=emergent_error%>
<% } } catch (Exception e) { emergent_error = "Error al recuperar datos de la edicion de telefonia "; if (debug.equals("si")) { emergent_error += e + " Query actual: " + ls_query; } %>
<%=emergent_error%>
<% } finally { 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 editar la Teléfonia -"+request.getParameter("id_telefonia") +"-;"; Config.GuardarLog(Integer.parseInt(session.getAttribute("id_user").toString()), mensaje_log, 3); } catch (Exception e) { } %>