añado jsp

This commit is contained in:
2025-06-09 13:55:08 +02:00
parent ce54d7a756
commit e1227c3b2a
118 changed files with 44926 additions and 0 deletions
+272
View File
@@ -0,0 +1,272 @@
<%@ page import="com.tarisan.control.*" %>
<%@ page import="com.tarisan.data.*" %>
<%@ page import="com.tarisan.excepcion.*" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="com.tarisan.util.Utilidades" %>
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de analisis (med/analisis.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="";
StringBuffer strSql = new StringBuffer();
int intPagina = 0;
SimpleDateFormat sdfFormateadorFecha=new SimpleDateFormat(PersistenciaParametros.formatoFechas);
Object aCondiciones[]=null;
//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 pagina para realizar la paginacion
if (request.getParameter("pagina")!=null)
intPagina=Integer.parseInt(request.getParameter("pagina"));
%>
<html>
<head>
<title>Análisis</title>
<link rel="STYLESHEET" type="text/css" href="../../css/estilos.css">
<script language="JavaScript" src="../../js/inicio_tarisan.js"></script>
<script language="JavaScript" src="../../js/menu_med.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 paginacion(pagina)
{
document.frmAnalisis.pagina.value=pagina;
document.frmAnalisis.submit();
}
function mostrarAnalisis(autorizacion, path)
{
//var url = path + "/servlet/GestorMedicos?OPCION=<%=Constantes.OPC_MED_REGISTRAR_LOG_ANALISIS%>&autorizacion=" + autorizacion;
//var ventana = window.open(url,"analisis" + autorizacion,"dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
var ventanaAnalisisMedico = window.open('<%=request.getContextPath()%>'+ '/peticiones/' + autorizacion + '.pdf',autorizacion,"dependent=1,height=490,width=720,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no");
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF">
<!-- Logotipo de IMQ de Navarra //-->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="bottom">
<td align="center"><img src="../../img/Logo_rosca.jpg" border="0"></td>
</tr>
</table>
<br>
<!-- Datos del usuario conectado //-->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td class="tituloTabla" align="center"><%= sesion.getAttribute("USUARIO") %></td>
</tr>
<tr>
<td bgcolor="#C02331"><img src="img/sp.gif" width="746" height="1" border="0"></td>
</tr>
</table>
<br>
<!-- Cabecera de Navegación superior //-->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<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">
<tr valign="top">
<td width="180">
<!-- 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>
<td><img src="../../img/sp.gif" width="14" height="261" border="0"></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 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 -->
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<form name="frmAnalisis" action="analisis.jsp?x=<%=strParametroMenu%>" method="post">
<input type="hidden" name="pagina" value="1">
</form>
<%
//Creación de la tabla presentación de resultados
PersistenciaVTaresanaTaclient per = new PersistenciaVTaresanaTaclient();
Vector vSeleccion = per.listado_analisis_por_medico(((Usuario)sesion.getAttribute("USUARIO")).getMedico(),intPagina);
if (vSeleccion.size()==0) //No se han encontrado datos
{
%>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="center"><span class="txt">No se ha encontrado ningún dato.</span></td>
</tr>
<%
}
else
{
if (intPagina != 0){ //se tiene en cuenta la paginacion
%>
<tr>
<td colspan="2" align="right"><span class="txt">Página <%=per.getPaginacion().getNumeroPagina()%> de <%=per.getPaginacion().getNumeroPaginasTotales()%></span></td>
</tr>
<%
}
%>
<tr>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Fecha</td>
<td class="cabeceraTabla" align="center" bgcolor="#FFAAAA">Nombre</td>
</tr>
<%
VTaresanaTaclient vTaresanaTaclient = null;
String estilo = "";
for(int i = 0; i < vSeleccion.size(); i++)
{
if (i % 2 == 0)
{
estilo = "filaA";
}
else
{
estilo = "filaB";
}
vTaresanaTaclient = (VTaresanaTaclient)vSeleccion.elementAt(i);
%>
<tr>
<%
if (vTaresanaTaclient.getAutorizacion() == 0) //campo autorizacion nulo o inicializado a 0. Valor no valido.
{
%>
<td class="<%=estilo%>" align="center"><%=sdfFormateadorFecha.format(vTaresanaTaclient.getFecha())%></td>
<td class="<%=estilo%>" align="left"><%=vTaresanaTaclient.getNombre() + " " + vTaresanaTaclient.getApellidos()%></td>
<%
}
else //campo autorizacion tiene un valor valido
{
%>
<td class="<%=estilo%>" align="center"><a href="javascript:mostrarAnalisis(<%=vTaresanaTaclient.getAutorizacion()%>, '<%=request.getContextPath()%>')" class="enlaceAnalisis"><%=sdfFormateadorFecha.format(vTaresanaTaclient.getFecha())%></a></td>
<td class="<%=estilo%>" align="left"><a href="javascript:mostrarAnalisis(<%=vTaresanaTaclient.getAutorizacion()%>, '<%=request.getContextPath()%>')" class="enlaceAnalisis"><%=vTaresanaTaclient.getNombre() + " " + vTaresanaTaclient.getApellidos()%></a></td>
<%
}
%>
</tr>
<%
}
if (intPagina!=0){ //se tiene en cuenta la paginacion %>
<tr><td colspan="2"></td></tr>
<tr>
<td colspan="2">
<table border="0" align="center">
<tr>
<%if (per.getPaginacion().esPrimeraPagina()){%>
<td width="70" align="right"><span class="pagDesactivo">primero</span></td>
<td></td>
<td width="70" align="left"><span class="pagDesactivo">anterior</span></td>
<%}else{%>
<td width="70" align="right"><a href="javascript:paginacion(1)" class="enlace">primero</a></td>
<td></td>
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() - 1%>)" class="enlace">anterior</a></td>
<%}%>
<%if (per.getPaginacion().esUltimaPagina()){%>
<td width="70" align="right"><span class="pagDesactivo">siguiente</span></td>
<td></td>
<td width="70" align="left"><span class="pagDesactivo">último</span></td>
<%}else{%>
<td width="70" align="right"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPagina() + 1%>)" class="enlace">siguiente</a></td>
<td></td>
<td width="70" align="left"><a href="javascript:paginacion(<%=per.getPaginacion().getNumeroPaginasTotales()%>)" class="enlace">último</a></td>
<%}%>
</tr>
</table>
</td>
</tr>
<%
} //fin if(pagina!=0)
} //fin else (vSeleccion.size()!=0)
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
}
catch(Exception ex)
{
LogTarisan.logger.log(NivelLog.ERROR, "Exception: " + ex);
sesion.setAttribute("ERROR", "ExcepcionTarisan: " + ex);
response.sendRedirect("../error.jsp");
}
}
LogTarisan.logger.log(NivelLog.INFO, "Final página de analisis (med/analisis.jsp)");
%>