310 lines
11 KiB
Plaintext
310 lines
11 KiB
Plaintext
<%@ page import="com.tarisan.control.*" %>
|
|
<%@ page import="com.tarisan.data.*" %>
|
|
<%@ page import="com.tarisan.excepcion.*" %>
|
|
<%@ page import="com.tarisan.log.*" %>
|
|
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
|
|
<%@ page import="com.tarisan.util.Utilidades" %>
|
|
<%@ page import="java.sql.*" %>
|
|
<%@ page import="java.text.SimpleDateFormat" %>
|
|
<%@ page import="java.util.Calendar" %>
|
|
<%@ page import="java.util.Vector" %>
|
|
|
|
<%
|
|
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de detalle de usuario (adm/detalle_usuario.jsp)");
|
|
|
|
response.setHeader("Expires", "0");
|
|
response.setHeader("Pragma", "no-cache");
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
HttpSession sesion = request.getSession(true);
|
|
|
|
if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null))
|
|
{
|
|
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
|
|
response.sendRedirect("../../html/login.html");
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
|
|
// Definicion de variables
|
|
String strParametroMenu = "";
|
|
int intMedico = 0;
|
|
String blo = "";
|
|
SimpleDateFormat sdf = new SimpleDateFormat(PersistenciaParametros.formatoFechas);
|
|
|
|
//Obtención del perfil del usuario conectado
|
|
StringBuffer perfil = new StringBuffer();
|
|
perfil.append("|");
|
|
perfil.append(sesion.getAttribute("PERFIL"));
|
|
perfil.append("|");
|
|
|
|
//Obtenemos los valores de los parametros que se pasan a la pagina
|
|
//En caso de que no se le pasen parametros, quedaram inicializados
|
|
//a sus valores por defecto
|
|
|
|
//parametro x para marcar la opcion del menu en la que se encuentra el usuario
|
|
if (request.getParameter("x")!=null){
|
|
strParametroMenu=(String)request.getParameter("x");}
|
|
|
|
//parametro medico para la selección de los datos del mismo
|
|
if (request.getParameter("medico")!=null){
|
|
intMedico = Integer.parseInt(request.getParameter("medico"));}
|
|
|
|
//parametro bloqueo para combrobar despues si se ha modificado
|
|
if (request.getParameter("bloqueado")!=null){
|
|
blo = (String)request.getParameter("bloqueado");}
|
|
|
|
boolean mostrarNoticia = true;
|
|
PersistenciaTanoticias perTaNo = new PersistenciaTanoticias();
|
|
Vector vSeleccionNot = perTaNo.obtener_noticias_cabecera();
|
|
Vector vNoticias = new Vector();
|
|
String strNoticia = "";
|
|
String noticias ="";
|
|
String separador = " ---//--- ";
|
|
if(vSeleccionNot.size()==0){
|
|
mostrarNoticia = false;
|
|
}else{
|
|
mostrarNoticia = true;
|
|
Tanoticias tanoticia = null;
|
|
for(int i = 0; i < vSeleccionNot.size(); i++)
|
|
{
|
|
tanoticia = (Tanoticias)vSeleccionNot.elementAt(i);
|
|
if (i!=0){
|
|
strNoticia = strNoticia + separador + tanoticia.getNoticia();
|
|
}else{
|
|
strNoticia = tanoticia.getNoticia();
|
|
}
|
|
strNoticia = strNoticia.replaceAll("<br/>", " ");
|
|
}
|
|
}
|
|
//Lo pongo a false para que no salga la noticia
|
|
mostrarNoticia = false;
|
|
%>
|
|
|
|
<html>
|
|
<head>
|
|
<title>Detalle de usuario</title>
|
|
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
|
|
|
|
<script language="JavaScript" src="../../js/funciones.js"></script>
|
|
<script language="JavaScript" src="../../js/jquery-1.11.3.js"></script>
|
|
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
|
|
<script language="JavaScript" src="../../js/menu_adm.js"></script>
|
|
<script language="JavaScript" src="../../js/bloques_tarisan.js"></script>
|
|
<script language="JavaScript">pNG="<%= perfil.toString() %>"</script>
|
|
<script language="JavaScript" type="text/javascript">
|
|
|
|
|
|
|
|
function enviar()
|
|
{
|
|
//comprobamos que el se haya modificado el combobox o el checkbox
|
|
if ((document.frmUsuario.reset_clave.checked == true) || ((document.frmUsuario.bloqueado.value)!=(document.frmUsuario.valor_bloqueo_clave.value))){
|
|
document.frmUsuario.submit();
|
|
alert("Usuario modificado");
|
|
} else{
|
|
alert("No has modificado ningún valor");
|
|
}
|
|
}
|
|
|
|
|
|
function pasarAMayusculas(campo)
|
|
{
|
|
campo.value = campo.value.toUpperCase();
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onload="javascript:document.frmUsuario.valor_password.focus()">
|
|
<div class="marco">
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr>
|
|
<td class="tdLogoCabecera"><img src="<%=request.getContextPath()%>/img/logo.png" class="logoCabecera"></td>
|
|
<td>
|
|
<table width="100%">
|
|
<tr><td class="tituloTablaMedico" align="center"><%= sesion.getAttribute("USUARIO") %></td></tr>
|
|
<tr>
|
|
<td>
|
|
<div id="contenedorNoticia">
|
|
<br>
|
|
<div class="tituloNoticia">
|
|
<p class="marquee"><%=strNoticia %></p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<!-- Cabecera de Navegación superior //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr>
|
|
<td><script language="JavaScript">bloques();</script></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
<!-- Cuerpo de la página //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:95%">
|
|
<tr valign="top">
|
|
<!--<td width="180">//-->
|
|
<td width="5%">
|
|
<!-- Menú de navegación del módulo (zona izquierda) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr valign="top">
|
|
<td colspan="2"><img src="../../img/sp.gif" width="180" height="12" border="0"></td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td><script language="JavaScript">escribirMenuGst();</script></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<!--<td bgcolor="#CCCCCC"><img src="../../img/sp.gif" width="1" height="12" border="0"></td>//-->
|
|
<td width="565">
|
|
<!-- Tabla con el contenido de la página (zona central-derecha) //-->
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<!--<td><img src="../../img/sp.gif" width="4" height="261" border="0"></td>//-->
|
|
<td width="1px" bgcolor="#CCCCCC" height="90px"></td>
|
|
<td class="txt" valign="top">
|
|
<img src="../../img/sp.gif" width="1" height="11" border="0"><br>
|
|
<table border="0" align="center" width="100%">
|
|
|
|
|
|
<!-- Presentacion de los resultados -->
|
|
<%
|
|
PersistenciaTamedico per = new PersistenciaTamedico();
|
|
Tamedico tamedico = per.seleccionar(intMedico);
|
|
|
|
|
|
String bloqueo = "";
|
|
String fechaUltAcceso = "";
|
|
String fechaCaducidad = "";
|
|
Calendar calCaducidad = Calendar.getInstance();
|
|
|
|
if (tamedico != null)
|
|
{
|
|
if(tamedico.getBloqueoClave() != null)
|
|
{
|
|
bloqueo = tamedico.getBloqueoClave().toUpperCase();
|
|
}
|
|
|
|
if(tamedico.getFechaUltimoAcceso() != null)
|
|
{
|
|
fechaUltAcceso = sdf.format(tamedico.getFechaUltimoAcceso());
|
|
}
|
|
|
|
if(tamedico.getFechaModifClave() != null)
|
|
{
|
|
calCaducidad.setTime((java.util.Date)tamedico.getFechaModifClave());
|
|
}
|
|
calCaducidad.add(Calendar.DATE, ParametrosConfiguracion.diasCaducidad);
|
|
fechaCaducidad = sdf.format(calCaducidad.getTime());
|
|
%>
|
|
<tr><td colspan="2"> </td></tr>
|
|
<tr>
|
|
<form name="frmUsuario" action="../../servlet/GestorAdministracion" method="post">
|
|
<td>
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Código: </span></td></td>
|
|
<td><input type="text" size="20" name="medico" class="txt" readonly="yes" value="<%=tamedico.getMedico()%>" maxlength="6"></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Resetear clave: </span></td>
|
|
<td><input name="reset_clave" type="checkbox" value="" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Nombre: </span></td>
|
|
<td><input type="text" size="80" name="nombre" class="txt" readonly="yes" value="<%=tamedico.getNombre()%>" maxlength="255"></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Apellidos: </span></td>
|
|
<td><input type="text" size="80" name="apellidos" class="txt" readonly="yes" value="<%=tamedico.getApellidos()%>" maxlength="255"></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Especialidad: </span></td></td>
|
|
<td><input type="text" size="4" name="especialidad" class="txt" readonly="yes" value="<%=tamedico.getEspecialidad()%>" maxlength="20"></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Bloqueo: </span></td></td>
|
|
<td><select name="valor_bloqueo_clave"><%if (bloqueo.equals("S")
|
|
) {%>
|
|
<option selected="selected" value="S">Si</option>
|
|
<option value="N">No</option>
|
|
<%
|
|
}
|
|
else
|
|
{
|
|
%>
|
|
<option selected="selected" value="N">No</option>
|
|
<option value="S">Si</option>
|
|
<% } %>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Ultimo acceso: </span></td></td>
|
|
<td><input type="text" size="15" name="fecha_ult_acceso" class="txt" readonly="yes" value="<%=fechaUltAcceso%>" maxlength="10"></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><span class="txtnegrita">Caducidad de clave: </span></td></td>
|
|
<td><input type="text" size="15" name="valor_fecha_modif_clave" class="txt" value="<%=fechaCaducidad%>" maxlength="10" onblur="javascript:valorFecha(this)"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="center"><a href="javascript:frmUsuario.reset();frmUsuario.valor_password.focus()" class="enlace">Deshacer</a> <a href="javascript:enviar()" class="enlace">Aceptar</a></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<input type="hidden" name="x" value="<%=strParametroMenu%>">
|
|
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_ADM_USUARIO_DETALLE%>">
|
|
<input type="hidden" name="bloqueado" value="<%=bloqueo%>">
|
|
</form>
|
|
</tr>
|
|
<%
|
|
}
|
|
%>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
<script>
|
|
var jsMostrarNoticia = <%=mostrarNoticia %>;
|
|
if (!jsMostrarNoticia){
|
|
document.getElementById('contenedorNoticia').style.display="none";
|
|
}else{
|
|
<% strNoticia = strNoticia.replaceAll("\"", "'"); %>
|
|
var not = "<%=strNoticia %>";
|
|
tamanioNoticia(not);
|
|
marquee($('.tituloNoticia'), $('.marquee'),not);
|
|
}
|
|
</script>
|
|
<%
|
|
}
|
|
catch(ExcepcionTarisan ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, "ExcepcionTarisan: " + ex.getMensaje());
|
|
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex.getMensaje());
|
|
response.sendRedirect("../error.jsp");
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex);
|
|
sesion.setAttribute("ERROR", "Error en la presentación de la página al usuario.");
|
|
response.sendRedirect("../error.jsp");
|
|
}
|
|
}
|
|
LogTarisan.logger.log(NivelLog.INFO, "Final página de detalle de usuario (adm/detalle_usuario.jsp)");
|
|
%>
|