añado js

This commit is contained in:
2025-06-09 13:54:42 +02:00
parent 3a9488b391
commit ce54d7a756
24 changed files with 32002 additions and 0 deletions
+467
View File
@@ -0,0 +1,467 @@
/**
* alertify
* An unobtrusive customizable JavaScript notification system
*
* @author Fabien Doiron <fabien.doiron@gmail.com>
* @copyright Fabien Doiron 2012
* @license MIT <http://opensource.org/licenses/mit-license.php>
* @link http://www.github.com/fabien-d
* @module alertify
* @version 0.2.12
*/
/*global define*/
(function (global, undefined) {
"use strict";
var document = global.document,
Alertify;
Alertify = function () {
var _alertify = {},
dialogs = {},
isopen = false,
keys = { ENTER: 13, ESC: 27, SPACE: 32 },
queue = [],
$, elCallee, elCover, elDialog, elLog;
/**
* Markup pieces
* @type {Object}
*/
dialogs = {
buttons : {
holder : "<nav class=\"alertify-buttons\">{{buttons}}</nav>",
submit : "<button type=\"submit\" class=\"alertify-button alertify-button-ok\" id=\"alertify-ok\" />{{ok}}</button>",
ok : "<a href=\"#\" class=\"alertify-button alertify-button-ok\" id=\"alertify-ok\">{{ok}}</a>",
cancel : "<a href=\"#\" class=\"alertify-button alertify-button-cancel\" id=\"alertify-cancel\">{{cancel}}</a>"
},
input : "<input type=\"text\" class=\"alertify-text\" id=\"alertify-text\">",
message : "<p class=\"alertify-message\">{{message}}</p>",
log : "<article class=\"alertify-log{{class}}\">{{message}}</article>"
};
/**
* Shorthand for document.getElementById()
*
* @param {String} id A specific element ID
* @return {Object} HTML element
*/
$ = function (id) {
return document.getElementById(id);
};
/**
* Alertify private object
* @type {Object}
*/
_alertify = {
/**
* Labels object
* @type {Object}
*/
labels : {
ok : "Aceptar",
cancel : "Cancelar"
},
/**
* Delay number
* @type {Number}
*/
delay : 5000,
/**
* Set the proper button click events
*
* @param {Function} fn [Optional] Callback function
*
* @return {undefined}
*/
addListeners : function (fn) {
var btnReset = $("alertify-resetFocus"),
btnOK = $("alertify-ok") || undefined,
btnCancel = $("alertify-cancel") || undefined,
input = $("alertify-text") || undefined,
form = $("alertify-form") || undefined,
hasOK = (typeof btnOK !== "undefined"),
hasCancel = (typeof btnCancel !== "undefined"),
hasInput = (typeof input !== "undefined"),
val = "",
self = this,
ok, cancel, common, key, reset;
// ok event handler
ok = function (event) {
if (typeof event.preventDefault !== "undefined") event.preventDefault();
common(event);
if (typeof input !== "undefined") val = input.value;
if (typeof fn === "function") fn(true, val);
};
// cancel event handler
cancel = function (event) {
if (typeof event.preventDefault !== "undefined") event.preventDefault();
common(event);
if (typeof fn === "function") fn(false);
};
// common event handler (keyup, ok and cancel)
common = function (event) {
self.hide();
self.unbind(document.body, "keyup", key);
self.unbind(btnReset, "focus", reset);
if (hasInput) self.unbind(form, "submit", ok);
if (hasOK) self.unbind(btnOK, "click", ok);
if (hasCancel) self.unbind(btnCancel, "click", cancel);
};
// keyup handler
key = function (event) {
var keyCode = event.keyCode;
if (keyCode === keys.SPACE && !hasInput) ok(event);
if (keyCode === keys.ESC && hasCancel) cancel(event);
};
// reset focus to first item in the dialog
reset = function (event) {
if (hasInput) input.focus();
else if (hasCancel) btnCancel.focus();
else btnOK.focus();
};
// handle reset focus link
// this ensures that the keyboard focus does not
// ever leave the dialog box until an action has
// been taken
this.bind(btnReset, "focus", reset);
// handle OK click
if (hasOK) this.bind(btnOK, "click", ok);
// handle Cancel click
if (hasCancel) this.bind(btnCancel, "click", cancel);
// listen for keys, Cancel => ESC
this.bind(document.body, "keyup", key);
// bind form submit
if (hasInput) this.bind(form, "submit", ok);
// set focus on OK button or the input text
global.setTimeout(function () {
if (input) {
input.focus();
input.select();
}
else btnOK.focus();
}, 50);
},
/**
* Bind events to elements
*
* @param {Object} el HTML Object
* @param {Event} event Event to attach to element
* @param {Function} fn Callback function
*
* @return {undefined}
*/
bind : function (el, event, fn) {
if (typeof el.addEventListener === "function") {
el.addEventListener(event, fn, false);
} else if (el.attachEvent) {
el.attachEvent("on" + event, fn);
}
},
/**
* Build the proper message box
*
* @param {Object} item Current object in the queue
*
* @return {String} An HTML string of the message box
*/
build : function (item) {
var html = "",
type = item.type,
message = item.message;
html += "<div class=\"alertify-dialog\">";
if (type === "prompt") html += "<form id=\"alertify-form\">";
html += "<article class=\"alertify-inner\">";
html += dialogs.message.replace("{{message}}", message);
if (type === "prompt") html += dialogs.input;
html += dialogs.buttons.holder;
html += "</article>";
if (type === "prompt") html += "</form>";
html += "<a id=\"alertify-resetFocus\" class=\"alertify-resetFocus\" href=\"#\">Reset Focus</a>";
html += "</div>";
switch (type) {
case "confirm":
html = html.replace("{{buttons}}", dialogs.buttons.ok + dialogs.buttons.cancel);
html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
break;
case "prompt":
html = html.replace("{{buttons}}", dialogs.buttons.submit + dialogs.buttons.cancel);
html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
break;
case "alert":
html = html.replace("{{buttons}}", dialogs.buttons.ok);
html = html.replace("{{ok}}", this.labels.ok);
break;
default:
break;
}
elDialog.className = "alertify alertify-show alertify-" + type;
elCover.className = "alertify-cover";
return html;
},
/**
* Close the log messages
*
* @param {Object} elem HTML Element of log message to close
* @param {Number} wait [optional] Time (in ms) to wait before automatically hiding the message
*
* @return {undefined}
*/
close : function (elem, wait) {
var timer = (wait && !isNaN(wait)) ? +wait : this.delay; // Unary Plus: +"2" === 2
this.bind(elem, "click", function () {
elLog.removeChild(elem);
});
setTimeout(function () {
if (typeof elem !== "undefined" && elem.parentNode === elLog) elLog.removeChild(elem);
}, timer);
},
/**
* Create a dialog box
*
* @param {String} message The message passed from the callee
* @param {String} type Type of dialog to create
* @param {Function} fn [Optional] Callback function
* @param {String} placeholder [Optional] Default value for prompt input field
*
* @return {Object}
*/
dialog : function (message, type, fn, placeholder) {
// set the current active element
// this allows the keyboard focus to be resetted
// after the dialog box is closed
elCallee = document.activeElement;
// check to ensure the alertify dialog element
// has been successfully created
var check = function () {
if (elDialog && elDialog.scrollTop !== null) return;
else check();
};
// error catching
if (typeof message !== "string") throw new Error("message must be a string");
if (typeof type !== "string") throw new Error("type must be a string");
if (typeof fn !== "undefined" && typeof fn !== "function") throw new Error("fn must be a function");
// initialize alertify if it hasn't already been done
if (typeof this.init === "function") {
this.init();
check();
}
queue.push({ type: type, message: message, callback: fn, placeholder: placeholder });
if (!isopen) this.setup();
return this;
},
/**
* Extend the log method to create custom methods
*
* @param {String} type Custom method name
*
* @return {Function}
*/
extend : function (type) {
return function (message, wait) { this.log(message, type, wait); };
},
/**
* Hide the dialog and rest to defaults
*
* @return {undefined}
*/
hide : function () {
// remove reference from queue
queue.splice(0,1);
// if items remaining in the queue
if (queue.length > 0) this.setup();
else {
isopen = false;
elDialog.className = "alertify alertify-hide alertify-hidden";
elCover.className = "alertify-cover alertify-hidden";
// set focus to the last element or body
// after the dialog is closed
elCallee.focus();
}
},
/**
* Initialize Alertify
* Create the 2 main elements
*
* @return {undefined}
*/
init : function () {
// ensure legacy browsers support html5 tags
document.createElement("nav");
document.createElement("article");
document.createElement("section");
// cover
elCover = document.createElement("div");
elCover.setAttribute("id", "alertify-cover");
elCover.className = "alertify-cover alertify-hidden";
document.body.appendChild(elCover);
// main element
elDialog = document.createElement("section");
elDialog.setAttribute("id", "alertify");
elDialog.className = "alertify alertify-hidden";
document.body.appendChild(elDialog);
// log element
elLog = document.createElement("section");
elLog.setAttribute("id", "alertify-logs");
elLog.className = "alertify-logs";
document.body.appendChild(elLog);
// set tabindex attribute on body element
// this allows script to give it focus
// after the dialog is closed
document.body.setAttribute("tabindex", "0");
// clean up init method
delete this.init;
},
/**
* Show a new log message box
*
* @param {String} message The message passed from the callee
* @param {String} type [Optional] Optional type of log message
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding the log
*
* @return {Object}
*/
log : function (message, type, wait) {
// check to ensure the alertify dialog element
// has been successfully created
var check = function () {
if (elLog && elLog.scrollTop !== null) return;
else check();
};
// initialize alertify if it hasn't already been done
if (typeof this.init === "function") {
this.init();
check();
}
this.notify(message, type, wait);
return this;
},
/**
* Add new log message
* If a type is passed, a class name "alertify-log-{type}" will get added.
* This allows for custom look and feel for various types of notifications.
*
* @param {String} message The message passed from the callee
* @param {String} type [Optional] Type of log message
* @param {Number} wait [Optional] Time (in ms) to wait before auto-hiding
*
* @return {undefined}
*/
notify : function (message, type, wait) {
var log = document.createElement("article");
log.className = "alertify-log" + ((typeof type === "string" && type !== "") ? " alertify-log-" + type : "");
log.innerHTML = message;
// prepend child
elLog.insertBefore(log, elLog.firstChild);
// triggers the CSS animation
setTimeout(function() { log.className = log.className + " alertify-log-show"; }, 50);
this.close(log, wait);
},
/**
* Set properties
*
* @param {Object} args Passing parameters
*
* @return {undefined}
*/
set : function (args) {
var k;
// error catching
if (typeof args !== "object" && args instanceof Array) throw new Error("args must be an object");
// set parameters
for (k in args) {
if (args.hasOwnProperty(k)) {
this[k] = args[k];
}
}
},
/**
* Initiate all the required pieces for the dialog box
*
* @return {undefined}
*/
setup : function () {
var item = queue[0];
isopen = true;
elDialog.innerHTML = this.build(item);
if (typeof item.placeholder === "string") $("alertify-text").value = item.placeholder;
this.addListeners(item.callback);
},
/**
* Unbind events to elements
*
* @param {Object} el HTML Object
* @param {Event} event Event to detach to element
* @param {Function} fn Callback function
*
* @return {undefined}
*/
unbind : function (el, event, fn) {
if (typeof el.removeEventListener === "function") {
el.removeEventListener(event, fn, false);
} else if (el.detachEvent) {
el.detachEvent("on" + event, fn);
}
}
};
return {
alert : function (message, fn) { _alertify.dialog(message, "alert", fn); return this; },
confirm : function (message, fn) { _alertify.dialog(message, "confirm", fn); return this; },
extend : _alertify.extend,
init : _alertify.init,
log : function (message, type, wait) { _alertify.log(message, type, wait); return this; },
prompt : function (message, fn, placeholder) { _alertify.dialog(message, "prompt", fn, placeholder); return this; },
success : function (message, wait) { _alertify.log(message, "success", wait); return this; },
error : function (message, wait) { _alertify.log(message, "error", wait); return this; },
set : function (args) { _alertify.set(args); },
labels : _alertify.labels
};
};
// AMD and window support
if (typeof define === "function") {
define([], function () { return new Alertify(); });
} else {
if (typeof global.alertify === "undefined") {
global.alertify = new Alertify();
}
}
}(this));
+65
View File
@@ -0,0 +1,65 @@
function bloques()
{
var color="#C02331";
var deshabilitado="#FFAAAA";
stCaja = '';
//stCaja += ' <table cellpadding="0" cellspacing="0" border="0">\n';
stCaja += ' <table cellpadding="0" cellspacing="0" border="0" width="100%">\n';
/*stCaja += ' <tr>\n';
stCaja += ' <td bgcolor="' + color + '"><img src="./img/sp.gif" width="1" height="1" border="0"></td>\n';
stCaja += ' <td bgcolor="' + color + '"><img src="./img/sp.gif" width="744" height="1" border="0"></td>\n';
stCaja += ' <td bgcolor="' + color + '"><img src="./img/sp.gif" width="1" height="1" border="0"></td>\n';
stCaja += ' </tr>\n';*/
stCaja += ' <tr>\n';
//stCaja += ' <td bgcolor="' + color + '"><img src="./img/sp.gif" width="1" height="18" border="0"></td>\n';
stCaja += ' <td >\n';
//stCaja += ' <table cellpadding="0" cellspacing="1" border="0" width="744" >\n';
stCaja += ' <table cellpadding="0" cellspacing="1" border="0" width="100%" >\n';
stCaja += ' <tr>\n';
//Enlaces de secciones
//var mostrarSeccion = seccionesAMostrar( pNG );
var seccionSeleccionada = getSeccion();
if(seccionSeleccionada == SECCION_MEDICOS)
{
// stCaja += ' <td class="txtBlqColor" width="150" bgcolor="' + deshabilitado + '"><img src="./img/sp.gif" width="15" height="1" border="0"><b>Gesti&oacute;n de M&eacute;dicos</b></a></td>';
// stCaja += ' <td width="150" bgcolor="' + color + '"><img src="./img/sp.gif" width="15" height="1" border="0"><a class="txtBlq" href="javascript:setSeccion(SECCION_PACIENTES);" onMouseOver="self.status=\'Gesti&oacute;n de Pacientes\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Gesti&oacute;n de Pacientes</b></a></td>';
stCaja += ' <td class="txtBlqColor" width="33%" bgcolor="' + deshabilitado + '" style="text-align:center"><b>Gesti&oacute;n de M&eacute;dicos</b></a></td>';
stCaja += ' <td width="33%" bgcolor="' + color + '" style="text-align:center"><a class="txtBlq" href="javascript:setSeccion(SECCION_PACIENTES);" onMouseOver="self.status=\'Gesti&oacute;n de Pacientes\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Gesti&oacute;n de Pacientes</b></a></td>';
}
else if(seccionSeleccionada == SECCION_PACIENTES)
{
// stCaja += ' <td width="150" bgcolor="' + color + '"><img src="./img/sp.gif" width="15" height="1" border="0"><a class="txtBlq" href="javascript:setSeccion(SECCION_MEDICOS);" onMouseOver="self.status=\'Gesti&oacute;n de M&eacute;dicos\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Gesti&oacute;n de M&eacute;dicos</b></a></td>';
// stCaja += ' <td class="txtBlqColor" width="150" bgcolor="' + deshabilitado + '"><img src="./img/sp.gif" width="15" height="1" border="0"><b>Gesti&oacute;n de Pacientes</b></a></td>';
stCaja += ' <td width="33%" bgcolor="' + color + '" style="text-align:center"><a class="txtBlq" href="javascript:setSeccion(SECCION_MEDICOS);" onMouseOver="self.status=\'Gesti&oacute;n de M&eacute;dicos\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Gesti&oacute;n de M&eacute;dicos</b></a></td>';
stCaja += ' <td class="txtBlqColor" width="33%" bgcolor="' + deshabilitado + '" style="text-align:center"><b>Gesti&oacute;n de Pacientes</b></a></td>';
}
else if(seccionSeleccionada == SECCION_ADMINISTRADOR)
{
// stCaja += ' <td colspan="2" class="txtBlqColor" width="300" bgcolor="' + deshabilitado + '"><img src="./img/sp.gif" width="15" height="1" border="0"><b>Administraci&oacute;n de Usuarios</b></a></td>';
stCaja += ' <td colspan="2" class="txtBlqColor" width="66%" bgcolor="' + deshabilitado + '" style="text-align:center"><b>Administraci&oacute;n</b></a></td>';
}
//stCaja += ' <td width="150" bgcolor="' + color + '"><img src="./img/sp.gif" width="15" height="1" border="0"><a class="txtBlq" href="javascript:setSeccion(SECCION_SALIR);" onMouseOver="self.status=\'Salir\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Salir</b></a>';
stCaja += ' <td width="33%" bgcolor="' + color + '" style="text-align:center"><a class="txtBlq" href="javascript:setSeccion(SECCION_SALIR);" onMouseOver="self.status=\'Salir\'; return true;" onMouseOut="self.status=\'\'; return true;"><b>Salir</b></a>';
stCaja += ' </td>\n';
stCaja += ' </tr>\n';
stCaja += ' </table>\n';
stCaja += ' </td>';
//stCaja += ' <td bgcolor="' + color + '"><img src="img/sp.gif" width="1" height="18" border="0"></td>\n';
stCaja += ' </tr>\n';
/*stCaja += ' <tr>\n';
stCaja += ' <td colspan="3" bgcolor="' + color + '"><img src="img/sp.gif" width="746" height="1" border="0"></td>\n';
stCaja += ' </tr>\n';*/
stCaja += ' </table>\n';
var rutaPagHTML = window.location.href;
//si la pagina que incluye este js es path.html.... no dibuja el bloque.
//if ( rutaPagHTML.indexOf("path.html")<0 )
document.write(stCaja);
}
+192
View File
@@ -0,0 +1,192 @@
<%@ 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="java.sql.*" %>
<%@ page import="java.util.Vector" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de cambio de clave (cambio_clave.jsp)");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
HttpSession sesion = request.getSession(true);
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
if(sesion.isNew() || (sesion.getAttribute("USUARIO") == null))
{
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
response.sendRedirect("../html/login.html");
}
else
{
try
{
%>
<html>
<head>
<title>Cambio de clave</title>
<link rel="STYLESHEET" type="text/css" href="../css/estilos.css">
<script language="JavaScript" src="../js/funciones.js"></script>
<script language="JavaScript" src="../js/inicio_tarisan.js"></script>
<script language="JavaScript" src="../js/bloques_tarisan.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
function enviar()
{
var blnFormularioValido = true;
//comprobamos si la clave nueva es vacia o esta rellena solo con espacios
if (blnFormularioValido && esVacia(frmClave.clave_nueva.value))
{
alert("La clave es vacía o contiene únicamente espacios en blanco. Introduzca una clave válida.");
frmClave.clave_nueva.value="";
frmClave.confirmar_clave.value="";
frmClave.clave_nueva.focus();
blnFormularioValido=false;
}
//comprobamos que el tamaño de la clave nueva no sea < 6
if (blnFormularioValido && frmClave.clave_nueva.value.length<6)
{
alert("La clave debe tener como mínimo 6 caracteres.");
frmClave.clave_nueva.value="";
frmClave.confirmar_clave.value="";
frmClave.clave_nueva.focus();
blnFormularioValido=false;
}
//comprobamos que el valor de las claves introducidas sean iguales
if (blnFormularioValido && frmClave.clave_nueva.value != frmClave.confirmar_clave.value)
{
alert("Las claves introducidas no conciden.");
frmClave.clave_nueva.value="";
frmClave.confirmar_clave.value="";
frmClave.clave_nueva.focus();
blnFormularioValido=false;
}
if (blnFormularioValido)
document.frmClave.submit();
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" alink="#43881A" bgcolor="#FFFFFF" onload="document.frmClave.clave_nueva.focus();">
<!-- 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>
<!-- 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>
<table cellpadding="0" cellspacing="0" border="0" width="165">
<tr valign="top">
<td width="16" class="menuBack"><img src="../img/gen_bullet_cerrado.gif" name="bullet" width="16" height="12" border="0"></td>
<td width="150" class="menuOff"><b><%=pertamensaje.obtenerMensaje(37).getMensaje() %></b></td>
</tr>
</table>
</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>
<tr><td colspan="2" class="txtnegrita" align="center"><%=pertamensaje.obtenerMensaje(36).getMensaje() %></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<form name="frmClave" action="../servlet/GestorMedicos" method="post">
<td>
<table border="0" align="center">
<tr>
<td align="right"><span class="txtnegrita"><%=pertamensaje.obtenerMensaje(34).getMensaje() %> </span></td></td>
<td><input type="password" size="30" name="clave_nueva" class="txt" value="" maxlength="50"></td>
</tr>
<tr>
<td align="right"><span class="txtnegrita"><%=pertamensaje.obtenerMensaje(35).getMensaje() %> </span></td></td>
<td><input type="password" size="30" name="confirmar_clave" class="txt" value="" maxlength="50"></td>
</tr>
<tr>
<td colspan="2" align="center"><a href="javascript:frmClave.reset();frmClave.clave_nueva.focus()" class="enlace"><%=pertamensaje.obtenerMensaje(33).getMensaje() %></a>&nbsp;&nbsp;&nbsp;<a href="javascript:enviar()" class="enlace">Aceptar</a>&nbsp;&nbsp;&nbsp;<a href="javascript:history.back();" class="enlace"><%=pertamensaje.obtenerMensaje(30).getMensaje() %></a></td>
</tr>
</table>
</td>
<input type="hidden" name="OPCION" value="<%=Constantes.OPC_MED_ACTUALIZAR_ACCESO%>">
</form>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
}
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");
}
catch(ExcepcionTarisan eT)
{
LogTarisan.logger.log(NivelLog.ERROR, "Excepcion: " + eT);
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 cambio de clave (cambio_clave.jsp)");
%>
File diff suppressed because it is too large Load Diff
+193
View File
@@ -0,0 +1,193 @@
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.awt.Button" %>
<%@ page import="java.awt.Color" %>
<%@ page import="java.awt.Font" %>
<%@ page import="java.awt.Frame" %>
<%@ page import="java.awt.GraphicsEnvironment" %>
<%@ page import="java.awt.GraphicsConfiguration" %>
<%@ page import="java.awt.GraphicsDevice" %>
<%@ page import="java.awt.GraphicsConfigTemplate" %>
<%@ page import="java.awt.TextField" %>
<%@ page import="javax.swing.JFrame" %>
<%@ page import="java.awt.Canvas" %>
<%@ page import="java.awt.Rectangle" %>
<html>
<head>
<title>Entorno gr&aacute;fico</title>
</head>
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="ffffff">
<%
Date fecha = new Date();
Calendar calendario = Calendar.getInstance();
calendario.setTime(fecha);
String dia = String.valueOf(calendario.get(Calendar.DATE));
if(dia.length() == 1)
{
dia = "0" + dia;
}
String mes = String.valueOf(calendario.get(Calendar.MONTH) + 1);
if(mes.length() == 1)
{
mes = "0" + mes;
}
String ano = String.valueOf(calendario.get(Calendar.YEAR));
String hora = String.valueOf(calendario.get(Calendar.HOUR_OF_DAY));
if(hora.length() == 1)
{
hora = "0" + hora;
}
String minutos = String.valueOf(calendario.get(Calendar.MINUTE));
if(minutos.length() == 1)
{
minutos = "0" + minutos;
}
String segundos = String.valueOf(calendario.get(Calendar.SECOND));
if(segundos.length() == 1)
{
segundos = "0" + segundos;
}
out.print("<hr>");
out.print("Fecha = " + dia + "/" + mes + "/" + ano);
out.print("&nbsp;&nbsp;&nbsp;&nbsp;");
out.print("Hora = " + hora + ":" + minutos + ":" + segundos);
out.print("<hr>");
%>
<b><i><font size="+1">Entorno gr&aacute;fico</font></i></b>
<hr>
<%
out.println("<font size=\"-1\"><ul>");
out.println("<li><b>awt.toolkit: </b>" + System.getProperties().get("awt.toolkit"));
out.println("<li><b>java.awt.graphicsenv: </b>" + System.getProperties().get("java.awt.graphicsenv"));
out.println("</ul></font>");
try
{
out.println("<font size=\"-1\"><ul>");
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
out.println("<li><b>GraphicsEnvironment </b>--> " + ge);
out.println("</ul></font>");
GraphicsDevice gd = ge.getDefaultScreenDevice();
out.println("<font size=\"-1\"><ul>");
out.println("<li><b>GraphicsDevice default</b>--> " + gd);
out.println("</ul></font>");
GraphicsDevice[] gds = ge.getScreenDevices();
GraphicsConfiguration[] gc = null;
GraphicsConfiguration bestGc = null;
out.println("<font size=\"-1\"><ul>");
for(int i = 0; i < gds.length; i++)
{
out.println("<li><b>GraphicsDevice[" + i + "] </b>--> " + gds[i] + "; getType()=" + gds[i].getType() + "; getIDstring()=" + gds[i].getIDstring());
gc = gds[i].getConfigurations();
out.println("<font size=\"-1\"><ul>");
for(int j = 0; j < gc.length; j++)
{
out.println("<li><b>GraphicsConfiguration[" + j + "] </b>--> " + gc[j] + "; getColorModel()=" + gc[j].getColorModel() + "; getDevice()=" + gc[j].getDevice());
}
out.println("<li><b>GraphicsConfiguration default </b>--> " + gds[i].getDefaultConfiguration());
out.println("</ul></font>");
}
out.println("</ul></font>");
Font[] fuentes = ge.getAllFonts();
out.println("<font size=\"-1\"><ul>");
for(int i = 0; i < fuentes.length; i++)
{
out.println("<li><b>Fuente[" + i + "] </b>--> nombre:" + fuentes[i].getFontName() + ", familia " + fuentes[i].getFamily());
}
out.println("</ul></font>");
String[] familias = ge.getAvailableFontFamilyNames();
out.println("<font size=\"-1\"><ul>");
for(int i = 0; i < familias.length; i++)
{
out.println("<li><b>Familia[" + i + "] </b>--> " + familias[i]);
}
out.println("</ul></font>");
}
catch(Throwable ex)
{
out.println("<li><b>Excepción en manejo de entorno gráfico:</b> " + ex);
}
out.println("<hr>");
out.println("</b>Prueba de clases de java.awt</b>");
out.println("<font size=\"-1\"><ul>");
try
{
Color color = new Color(100, 125, 12);
out.println("<li>Color --> " + color);
}
catch(Throwable ex)
{
out.println("<li>Excepción en Color --> " + ex);
}
try
{
Frame ventana = new Frame("ventana de prueba");
out.println("<li>Frame --> " + ventana);
}
catch(Throwable ex)
{
out.println("<li>Excepción en Frame --> " + ex);
}
try
{
Button boton = new Button("botón de prueba");
out.println("<li>Button --> " + boton);
}
catch(Throwable ex)
{
out.println("<li>Excepción en Button --> " + ex);
}
try
{
Font fuente = new Font("LucidaSansRegular", Font.PLAIN, 12);
out.println("<li>Fuente --> " + fuente);
}
catch(Throwable ex)
{
out.println("<li>Excepción en Font --> " + ex);
}
try
{
TextField campo = new TextField("campo de texto");
out.println("<li>TextField --> " + campo);
}
catch(Throwable ex)
{
out.println("<li>Excepción en TextField --> " + ex);
}
out.println("</ul></font>");
%>
<hr>
</body>
</html>
+151
View File
@@ -0,0 +1,151 @@
<%@ page import="com.tarisan.data.Usuario" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="com.tarisan.util.Utilidades" %>
<%@ page import="com.tarisan.control.*" %>
<%@ page import="com.tarisan.data.*" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de error (error.jsp)");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
HttpSession sesion = request.getSession(true);
String mensaje = null;
if(sesion.isNew() || (sesion.getAttribute("ERROR") == null))
{
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
response.sendRedirect("../html/login.html");
}
else
{
mensaje = (String)sesion.getAttribute("ERROR");
if(mensaje == null || (mensaje.trim().compareTo("") == 0))
{
mensaje = "Se ha producido un error al realizar la consulta";
}
sesion.removeAttribute("ERROR");
Usuario usuario = (Usuario)sesion.getAttribute("USUARIO");
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
try
{
%>
<html>
<head>
<title>Error en Tarisan</title>
<link rel="STYLESHEET" type="text/css" href="../css/estilos.css">
<script language="JavaScript" src="../js/funciones.js"></script>
<script language="JavaScript" src="../js/inicio_tarisan.js"></script>
<script language="JavaScript" src="../js/bloques_tarisan.js"></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>
<%
if(usuario == null)
{
%>
<td class="tituloTabla" align="center">&nbsp;</td>
<%
}
else
{
%>
<td class="tituloTabla" align="center"><%= usuario %></td>
<%
}
%>
</tr>
<tr>
<td bgcolor="#C02331"><img src="img/sp.gif" width="746" height="1" border="0"></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>
<table cellpadding="0" cellspacing="0" border="0" width="165">
<tr valign="top">
<td width="16" class="menuBack"><img src="../img/gen_bullet_cerrado.gif" name="bullet" width="16" height="12" border="0"></td>
<td width="150" class="menuOff"><b><%=pertamensaje.obtenerMensaje(39).getMensaje() %></b></td>
</tr>
</table>
</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%">
<tr><td>&nbsp;</td></tr>
<tr><td class="txtnegrita" align="center"><%= mensaje %></td></tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="txt" align="center"><%=pertamensaje.obtenerMensaje(38).getMensaje() %></td>
</tr>
<tr>
<td align="right"><a href="javascript:history.back();" class="enlace"><%=pertamensaje.obtenerMensaje(30).getMensaje() %></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
}
catch(Exception e){
LogTarisan.logger.log(NivelLog.INFO, "Final página de error (error.jsp)");
}
LogTarisan.logger.log(NivelLog.INFO, "Final página de error (error.jsp)");
%>
+142
View File
@@ -0,0 +1,142 @@
<%@ page import="com.tarisan.data.Usuario" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="com.tarisan.util.Utilidades" %>
<%@ page import="com.tarisan.control.*" %>
<%@ page import="com.tarisan.data.*" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de error (errorIguala.jsp)");
response.setHeader("Expires", "0");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
HttpSession sesion = request.getSession(true);
String mensaje = null;
if(sesion.isNew() || (sesion.getAttribute("ERROR") == null))
{
LogTarisan.logger.log(NivelLog.INFO, "Sesión invalidada");
response.sendRedirect("../html/login.html");
}
else
{
mensaje = (String)sesion.getAttribute("ERROR");
if(mensaje == null || (mensaje.trim().compareTo("") == 0))
{
mensaje = "El paciente es una iguala suya.";
}
sesion.removeAttribute("ERROR");
Usuario usuario = (Usuario)sesion.getAttribute("USUARIO");
Tamensaje tamensaje = new Tamensaje();
PersistenciaTamensaje pertamensaje = new PersistenciaTamensaje();
%>
<html>
<head>
<title>Error en Tarisan</title>
<link rel="STYLESHEET" type="text/css" href="../css/estilos.css">
<script language="JavaScript" src="../js/funciones.js"></script>
<script language="JavaScript" src="../js/inicio_tarisan.js"></script>
<script language="JavaScript" src="../js/bloques_tarisan.js"></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>
<%
if(usuario == null)
{
%>
<td class="tituloTabla" align="center">&nbsp;</td>
<%
}
else
{
%>
<td class="tituloTabla" align="center"><%= usuario %></td>
<%
}
%>
</tr>
<tr>
<td bgcolor="#C02331"><img src="img/sp.gif" width="746" height="1" border="0"></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>
<table cellpadding="0" cellspacing="0" border="0" width="165">
<tr valign="top">
<td width="16" class="menuBack"><img src="../img/gen_bullet_cerrado.gif" name="bullet" width="16" height="12" border="0"></td>
<td width="150" class="menuOff"><b>MENSAJE</b></td>
</tr>
</table>
</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%">
<tr><td>&nbsp;</td></tr>
<tr><td class="txtnegrita" align="center"><%= mensaje %></td></tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="txt" align="center"><%=pertamensaje.obtenerMensaje(32).getMensaje() %></td>
</tr>
<tr>
<td align="right"><a href="javascript:history.back();" class="enlace"><%=pertamensaje.obtenerMensaje(30).getMensaje() %></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
}
LogTarisan.logger.log(NivelLog.INFO, "Final página de error (errorIguala.jsp)");
%>
+276
View File
@@ -0,0 +1,276 @@
//valida que un string solo haya numeros
function soloNumeros(str1){
var formatoNumerico = /^([0-9])+$/; //solo numeros
return formatoNumerico.test(str1);
}
//********************************************************************************************************************
function esVacia(inputString)
{
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
return (retValue=="")
}
//********************************************************************************************************************
function quitarUltimosSaltosLinea(campo)
{
//Eliminamos los saltos de linea que esten despues del ultimo elemento
while (campo.value.indexOf("\r\n",campo.value.length-2)!=-1)
campo.value=campo.value.substring(0, campo.value.length-2);
}
//********************************************************************************************************************
//valida Fechas de con formato dd-mm-aaaa
function valorFecha(campo)
{
var resultado = true;
if (campo.value != "")
{
var diaMesAno = (campo.value).split("-");
if(isNaN(diaMesAno[0]) || isNaN(diaMesAno[1]) || isNaN(diaMesAno[2]))
{
resultado = false;
}
else if (diaMesAno.length < 3)
{
resultado = false;
}
else if (diaMesAno[0].length > 2 || diaMesAno[1].length > 2 || diaMesAno[2].length > 4)//fecha!=00-00-0000
{
resultado = false;
}
else if (diaMesAno[2] < 1900) //año menor que 1900
{
resultado = false;
}
else if (diaMesAno[0] > 31 || diaMesAno[0] <= 0)//dia mayor que 31
{
resultado = false;
}
else if (diaMesAno[1] > 12 || diaMesAno[1] <= 0)//mes mayor que 12
{
resultado = false;
}
else if (diaMesAno[0] == 31 && (diaMesAno[1] == 4 || diaMesAno[1] == 6 || diaMesAno[1] == 9 || diaMesAno[1] == 11) )//dia 31 en meses de 30
{
resultado = false;
}
else if (diaMesAno[1] == 2)
{
//febrero
var isleap = (diaMesAno[2]%4 == 0 && (diaMesAno[2]%100 != 0 || diaMesAno[2]%400 == 0));
if (diaMesAno[0] > 29 || (diaMesAno[0] == 29 && !isleap))
{
resultado = false;
}
}
}
if (!resultado)
{
respMalaValidacion("Debe introducir una fecha con el siguiente formato:\n dd-mm-aaaa", campo);
}
return resultado;
}
//********************************************************************************************************************
//Respuesta a una mala validacion de un campo
function respMalaValidacion(msg, campo)
{
if (msg!='')
{
if (msg.substring(0, 3) == 'msg') //miramos si es un codigo de mensaje
{
alert(eval(msg));
}
else
{
alert(msg);
}
}
if (campo.type == "text")
{
campo.select();
}
campo.focus();
return false;
}
/*--------------------------funcion marquee js -------------------------------*/
function marquee(a, b, noticia) {
var width = b.width();
var start_pos = a.width();
var end_pos = -width;
var longitudNoticia = noticia.length;
var longitudMarquee = 0;
longitudMarquee = longitudNoticia * 7.4;
var tiempo = 0;
/*tiempo = longitudMarquee * 35; MAS RAPIDO */
tiempo = longitudMarquee * 70;
function scroll() {
if (b.position().left <= -width) {
b.css('left', start_pos);
scroll();
}
else {
time = (parseInt(b.position().left, 10) - end_pos) *
(tiempo / (start_pos - end_pos)); // Increase or decrease speed by changing value 10000 (tiempo)
b.animate({
'left': -width
}, time, 'linear', function() {
scroll();
});
}
}
b.css({
'width': width,
'left': start_pos
});
/*scroll(a, b);*/
scroll();
b.mouseenter(function() { // Remove these lines
b.stop(); //
b.clearQueue(); // if you don't want
}); //
b.mouseleave(function() { // marquee to pause
/* scroll(a, b); */
scroll();//
}); // on mouse over
}
/*--------------------------funcion marquee js -------------------------------*/
function marqueeRapido(a, b, noticia) {
var width = b.width();
var start_pos = a.width();
var end_pos = -width;
var longitudNoticia = noticia.length;
var longitudMarquee = 0;
longitudMarquee = longitudNoticia * 7.4;
var tiempo = 0;
tiempo = longitudMarquee * 5;
/*tiempo = longitudMarquee * 70; MAS LENTO */
function scroll() {
if (b.position().left <= -width) {
b.css('left', start_pos);
scroll();
}
else {
time = (parseInt(b.position().left, 10) - end_pos) *
(tiempo / (start_pos - end_pos)); // Increase or decrease speed by changing value 10000 (tiempo)
b.animate({
'left': -width
}, time, 'linear', function() {
scroll();
});
}
}
b.css({
'width': width,
'left': start_pos
});
/*scroll(a, b);*/
scroll();
b.mouseenter(function() { // Remove these lines
b.stop(); //
b.clearQueue(); // if you don't want
}); //
b.mouseleave(function() { // marquee to pause
/* scroll(a, b); */
scroll();//
}); // on mouse over
}
//********************************************************************************************************************
//Pone la longitud de la noticia por css
function tamanioNoticia(noticia)
{
var longitudNoticia = noticia.length;
var longitudMarquee = 0;
var strLongitud = "";
longitudMarquee = longitudNoticia * 7.4;
strLongitud = "" + (longitudMarquee + 130) + "px";
var css = '' +
'.marquee {' +
'width:' + strLongitud +
'}' +
'';
head = document.head || document.getElementsByTagName('head')[0];
style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet){
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
}
//********************************************************************************************************************
function mostrarPDF(nombrePDF) {
var fileName = nombrePDF;
document.getElementById('dialog').dialog({
modal: true,
title: fileName,
width: 540,
height: 450,
buttons: {
Close: function () {
this.dialog('close');
}
},
open: function () {
var object = "<object data=\"{FileName}\" type=\"application/pdf\" width=\"500px\" height=\"300px\">";
object += "If you are unable to view file, you can download from <a href = \"{FileName}\">here</a>";
object += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
object += "</object>";
object = object.replace(/{FileName}/g, "Files/" + fileName);
document.getElementById('dialog').html(object);
}
});
}
//********************************************************************************************************************
function validarEmail( email ) {
expr = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if ( !expr.test(email) ){
return false;
}else{
return true;
}
}
+51
View File
@@ -0,0 +1,51 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.GregorianCalendar" %>
<%@ page import="java.util.TimeZone" %>
<%@ page import="java.util.*" %>
<%
Date fecha = new Date();
Calendar calendario = Calendar.getInstance();
calendario.setTime(fecha);
java.util.TimeZone tZone = TimeZone.getTimeZone("Europe/Madrid");
tZone.setID("Europe/Madrid");
tZone.setDefault(tZone);
Locale loCurrentLocale = new Locale("ES", "ES");
GregorianCalendar gcHoy = new GregorianCalendar( tZone, loCurrentLocale);
%>
<html>
<head>
<title>Control de Horas</title>
</head>
<body>
<script>
var hora_actual = new Date()
hora = hora_actual.getHours();
minutos = hora_actual.getMinutes();
if (hora<10)
hora="0"+hora;
if (minutos<10)
minutos="0"+minutos;
document.write("<b>Hora de JavaScript: </b>");
document.write(hora+":"+minutos)
</script>
<br>
<b>Hora del Calendar: </b><%=calendario.getTime()%>
<br>
<b>Hora del Calendar (con TimeZone): </b><%=calendario.getTime()%>
<br>
<b>Hora del Date: </b><%=fecha%>
</body>
</html>
+35
View File
@@ -0,0 +1,35 @@
function preguntaImp()
{
top.contenidoPrincipal.location.href = '../../html/imp/fin_imprimiendo.html';
}
function imprimirHTML()
{
//imprimimos la pagina....
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
alert("Dentro de imprimirHTML");
if (NS || VERSION>4 || document.all)
{
//top.vacio.focus();
//alert("Dentro de IF");
//top.vacio.print()
}
else
{
//alert("Dentro de ELSE");
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);
}
setTimeout("preguntaImp();", 3000);
}
function VentanaImpresion(contexto, urlAbsoluta)
{
var vLeft = (screen.availWidth-10-300)/2;
var vTop = (screen.availHeight-100-120)/2;
Vimprimir = window.open(urlAbsoluta,'Imprimir','width=300,height=120,left='+vLeft+',top='+vTop+",menubar=no,scrollbars=no,resizable=yes,location=no,status=no,toolbar=no,directories=no");
}
+160
View File
@@ -0,0 +1,160 @@
//var pathLOCAL = "../../";
//IMPORTANTE:
//El valor de esta variable se debe corresponder con el contexto de la aplicacion
//Si el contexto se cambia a otro distinto de tarisan, es necesario actualizar este valor,
//de lo contrario, las pantallas no se verán correctamente.
var pathLOCAL = "/tarisan/";
if (document.images) {
//bullets del menu de la izq
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
}
var pNG="";
//Las diferentes secciones (menus horizontales)
var SECCION_ADMINISTRADOR = "00";
var SECCION_MEDICOS = "11";
var SECCION_PACIENTES = "12";
var SECCION_SALIR = "13";
function seccionesAMostrar( pNG )
{
var mostrarSeccion = new Array();
mostrarSeccion[MEDICO]= true; //Siempre se muestra
mostrarSeccion[PACIENTE]= false;
if( pNG.indexOf("MED") != -1 )
mostrarSeccion[MEDICO]= true;
if( pNG.indexOf("PAC") != -1 )
mostrarSeccion[PACIENTE]= true;
if( pNG.indexOf("ADM") != -1 )
mostrarSeccion[ADMINISTRADOR]= true;
return mostrarSeccion;
}
// Inicializamos x,y
var x = null;
var queryValues = getArgs();
if (queryValues.x){x = queryValues.x - 0};
var y=null;
//***************************************
function getPerfil()
{
var perfil = "";
perfil = getCookie("PERFIL");
if (!perfil)
{
perfil = ESPECIALISTA;//El perfil por defecto
setCookie("PERFIL",perfil);
}
return perfil;
}
function setCookie(nombre, valor) {
document.cookie = nombre + "=" + escape(valor);
}
function getCookie(nombre) {
var buscamos = nombre + "=";
if (document.cookie.length > 0)
{
i = document.cookie.indexOf(buscamos);
if (i != -1)
{
i += buscamos.length;
j = document.cookie.indexOf(";", i);
if (j == -1)
j = document.cookie.length;
return unescape(document.cookie.substring(i,j));
}
}
}
function cambiar(nombre,estado) {
if (document.images)
eval("document."+nombre+".src = "+estado+".src");
}
function getSeccion()
{
var seccionActual = "";
seccionActual = getCookie("SECCION");
if (!seccionActual)
{
seccionActual = SECCION_MEDICOS;//La seccion por defecto
setCookie("SECCION",seccionActual);
}
return seccionActual;
}
function setSeccion( idSeccion )
{
var seccionActual = "";
seccionActual = getCookie("SECCION");
if ( seccionActual != idSeccion )
{
if(idSeccion==SECCION_MEDICOS)
{
document.location.href = pathLOCAL + 'servlet/GestorMedicos?OPCION=4';
}
else if(idSeccion==SECCION_PACIENTES)
{
document.location.href = pathLOCAL + 'servlet/GestorPacientes?OPCION=0';
}
else if(idSeccion==SECCION_ADMINISTRADOR)
{
document.location.href = pathLOCAL + 'servlet/GestorAdministracion?OPCION=1';
}
else
{
document.location.href = pathLOCAL + 'servlet/Logout';
}
}
}
function getArgs() {
var args = new Object();
var query = location.search.substring(1); // quitamos el ? a la cadena
var pairs;
// El parámetro URL es especial, debe venir el último y a partir de él
//ya no se procesarán más parámetros, ya que le parámetro url puede tener
//a su vez sus propios parámetros.
var posUrl = query.indexOf("url=");
if (posUrl == -1)
posUrl = query.indexOf("url=");
if (posUrl > -1)
{
//Se ha encontrado el parámetro URL.
args["url"] = query.substring(posUrl+4);
query = query.substring(0,posUrl);
}
pairs = query.split("&"); // troceamos la cadena por los &
for (var i=0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('='); // Busca nombre=valor
if (pos == -1) continue;
var argName = pairs[i].substring(0,pos); // el nombre
var argValue = pairs[i].substring(pos+1); // el valor
args [argName] = unescape(argValue); // lo guarda como propiedad
}
return args;
}
+10351
View File
File diff suppressed because it is too large Load Diff
+16617
View File
File diff suppressed because it is too large Load Diff
+13
View File
File diff suppressed because one or more lines are too long
+8
View File
File diff suppressed because one or more lines are too long
+154
View File
@@ -0,0 +1,154 @@
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.io.ByteArrayOutputStream" %>
<%@ page import="java.io.ObjectOutputStream" %>
<%@ page import="java.io.NotSerializableException" %>
<HTML>
<BODY>
<%
Date fecha = null;
SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd 'de' MMMM 'de' yyyy',' HH:mm:ss");
Calendar calendario = Calendar.getInstance();
out.print("<hr>");
out.print("Fecha = " + sdf.format(calendario.getTime()));
out.print("<hr>");
HttpSession miSession = request.getSession(true);
Object valor = null;
int total = 0;
Vector salidaListado;
StringBuffer elementoListado;
String nombre;
Enumeration listaSession = miSession.getAttributeNames();
out.print("<br>");
out.print("<b>LISTADO DE LOS OBJETOS DE SESI&Oacute;N</b><br>");
if((listaSession != null) && (listaSession.hasMoreElements()))
{
out.println("<font size=-1><ul>" );
ByteArrayOutputStream o;
ObjectOutputStream buf;
boolean serial;
salidaListado = new Vector();
for(; listaSession.hasMoreElements();)
{
serial = false;
nombre = (String)listaSession.nextElement();
elementoListado = new StringBuffer();
elementoListado.append("<li><b>");
elementoListado.append(nombre);
elementoListado.append("</b>");
valor = miSession.getAttribute(nombre);
elementoListado.append(" --> ");
elementoListado.append(valor.getClass().getName());
elementoListado.append(" --> ");
elementoListado.append(valor);
try
{
o = new ByteArrayOutputStream();
buf = new ObjectOutputStream(o);
buf.writeObject(valor);
buf.flush();
elementoListado.append(" --> ");
elementoListado.append(o.size());
elementoListado.append(" bytes");
total += o.size();
}
catch(NotSerializableException ex)
{
elementoListado.append(" --> ??? bytes");
}
salidaListado.addElement(elementoListado.toString());
}
o = null;
buf = null;
for(int ind = 0; ind < salidaListado.size(); ind++)
{
out.println((String)salidaListado.elementAt(ind));
}
out.println("</font></ul>" );
out.println( "<b>TOTAL(aproximado) = " + total + " bytes</b>" );
}
else
{
out.println( "No existen objetos almacenados en la sesión" );
}
out.print("<hr>");
out.print("<br>");
out.print("<b>LISTADO DE LAS COOKIES</b><br>");
Cookie[] listaCookies = request.getCookies();
if((listaCookies != null) && (listaCookies.length > 0))
{
Cookie unaCookie;
int duracion;
salidaListado = new Vector();
out.println("<font size=-1><ul>" );
for(int ind = 0; ind < listaCookies.length; ind++)
{
unaCookie = listaCookies[ind];
elementoListado = new StringBuffer();
elementoListado.append("<li><b>");
elementoListado.append(unaCookie.getName());
elementoListado.append("</b> --> ");
elementoListado.append(unaCookie.getValue());
duracion = unaCookie.getMaxAge();
elementoListado.append(" [duración = ");
if (duracion >= 0)
{
fecha.setTime((long)(duracion*1000));
calendario.setTime(fecha);
elementoListado.append(calendario.get(Calendar.HOUR_OF_DAY));
elementoListado.append("h.");
elementoListado.append(calendario.get(Calendar.MINUTE));
elementoListado.append("m.");
elementoListado.append(calendario.get(Calendar.SECOND));
elementoListado.append("s.");
elementoListado.append(calendario.get(Calendar.MILLISECOND));
elementoListado.append("ms");
elementoListado.append("]");
}
else
{
elementoListado.append("hasta que se cierre el navegador]");
}
salidaListado.addElement(elementoListado.toString());
}
for(int ind = 0; ind < salidaListado.size(); ind++)
{
out.println((String)salidaListado.elementAt(ind));
}
out.println("</font></ul>" );
}
else
{
out.println( "No existen cookies" );
}
%>
</BODY>
</HTML>
+278
View File
@@ -0,0 +1,278 @@
// ******************************************
// Cargamos las opciones del menu en un ARRAY
// ******************************************
// Inicializar las variables para la funci&oacute;n generaPath
var ADMINISTRADOR = "00";
var CABECERA = "01";
var ANALISTA = "02";
var ESPECIALISTA = "03";
var REHABPOD = "04";
var ATS = "05";
var ESTOMA = "06";
setCookie("SECCION", SECCION_ADMINISTRADOR);
// el 1er parametro es el texto que se muestra
// el 2o parametro es la URL a la que va el link
// el 3er parametro son los perfiles que admite esa opcion
// escribimos el 1er nivel de navegacion
var menu = new Array();
// Administraci&oacute;n del sistema
menu[0] = ["Usuarios", pathLOCAL + "jsp/adm/lista_usuarios.jsp?x=0&pagina=1", "00"];
menu[1] = ["Password", pathLOCAL + "jsp/med/password.jsp?x=1", "00"];
menu[2] = ["Mantenimiento Autorizaciones", pathLOCAL + "jsp/adm/mto_taconaut.jsp?x=2&pagina=1", "00"];
menu[3] = ["Mantenimiento Niveles Analiticos", pathLOCAL + "jsp/adm/mto_analiticas.jsp?x=3", "00"];
menu[4] = ["Mantenimiento Peticiones", pathLOCAL + "jsp/adm/mto_peticiones.jsp?x=4", "00"];
menu[5] = ["Mantenimiento actos imputados", pathLOCAL + "jsp/adm/mto_tamovext.jsp?x=5", "00"];
menu[6] = ["Poner Cambios en Produccion", pathLOCAL + "jsp/adm/poner_en_produccion.jsp?x=6", "00"];
//precargamos las imagenes
//if (document.images) {
//bullets del menu de la izq
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
//}
var stContenedor = (document.layers)?"contenedorMenu.document.":"";
var esCargado = false;
var ponImgs = false;
var iContador = 0;
window.onload = Cargado;
function Cargado(){
esCargado = true;
}
// pNG --> perfilNavegacionGestion puede ser | 01 | 02 | 03 |
//Funci&oacute;n que determina si se escribe una opci&oacute;n de menú
//strAcceso debe contener las opciones de acceso de la opci&oacute;n
//a escribir (el tercer parámetro cuando se declaran las opciones).
//**** IR CONSTRUYENDO EL IF PARA LUEGO HACER UN EVAL ****
//EJ: Si strAcceso fuese |05|01&T2|
//El resultado seráa un eval de la cadena:
//((pNG.indexOf("05")) || ((pNG.indexOf("01")) && (pNG.indexOf("T2")))
function tiene(churroOpciones,condicion){
if (churroOpciones.indexOf("|"+condicion+"|")>=0)
return true;
else
return false;
}
function notiene(churroOpciones,condicion){
condicion=condicion.substring(1, condicion.length);
if (churroOpciones.indexOf("|"+condicion+"|")<0)
return true;
else
return false;
}
function escribirOpcionMenu(strAcceso){
var resultado = true;
var strCadenaBooleana = "";
//Troceamos el churro de accesos
var strVectorAcceso = strAcceso.split("|");
for (var i=0; i<strVectorAcceso.length; i++)
{
var strOpcion = strVectorAcceso[i];
if (i!=0)
strCadenaBooleana = strCadenaBooleana + " || ";
if (strOpcion.indexOf("&") > -1)
{
var strSubVectorAcceso2 = strOpcion.split("&");
var booPrimeraEntradaY = true;
strCadenaBooleana = strCadenaBooleana + " (";
for (var j=0;j<strSubVectorAcceso2.length;j++)
{
strOpcion = strSubVectorAcceso2[j];
if (j!=0)
strCadenaBooleana = strCadenaBooleana + " && ";
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
strCadenaBooleana = strCadenaBooleana + ") ";
}
else
{
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
}
if (strCadenaBooleana.length > 0)
resultado = eval(strCadenaBooleana);
else
resultado = false;
return resultado;
}
function construirMenuGst(){
var separador = '<tr valign="top"><td colspan="2"><img src="' + './img/sp.gif" width="1" height="8" border="0"></td></tr>';
var stOpcion = '<table cellpadding="0" cellspacing="0" border="0" width="165">\n';
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if (i==x){
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuOnSelect"><img src="' + './img/sp.gif" name="bullet' + i + '" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname){
stOpcion += ' <td width="150" class="menuOnSelect"><a href="javascript:reescribirMenuGst('+i+');" class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
}else
stOpcion += ' <td width="150" class="menuOnSelect"><a href=' + menu[i][1] +' class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
stOpcion += "</td></tr>" + separador;
}
else {
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuBack"><img src="' + './img/sp.gif" name="bullet' + i +'" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname)
stOpcion += " <td width='150' class='menuBack'><a href=\"javascript:reescribirMenuGst("+i+");\" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
else
stOpcion += " <td width='150' class='menuBack'><a href=" + menu[i][1] +" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
stOpcion += "</td></tr>" + separador;
}
}
}
stOpcion += "</table>";
return stOpcion;
}
function escribirMenuGst(){
var stCapaMenu = (document.layers)?'<div id="contenedorMenu" style="position:relative;top:0px;left:0px;">\n\n':'<div id="contenedorMenu">\n\n';
stCapaMenu += (document.layers)?'<img src="/img/gen_bullet_cerrado.gif" width="165" height="1">':construirMenuGst();
stCapaMenu += '</div>';
document.write(stCapaMenu);
//hacemos un retardo si navega con un ie 4.x
if (document.all && navigator.appVersion.indexOf("MSIE 4.")>=0 )
setTimeout('reescribirMenuGst(x,y)',5800);
else
reescribirMenuGst(x,y);
}
function reescribirMenuGst(k,j){
x = k;
if((j<0) ||(j==null))
y = null;
else
y = j;
var stMenuDesplegado = "";
if (document.layers) {
if(document.contenedorMenu){
stMenuDesplegado = construirMenuGst();
document.layers["contenedorMenu"].document.open();
stHTML = '<layer top="0" left="0">'+stMenuDesplegado+'</layer>';
if(esCargado){
document.layers["contenedorMenu"].document.write(stHTML);
ponImgs = true;
}
document.layers["contenedorMenu"].document.close();
if(!esCargado){
iContador +=1;
if(iContador > 10)
esCargado = true;
setTimeout('reescribirMenuGst(x,y)',800);
}
}
else
setTimeout('reescribirMenuGst(x,y)',800);
}
else if (document.all) {
stMenuDesplegado = construirMenuGst();
document.all["contenedorMenu"].innerHTML = stMenuDesplegado;
ponImgs = true;
}
else if (document.getElementById) {
stMenuDesplegado = construirMenuGst();
document.getElementById("contenedorMenu").innerHTML = stMenuDesplegado;
ponImgs = true;
}
if(ponImgs){
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if(i==x){
if (y<0 || y==null)
cambiar("bullet" + i,"bulletSelect");
else
cambiar("bullet" + i,"bulletAbierto");
/*if (!(subMenu[x]==null))
{
for (j=0 ; j<subMenu[x].length; j++)
{
if (escribirOpcionMenu(subMenu[x][j][2]))
{
if (j==y)
{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletSelect");
}
else{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletCerrado");
}
}
}
}*/
}
else
cambiar("bullet" + i,"bulletCerrado");
}
}
}
}
+297
View File
@@ -0,0 +1,297 @@
// ******************************************
// Cargamos las opciones del menu en un ARRAY
// ******************************************
// Inicializar las variables para la funci&oacute;n generaPath
var ADMINISTRADOR = "00";
var CABECERA = "01";
var ANALISTA = "02";
var ESPECIALISTA = "03";
var REHABPOD = "04";
var ATS = "05";
var ESTOMA = "06";
var ODON = "07";
var RADIOLOGO = "08";
setCookie("SECCION", SECCION_MEDICOS);
// el 1er parametro es el texto que se muestra
// el 2o parametro es la URL a la que va el link
// el 3er parametro son los perfiles que admite esa opcion
// escribimos el 1er nivel de navegacion
var menu = new Array();
// Gestion medicos
menu[0] = ["Cabecera", pathLOCAL + "jsp/med/cabecera.jsp?x=0", "01|02|03|04|05|06|07|08"];
menu[1] = ["Password", pathLOCAL + "jsp/med/password.jsp?x=1", "00|01|02|03|04|05|06|07|08"];
menu[2] = ["Actos M\u00E9dicos", pathLOCAL + "jsp/med/actos.jsp?x=2&pagina=1", "01|02|03|04|05|06|08"];
menu[3] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion.jsp?x=3", "01|03|04|05|06|07"];
menu[4] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion_analista.jsp?x=4&pagina=1", "02"];
menu[5] = ["Liquidaci\u00F3n Actos Tarisan", pathLOCAL + "jsp/med/liquidacion_radiologo.jsp?x=5&pagina=1", "08"];
menu[6] = ["Detalle Pacientes", pathLOCAL + "jsp/med/detallePacientes.jsp?x=6&pagina=1", "01|02|03|04|05|06|07|08"];
menu[7] = ["I.R.P.F.", pathLOCAL + "jsp/med/detalleIRPF.jsp?x=7&pagina=1", "01|02|03|04|05|06|08"];
menu[8] = ["Medicamentos", pathLOCAL + "jsp/med/medicamentos.jsp?x=8&pagina=1", "01|03"];
menu[9] = ["Prescripciones", pathLOCAL + "jsp/med/prescripciones.jsp?x=9&pagina=1", "01|03"];
menu[10] = ["An\u00E1lisis", pathLOCAL + "jsp/med/analisis.jsp?x=10&pagina=1", "01|03"];
menu[11] = ["Anatomia patol\u00F3gica", pathLOCAL + "jsp/med/ap.jsp?x=11&pagina=1", "01|03"];
menu[12] = ["Igualados", pathLOCAL + "jsp/med/igualados.jsp?x=12&pagina=1", "01"];
menu[13] = ["Gesti\u00F3n Perfiles", pathLOCAL + "jsp/med/gestor_perfiles.jsp?x=13&pagina=1", "01|03"];
menu[14] = ["Hist\u00F3rico liquidaciones", pathLOCAL + "jsp/med/historico_liquidacion.jsp?x=14", "01|02|03|04|05|06|07|08"];
menu[15] = ["Volantes Ingreso o CMA", pathLOCAL + "jsp/med/historico_volantes.jsp?x=15", "00"];
menu[16] = ["Prescripciones ATS", pathLOCAL + "jsp/med/historico_ats.jsp?x=16", "01|03|06"];
//menu[15] = ["Detalle An\u00E1lisis Capturados", pathLOCAL + "jsp/med/detalle_analista.jsp?x=15", "02"];
menu[17] = ["Imprimir An\u00E1lisis Capturados", pathLOCAL + "jsp/med/peticiones_capturadas.jsp?x=17&pagina=1", "02|08"];
menu[18] = ["Determinaciones Anal\u00edticas", pathLOCAL + "jsp/med/determinaciones.jsp?x=18&pagina=1", "01|02|03|04|05|06|07"];
menu[19] = ["Noticias", pathLOCAL + "jsp/med/noticias.jsp?x=19&pagina=1", "01|02|03|04|05|06|07|08"];
menu[20] = ["Incidencia", pathLOCAL + "jsp/med/incidencia.jsp?x=20&limpiarAdjuntos=1", "01|02|03|04|05|06|07|08"];
//precargamos las imagenes
//if (document.images) {
//bullets del menu de la izq
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
//}
var stContenedor = (document.layers)?"contenedorMenu.document.":"";
var esCargado = false;
var ponImgs = false;
var iContador = 0;
window.onload = Cargado;
function Cargado(){
esCargado = true;
}
// pNG --> perfilNavegacionGestion puede ser | 01 | 02 | 03 |
//Funci&oacute;n que determina si se escribe una opci&oacute;n de menú
//strAcceso debe contener las opciones de acceso de la opci&oacute;n
//a escribir (el tercer parámetro cuando se declaran las opciones).
//**** IR CONSTRUYENDO EL IF PARA LUEGO HACER UN EVAL ****
//EJ: Si strAcceso fuese |05|01&T2|
//El resultado seráa un eval de la cadena:
//((pNG.indexOf("05")) || ((pNG.indexOf("01")) && (pNG.indexOf("T2")))
function tiene(churroOpciones,condicion){
if (churroOpciones.indexOf("|"+condicion+"|")>=0)
return true;
else
return false;
}
function notiene(churroOpciones,condicion){
condicion=condicion.substring(1, condicion.length);
if (churroOpciones.indexOf("|"+condicion+"|")<0)
return true;
else
return false;
}
function escribirOpcionMenu(strAcceso){
var resultado = true;
var strCadenaBooleana = "";
//Troceamos el churro de accesos
var strVectorAcceso = strAcceso.split("|");
for (var i=0; i<strVectorAcceso.length; i++)
{
var strOpcion = strVectorAcceso[i];
if (i!=0)
strCadenaBooleana = strCadenaBooleana + " || ";
if (strOpcion.indexOf("&") > -1)
{
var strSubVectorAcceso2 = strOpcion.split("&");
var booPrimeraEntradaY = true;
strCadenaBooleana = strCadenaBooleana + " (";
for (var j=0;j<strSubVectorAcceso2.length;j++)
{
strOpcion = strSubVectorAcceso2[j];
if (j!=0)
strCadenaBooleana = strCadenaBooleana + " && ";
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
strCadenaBooleana = strCadenaBooleana + ") ";
}
else
{
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
}
if (strCadenaBooleana.length > 0)
resultado = eval(strCadenaBooleana);
else
resultado = false;
return resultado;
}
function construirMenuGst(){
var separador = '<tr valign="top"><td colspan="2"><img src="' + './img/sp.gif" width="1" height="8" border="0"></td></tr>';
var stOpcion = '<table cellpadding="0" cellspacing="0" border="0" width="165">\n';
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if (i==x){
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuOnSelect"><img src="' + './img/sp.gif" name="bullet' + i + '" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname){
stOpcion += ' <td width="150" class="menuOnSelect"><a href="javascript:reescribirMenuGst('+i+');" class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
}else
stOpcion += ' <td width="150" class="menuOnSelect"><a href=' + menu[i][1] +' class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
stOpcion += "</td></tr>" + separador;
}
else {
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuBack"><img src="' + './img/sp.gif" name="bullet' + i +'" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname)
stOpcion += " <td width='150' class='menuBack'><a href=\"javascript:reescribirMenuGst("+i+");\" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
else
stOpcion += " <td width='150' class='menuBack'><a href=" + menu[i][1] +" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
stOpcion += "</td></tr>" + separador;
}
}
}
stOpcion += "</table>";
return stOpcion;
}
function escribirMenuGst(){
var stCapaMenu = (document.layers)?'<div id="contenedorMenu" style="position:relative;top:0px;left:0px;">\n\n':'<div id="contenedorMenu">\n\n';
stCapaMenu += (document.layers)?'<img src="/img/gen_bullet_cerrado.gif" width="165" height="1">':construirMenuGst();
stCapaMenu += '</div>';
document.write(stCapaMenu);
//hacemos un retardo si navega con un ie 4.x
if (document.all && navigator.appVersion.indexOf("MSIE 4.")>=0 )
setTimeout('reescribirMenuGst(x,y)',5800);
else
reescribirMenuGst(x,y);
}
function reescribirMenuGst(k,j){
x = k;
if((j<0) ||(j==null))
y = null;
else
y = j;
var stMenuDesplegado = "";
if (document.layers) {
if(document.contenedorMenu){
stMenuDesplegado = construirMenuGst();
document.layers["contenedorMenu"].document.open();
stHTML = '<layer top="0" left="0">'+stMenuDesplegado+'</layer>';
if(esCargado){
document.layers["contenedorMenu"].document.write(stHTML);
ponImgs = true;
}
document.layers["contenedorMenu"].document.close();
if(!esCargado){
iContador +=1;
if(iContador > 10)
esCargado = true;
setTimeout('reescribirMenuGst(x,y)',800);
}
}
else
setTimeout('reescribirMenuGst(x,y)',800);
}
else if (document.all) {
stMenuDesplegado = construirMenuGst();
document.all["contenedorMenu"].innerHTML = stMenuDesplegado;
ponImgs = true;
}
else if (document.getElementById) {
stMenuDesplegado = construirMenuGst();
document.getElementById("contenedorMenu").innerHTML = stMenuDesplegado;
ponImgs = true;
}
if(ponImgs){
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if(i==x){
if (y<0 || y==null)
cambiar("bullet" + i,"bulletSelect");
else
cambiar("bullet" + i,"bulletAbierto");
/*if (!(subMenu[x]==null))
{
for (j=0 ; j<subMenu[x].length; j++)
{
if (escribirOpcionMenu(subMenu[x][j][2]))
{
if (j==y)
{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletSelect");
}
else{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletCerrado");
}
}
}
}*/
}
else
cambiar("bullet" + i,"bulletCerrado");
}
}
}
}
+306
View File
@@ -0,0 +1,306 @@
// ******************************************
// Cargamos las opciones del menu en un ARRAY
// ******************************************
// Inicializar las variables para la función generaPath
var ADMINISTRADOR = "00";
var CABECERA = "01";
var ANALISTA = "02";
var ESPECIALISTA = "03";
var REHABPOD = "04";
var ATS = "05";
var ESTOMA = "06";
var ODON = "07";
var RADIOLOGO = "08";
setCookie( "SECCION",SECCION_PACIENTES);
// el 1er parametro es el texto que se muestra
// el 2o parametro es la URL a la que va el link
// el 3er parametro son los perfiles que admite esa opcion
// escribimos el 1er nivel de navegacion
var menu = new Array();
// Gestion pacientes
/*menu[0] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion.jsp?x=0&pagina=1", "01|03|06"];
menu[1] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion_rehabpod.jsp?x=1&pagina=1", "04|05"];
menu[2] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion_odon.jsp?x=2&pagina=1", "07"];
menu[3] = ["Petici\u00F3n Autorizaci\u00F3n", pathLOCAL + "jsp/pac/autorizacion.jsp?x=3&pagina=1", "01|03"];
menu[4] = ["Anal\u00EDtica", pathLOCAL + "jsp/pac/analitica.jsp?x=4&pagina=1", "01|03"];
menu[5] = ["Radiodiagn\u00F3stico", pathLOCAL + "jsp/pac/diagnostico.jsp?x=5", "01|03|06"];
menu[6] = ["Anatom\u00EDa Patol\u00F3gica", pathLOCAL + "jsp/pac/anatomia.jsp?x=6&pagina=1", "01|03|06"];
menu[7] = ["Otras Peticiones", pathLOCAL + "jsp/pac/peticiones.jsp?x=7&pagina=1", "01|03"];
menu[8] = ["Recetas", pathLOCAL + "jsp/pac/recetas.jsp?x=8&pagina=1", "01|03|06|07|08"];
menu[9] = ["Historial de Paciente", pathLOCAL + "jsp/pac/historia.jsp?x=9&pagina=1", "01|03|04|05|06|07|08"];
menu[10] = ["Analista", pathLOCAL + "jsp/pac/analista.jsp?x=10", "02"];
menu[11] = ["Volante ingreso o CMA", pathLOCAL + "jsp/pac/volante_medico.jsp?x=11", "00"];
//menu[10] = ["Volante ingreso", pathLOCAL + "jsp/pac/volante_medico.jsp?x=10", "00|01|02|03|04|05|06|07|08"];
menu[12] = ["Prescripci\u00F3n ATS", pathLOCAL + "jsp/pac/ats.jsp?x=12&pagina=1", "01|03|06"];
menu[13] = ["Detalle de Pacientes", pathLOCAL + "jsp/pac/detallePacientes.jsp?x=13&pagina=1&imp=1", "01|03|04|05|06|07|08"];
menu[14] = ["Cambio Paciente", pathLOCAL + "servlet/GestorPacientes?OPCION=0", "01|02|03|04|05|06|07|08"];*/
menu[0] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion.jsp?x=0&pagina=1", "01|03|06"];
menu[1] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion_rehabpod.jsp?x=1&pagina=1", "04|05"];
menu[2] = ["Facturaci\u00F3n", pathLOCAL + "jsp/pac/facturacion_odon.jsp?x=2&pagina=1", "07"];
menu[3] = ["Petici\u00F3n Autorizaci\u00F3n", pathLOCAL + "jsp/pac/autorizaciones.jsp?x=3&pagina=1", "01|03"];
menu[4] = ["Anal\u00EDtica", pathLOCAL + "jsp/pac/analitica.jsp?x=4&pagina=1", "01|03"];
menu[5] = ["Radiodiagn\u00F3stico", pathLOCAL + "jsp/pac/diagnostico.jsp?x=5", "01|03|06"];
menu[6] = ["Anatom\u00EDa Patol\u00F3gica", pathLOCAL + "jsp/pac/anatomia.jsp?x=6&pagina=1", "01|03"];
menu[7] = ["Otras Peticiones", pathLOCAL + "jsp/pac/peticiones.jsp?x=7&pagina=1", "01|03"];
menu[8] = ["Recetas", pathLOCAL + "jsp/pac/recetas.jsp?x=8&pagina=1", "01|03|06|07"]; /* |08*/
menu[9] = ["Historial de Paciente", pathLOCAL + "jsp/pac/historia.jsp?x=9&pagina=1", "01|03|04|05|06|07"]; /* |08*/
menu[10] = ["Analista", pathLOCAL + "jsp/pac/analista.jsp?x=10", "02"];
menu[11] = ["Radi\u00F3logo", pathLOCAL + "jsp/pac/radiologo.jsp?x=11", "08"];
menu[12] = ["Volante ingreso o CMA", pathLOCAL + "jsp/pac/volante_medico.jsp?x=12", "00"];
//menu[10] = ["Volante ingreso", pathLOCAL + "jsp/pac/volante_medico.jsp?x=10", "00|01|02|03|04|05|06|07|08"];
menu[13] = ["Prescripci\u00F3n ATS", pathLOCAL + "jsp/pac/ats.jsp?x=13&pagina=1", "01|03|06"];
menu[14] = ["Detalle de Pacientes", pathLOCAL + "jsp/pac/detallePacientes.jsp?x=14&pagina=1&imp=1", "01|03|04|05|06|07"]; /* |08*/
menu[15] = ["Cambio Paciente", pathLOCAL + "servlet/GestorPacientes?OPCION=0", "01|02|03|04|05|06|07|08"];
//precargamos las imagenes
//if (document.images) {
//bullets del menu de la izq
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
//}
var stContenedor = (document.layers)?"contenedorMenu.document.":"";
var esCargado = false;
var ponImgs = false;
var iContador = 0;
window.onload = Cargado;
function Cargado(){
esCargado = true;
}
// pNG --> perfilNavegacionGestion puede ser | 01 | 02 | 03 |
//Función que determina si se escribe una opción de menú
//strAcceso debe contener las opciones de acceso de la opción
//a escribir (el tercer parámetro cuando se declaran las opciones).
//**** IR CONSTRUYENDO EL IF PARA LUEGO HACER UN EVAL ****
//EJ: Si strAcceso fuese |05|01&T2|
//El resultado seráa un eval de la cadena:
//((pNG.indexOf("05")) || ((pNG.indexOf("01")) && (pNG.indexOf("T2")))
function tiene(churroOpciones,condicion){
if (churroOpciones.indexOf("|"+condicion+"|")>=0)
return true;
else
return false;
}
function notiene(churroOpciones,condicion){
condicion=condicion.substring(1, condicion.length);
if (churroOpciones.indexOf("|"+condicion+"|")<0)
return true;
else
return false;
}
function escribirOpcionMenu(strAcceso){
var resultado = true;
var strCadenaBooleana = "";
//Troceamos el churro de accesos
var strVectorAcceso = strAcceso.split("|");
for (var i=0; i<strVectorAcceso.length; i++)
{
var strOpcion = strVectorAcceso[i];
if (i!=0)
strCadenaBooleana = strCadenaBooleana + " || ";
if (strOpcion.indexOf("&") > -1)
{
var strSubVectorAcceso2 = strOpcion.split("&");
var booPrimeraEntradaY = true;
strCadenaBooleana = strCadenaBooleana + " (";
for (var j=0;j<strSubVectorAcceso2.length;j++)
{
strOpcion = strSubVectorAcceso2[j];
if (j!=0)
strCadenaBooleana = strCadenaBooleana + " && ";
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
strCadenaBooleana = strCadenaBooleana + ") ";
}
else
{
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
}
if (strCadenaBooleana.length > 0)
resultado = eval(strCadenaBooleana);
else
resultado = false;
return resultado;
}
function construirMenuGst(){
/*var separador = '<tr valign="top"><td colspan="2"><img src="' + './img/sp.gif" width="1" height="8" border="0"></td></tr>';*/
var separador = '<tr valign="top"><td colspan="2"><img src="' + pathLOCAL + '/img/sp.gif" width="1" height="8" border="0"></td></tr>';
var stOpcion = '<table cellpadding="0" cellspacing="0" border="0" width="165">\n';
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if (i==x){
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuOnSelect"><img src="' + './img/sp.gif" name="bullet' + i + '" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname){
stOpcion += ' <td width="150" class="menuOnSelect"><a href="javascript:reescribirMenuGst('+i+');" class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
}else
stOpcion += ' <td width="150" class="menuOnSelect"><a href=' + menu[i][1] +' class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
stOpcion += "</td></tr>" + separador;
}
else {
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuBack"><img src="' + './img/sp.gif" name="bullet' + i +'" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname)
stOpcion += " <td width='150' class='menuBack'><a href=\"javascript:reescribirMenuGst("+i+");\" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
else
stOpcion += " <td width='150' class='menuBack'><a href=" + menu[i][1] +" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
stOpcion += "</td></tr>" + separador;
}
}
}
stOpcion += "</table>";
return stOpcion;
}
function escribirMenuGst(){
var stCapaMenu = (document.layers)?'<div id="contenedorMenu" style="position:relative;top:0px;left:0px;">\n\n':'<div id="contenedorMenu">\n\n';
stCapaMenu += (document.layers)?'<img src="/img/gen_bullet_cerrado.gif" width="165" height="1">':construirMenuGst();
stCapaMenu += '</div>';
document.write(stCapaMenu);
//hacemos un retardo si navega con un ie 4.x
if (document.all && navigator.appVersion.indexOf("MSIE 4.")>=0 )
setTimeout('reescribirMenuGst(x,y)',5800);
else
reescribirMenuGst(x,y);
}
function reescribirMenuGst(k,j){
x = k;
if((j<0) ||(j==null))
y = null;
else
y = j;
var stMenuDesplegado = "";
if (document.layers) {
if(document.contenedorMenu){
stMenuDesplegado = construirMenuGst();
document.layers["contenedorMenu"].document.open();
stHTML = '<layer top="0" left="0">'+stMenuDesplegado+'</layer>';
if(esCargado){
document.layers["contenedorMenu"].document.write(stHTML);
ponImgs = true;
}
document.layers["contenedorMenu"].document.close();
if(!esCargado){
iContador +=1;
if(iContador > 10)
esCargado = true;
setTimeout('reescribirMenuGst(x,y)',800);
}
}
else
setTimeout('reescribirMenuGst(x,y)',800);
}
else if (document.all) {
stMenuDesplegado = construirMenuGst();
document.all["contenedorMenu"].innerHTML = stMenuDesplegado;
ponImgs = true;
}
else if (document.getElementById) {
stMenuDesplegado = construirMenuGst();
document.getElementById("contenedorMenu").innerHTML = stMenuDesplegado;
ponImgs = true;
}
if(ponImgs){
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if(i==x){
if (y<0 || y==null)
cambiar("bullet" + i,"bulletSelect");
else
cambiar("bullet" + i,"bulletAbierto");
/*if (!(subMenu[x]==null))
{
for (j=0 ; j<subMenu[x].length; j++)
{
if (escribirOpcionMenu(subMenu[x][j][2]))
{
if (j==y)
{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletSelect");
}
else{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletCerrado");
}
}
}
}*/
}
else
cambiar("bullet" + i,"bulletCerrado");
}
}
}
}
+276
View File
@@ -0,0 +1,276 @@
// ******************************************
// Cargamos las opciones del menu en un ARRAY
// ******************************************
// Inicializar las variables para la funci&oacute;n generaPath
var ADMINISTRADOR = "00";
var CABECERA = "01";
var ANALISTA = "02";
var ESPECIALISTA = "03";
var REHABPOD = "04";
var ATS = "05";
var ESTOMA = "06";
setCookie( "SECCION",SECCION_PACIENTES);
// el 1er parametro es el texto que se muestra
// el 2o parametro es la URL a la que va el link
// el 3er parametro son los perfiles que admite esa opcion
// escribimos el 1er nivel de navegacion
var menu = new Array();
// Gestion pacientes
menu[0] = ["Facturaci&oacute;n", pathLOCAL + "jsp/pac/facturacion_iguala.jsp", "01|03"];
menu[1] = ["Autorizaci&oacute;n", pathLOCAL + "jsp/pac/autorizacion.jsp?x=1&pagina=1", "01|03"];
menu[2] = ["Anal&iacute;tica", pathLOCAL + "jsp/pac/analitica.jsp?x=2", "01|03"];
menu[3] = ["Radiodiagn&oacute;stico", pathLOCAL + "jsp/pac/diagnostico.jsp?x=3", "01|03"];
menu[4] = ["Otras Peticiones", pathLOCAL + "jsp/pac/especialidades.jsp?x=4&pagina=1", "01|03"];
menu[5] = ["Recetas", pathLOCAL + "jsp/pac/recetas.jsp?x=5&pagina=1", "01|03"];
menu[6] = ["Historial de Paciente", pathLOCAL + "jsp/pac/historia.jsp?x=6&pagina=1", "01|03"];
menu[7] = ["Analista", pathLOCAL + "jsp/pac/analista.jsp?x=7", "02"];
menu[8] = ["Cambio Paciente", pathLOCAL + "servlet/GestorPacientes?OPCION=0", "01|02|03"];
//precargamos las imagenes
//if (document.images) {
//bullets del menu de la izq
var bulletAbierto = new Image(); bulletAbierto.src = pathLOCAL+"img/gen_bullet_abierto.gif";
var bulletActivo = new Image(); bulletActivo.src = pathLOCAL+"img/gen_bullet_activo.gif";
var bulletCerrado = new Image(); bulletCerrado.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
var bulletSelect = new Image(); bulletSelect.src = pathLOCAL+"img/gen_bullet_select.gif";
var pbullet = new Image(); pbullet.src = pathLOCAL+"img/gen_bullet_cerrado.gif";
//}
var stContenedor = (document.layers)?"contenedorMenu.document.":"";
var esCargado = false;
var ponImgs = false;
var iContador = 0;
window.onload = Cargado;
function Cargado(){
esCargado = true;
}
// pNG --> perfilNavegacionGestion puede ser | 01 | 02 | 03 |
//Funci&oacute;n que determina si se escribe una opci&oacute;n de menú
//strAcceso debe contener las opciones de acceso de la opci&oacute;n
//a escribir (el tercer parámetro cuando se declaran las opciones).
//**** IR CONSTRUYENDO EL IF PARA LUEGO HACER UN EVAL ****
//EJ: Si strAcceso fuese |05|01&T2|
//El resultado seráa un eval de la cadena:
//((pNG.indexOf("05")) || ((pNG.indexOf("01")) && (pNG.indexOf("T2")))
function tiene(churroOpciones,condicion){
if (churroOpciones.indexOf("|"+condicion+"|")>=0)
return true;
else
return false;
}
function notiene(churroOpciones,condicion){
condicion=condicion.substring(1, condicion.length);
if (churroOpciones.indexOf("|"+condicion+"|")<0)
return true;
else
return false;
}
function escribirOpcionMenu(strAcceso){
var resultado = true;
var strCadenaBooleana = "";
//Troceamos el churro de accesos
var strVectorAcceso = strAcceso.split("|");
for (var i=0; i<strVectorAcceso.length; i++)
{
var strOpcion = strVectorAcceso[i];
if (i!=0)
strCadenaBooleana = strCadenaBooleana + " || ";
if (strOpcion.indexOf("&") > -1)
{
var strSubVectorAcceso2 = strOpcion.split("&");
var booPrimeraEntradaY = true;
strCadenaBooleana = strCadenaBooleana + " (";
for (var j=0;j<strSubVectorAcceso2.length;j++)
{
strOpcion = strSubVectorAcceso2[j];
if (j!=0)
strCadenaBooleana = strCadenaBooleana + " && ";
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
strCadenaBooleana = strCadenaBooleana + ") ";
}
else
{
if (strOpcion.substring(0, 1) == "!")
strCadenaBooleana = strCadenaBooleana + "no";
strCadenaBooleana = strCadenaBooleana + "tiene(pNG,'"+ strOpcion + "')";
}
}
if (strCadenaBooleana.length > 0)
resultado = eval(strCadenaBooleana);
else
resultado = false;
return resultado;
}
function construirMenuGst(){
var separador = '<tr valign="top"><td colspan="2"><img src="' + './img/sp.gif" width="1" height="8" border="0"></td></tr>';
var stOpcion = '<table cellpadding="0" cellspacing="0" border="0" width="165">\n';
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if (i==x){
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuOnSelect"><img src="' + './img/sp.gif" name="bullet' + i + '" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname){
stOpcion += ' <td width="150" class="menuOnSelect"><a href="javascript:reescribirMenuGst('+i+');" class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
}else
stOpcion += ' <td width="150" class="menuOnSelect"><a href=' + menu[i][1] +' class="menuOnSelect" onMouseOver="self.status=\''+ menu[i][0].toUpperCase() +'\';return true;" onMouseOut="self.status=\'\';return true;"><b>' + menu[i][0].toUpperCase() + '</b></a><br>\n';
stOpcion += "</td></tr>" + separador;
}
else {
if (menu[i][1].indexOf("x=")>-1)
parametros = "";
else
parametros = "?x="+i;
stOpcion += '<tr valign="top">';
stOpcion += ' <td width="16" class="menuBack"><img src="' + './img/sp.gif" name="bullet' + i +'" width="16" height="12" border="0"></td>\n';
if(menu[i][1]==location.pathname)
stOpcion += " <td width='150' class='menuBack'><a href=\"javascript:reescribirMenuGst("+i+");\" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
else
stOpcion += " <td width='150' class='menuBack'><a href=" + menu[i][1] +" onMouseOver=\"cambiar('bullet" + i +"','bulletActivo');self.status='"+menu[i][0].toUpperCase()+"'; return true;\" onMouseOut=\"cambiar('bullet" + i +"','bulletCerrado');self.status=''; return true;\" class=\"menuOff\"><b>" + menu[i][0].toUpperCase() + "</b></a>";
stOpcion += "</td></tr>" + separador;
}
}
}
stOpcion += "</table>";
return stOpcion;
}
function escribirMenuGst(){
var stCapaMenu = (document.layers)?'<div id="contenedorMenu" style="position:relative;top:0px;left:0px;">\n\n':'<div id="contenedorMenu">\n\n';
stCapaMenu += (document.layers)?'<img src="/img/gen_bullet_cerrado.gif" width="165" height="1">':construirMenuGst();
stCapaMenu += '</div>';
document.write(stCapaMenu);
//hacemos un retardo si navega con un ie 4.x
if (document.all && navigator.appVersion.indexOf("MSIE 4.")>=0 )
setTimeout('reescribirMenuGst(x,y)',5800);
else
reescribirMenuGst(x,y);
}
function reescribirMenuGst(k,j){
x = k;
if((j<0) ||(j==null))
y = null;
else
y = j;
var stMenuDesplegado = "";
if (document.layers) {
if(document.contenedorMenu){
stMenuDesplegado = construirMenuGst();
document.layers["contenedorMenu"].document.open();
stHTML = '<layer top="0" left="0">'+stMenuDesplegado+'</layer>';
if(esCargado){
document.layers["contenedorMenu"].document.write(stHTML);
ponImgs = true;
}
document.layers["contenedorMenu"].document.close();
if(!esCargado){
iContador +=1;
if(iContador > 10)
esCargado = true;
setTimeout('reescribirMenuGst(x,y)',800);
}
}
else
setTimeout('reescribirMenuGst(x,y)',800);
}
else if (document.all) {
stMenuDesplegado = construirMenuGst();
document.all["contenedorMenu"].innerHTML = stMenuDesplegado;
ponImgs = true;
}
else if (document.getElementById) {
stMenuDesplegado = construirMenuGst();
document.getElementById("contenedorMenu").innerHTML = stMenuDesplegado;
ponImgs = true;
}
if(ponImgs){
for (i=0 ; i<menu.length; i++){
if ( escribirOpcionMenu(menu[i][2]) ){
if(i==x){
if (y<0 || y==null)
cambiar("bullet" + i,"bulletSelect");
else
cambiar("bullet" + i,"bulletAbierto");
/*if (!(subMenu[x]==null))
{
for (j=0 ; j<subMenu[x].length; j++)
{
if (escribirOpcionMenu(subMenu[x][j][2]))
{
if (j==y)
{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletSelect");
}
else{
cambiar("pbullet" + i +j,"pbullet");
cambiar("sbullet" + i +j,"bulletCerrado");
}
}
}
}*/
}
else
cambiar("bullet" + i,"bulletCerrado");
}
}
}
}
+195
View File
@@ -0,0 +1,195 @@
<%@ page import="java.net.*" %>
<%@ page import="java.io.*" %>
<%@ page import="org.xml.sax.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.security.MessageDigest" %>
<%@ page import="java.security.NoSuchAlgorithmException" %>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="com.tarisan.control.*" %>
<%@ page import="com.tarisan.data.*" %>
<%@ page import="com.tarisan.excepcion.*" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.math.BigDecimal"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
<%
LogTarisan.logger.log(NivelLog.INFO, "Inicio página de resultados analitica (resultado_analitica.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(request.getContextPath() + "/html/login.html");
}
else
{
%>
<%!
static StringBuffer hexValue(byte[] buffer) {
StringBuffer sbRet=new StringBuffer(buffer.length*2);
for (int i=0; i<buffer.length; i++) {
// note: & 0xff is used to reset high bits
if ((buffer[i]>=0)&&(buffer[i]<=15)) sbRet.append("0"+Integer.toHexString(buffer[i]&0xff));
else sbRet.append(Integer.toHexString(buffer[i]&0xff));
}
return sbRet;
}
static String Encrypt(String pPlainPassword)
{
StringBuffer hexHashedPassword;
try
{
if (pPlainPassword==null) hexHashedPassword=null;
else
{
MessageDigest hash = MessageDigest.getInstance("MD5");
hash.update(pPlainPassword.getBytes());
hexHashedPassword = hexValue(hash.digest());
}
} catch (NoSuchAlgorithmException ex) {
hexHashedPassword=null;
}
return hexHashedPassword.toString() ;
}
static String crypt_txt(String en, String clau, String func)
{
String m = "";
char c = 'a';
if (en==null) return null;
if (en.length()==0) return "";
if (clau.compareTo("NOENCRPT") == 0) return en;
if (clau.compareTo("") == 0) clau = "iN3a1Abh";
if (func.compareTo("XE") == 0)
{
// Encriptar...
StringBuffer sbRet=new StringBuffer(en.length()*2);
int j=(-1);
char xor_val;
for (int i=0; i<en.length(); i++)
{
j = j + 1;
if (j >= clau.length()) j = 0;
xor_val = (char) ((int)en.charAt(i) ^ (int)clau.charAt(j));
// note: & 0xff is used to reset high bits
if ((xor_val>=0)&&(xor_val<=15)) sbRet.append("0"+Integer.toHexString(xor_val&0xff));
else sbRet.append(Integer.toHexString(xor_val&0xff));
}
m = sbRet.toString();
}
if (func.compareTo("XD") == 0)
{
// Desencriptar...
StringBuffer stringd=new StringBuffer(en.length()/2);
int j=(-1);
for (int i=0;i<en.length()/2;i++)
{
j = j + 1;
if (j >= clau.length()) j = 0;
if (en.substring(i*2,(i*2)+2).compareTo("ZZ") == 0) j = (-1);
else{
c=(char)(Integer.parseInt(en.substring(i*2,(i*2)+2),16)^(int)clau.charAt(j));
stringd.append(c);
}
}
m = stringd.toString();
}
return m;
}
%>
<%
/* PARAMETROS NECESARIOS PARA LA COMUNICACIÓN CON EL PROGRAMA INTRALAB INSTALADO EN LA 192.168.2.166 DE IZASA */
int campobusqueda=0;
String FiltroIntralab="";
String IntralabMaxReport="10";
String IntralabReportFormat="1";
String AccesLevel="8";
String TecnicalValidation="N";
String mydate="";
String mynumber=request.getParameter("peticion");
String mytipo="individual";
String isAcumulado="NO";
Socket miCliente;
DataInputStream entrada;
DataOutputStream salida;
String recibido,liniarecibida,liniasalida,aux;
Document document;
recibido=new String("");
try
{
/**** PETICIÓN POR EL NÚMERO PARA OBTENER LA FECHA DE REALIZACIÓN DE IZASA *******************************************/
/**** ABRIMOS DE NUEVO UN SOCKET PARA COMUNICACIÓN IZASA ***************************************************/
miCliente = new Socket ("192.168.2.166", 8080);
entrada = new DataInputStream(miCliente.getInputStream() );
salida = new DataOutputStream(miCliente.getOutputStream() );
liniasalida="<LIKENUMBER NUMBER='"+mynumber+"' FILTER='"+FiltroIntralab+"' USER='"+ "admin" + "' IPADDR='"+request.getRemoteAddr()+"' />";
salida.writeBytes(crypt_txt(liniasalida,"","XE"));
while (null != ((liniarecibida = crypt_txt(entrada.readLine(),"","XD"))))
{
recibido = recibido +liniarecibida+"\n";
}
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document=builder.parse(new ByteArrayInputStream(recibido.getBytes()));
NodeList nl=document.getElementsByTagName("PATIENT");
if (nl.getLength()>0)
{
mydate = (String)nl.item(0).getAttributes().getNamedItem("DATE").getNodeValue();
}
entrada.close();
salida.close();
/**** FIN PETICIÓN POR EL NÚMERO PARA OBTENER LA FECHA DE REALIZACIÓN DE IZASA *******************************************/
/**** ABRIMOS DE NUEVO UN SOCKET PARA COMUNICACIÓN IZASA ***************************************************/
/**** INICIO PETICIÓN DEFINITIVA ****/
miCliente = new Socket ("192.168.2.166", 8080);
entrada = new DataInputStream(miCliente.getInputStream() );
salida = new DataOutputStream(miCliente.getOutputStream() );
liniasalida="<REPORT DATE='"+mydate+"' NUMBER='"+mynumber+"' ACCUMULATED='"+isAcumulado+"' USER='"+"admin"+"' MAXREPORT='"+IntralabMaxReport+"' FORMAT='"+IntralabReportFormat+"' ACCESLEVEL='"+AccesLevel+"' TECNICALVALIDATION='"+TecnicalValidation+"' FILTER='"+FiltroIntralab+"' IPADDR='"+request.getRemoteAddr()+"' />";
salida.writeBytes(crypt_txt(liniasalida,"","XE"));
while (null != ((liniarecibida = crypt_txt(entrada.readLine(),"","XD"))))
{
recibido = recibido +liniarecibida+"\n";
}
entrada.close();
salida.close();
if (recibido.compareTo("<ERROR='Error to Print'/>\n")==0)
{
response.sendRedirect("lab_informe_vacio.jsp");
return;
}
aux = recibido.replaceAll("á", "&aacute;");
aux = aux.replaceAll("é", "&eacute;");
aux = aux.replaceAll("í", "&iacute;");
aux = aux.replaceAll("ó", "&oacute;");
aux = aux.replaceAll("ú", "&uacute;");
aux = aux.replaceAll("º", "&ordm;");
out.println(aux);
}
catch( IOException e )
{
response.sendRedirect("default.jsp");
return;
}
}
LogTarisan.logger.log(NivelLog.INFO, "Fin página de resultados analitica (resultado_analitica.jsp)");
%>
+51
View File
@@ -0,0 +1,51 @@
<%@ page import="com.tarisan.control.ParametrosConfiguracion" %>
<%@ page import="com.tarisan.log.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Vector" %>
<HTML>
<BODY>
<%
SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd 'de' MMMM 'de' yyyy',' HH:mm:ss");
Calendar calendario = Calendar.getInstance();
out.print("<hr>");
out.print("Fecha = " + sdf.format(calendario.getTime()));
out.print("<hr>");
out.println("<br>");
out.println("<b>PAR&Aacute;METROS DE LOGS DE LA APLICACI&Oacute;N</b><br>");
out.println("<font size=-1><ul>" );
out.print("<li><b>Nivel de LOG: </b>");
out.print(LogTarisan.getNivel());
out.println("</li>");
out.print("<li><b>Path del fichero: </b>");
out.print(LogTarisan.getPathFichero());
out.println("</li>");
out.print("<li><b>Nombre del fichero: </b>");
out.print(LogTarisan.getNombreFichero());
out.println("</li>");
out.print("<li><b>N&uacute;mero de ficheros: </b>");
out.print(LogTarisan.getNumeroFicheros());
out.println("</li>");
out.print("<li><b>Tama&ntilde;o del fichero: </b>");
out.print(LogTarisan.getTamanoFichero());
out.println("</li>");
out.println("</font></ul>" );
%>
</BODY>
</HTML>
+172
View File
@@ -0,0 +1,172 @@
<%@ page import="com.tarisan.control.ParametrosConfiguracion" %>
<%@ page import="com.tarisan.excepcion.ExcepcionTarisan" %>
<%@ page import="com.tarisan.persistencia.PersistenciaParametros" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Enumeration" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Vector" %>
<HTML>
<BODY>
<%
SimpleDateFormat sdf = new SimpleDateFormat("EEEE dd 'de' MMMM 'de' yyyy',' HH:mm:ss");
Calendar calendario = Calendar.getInstance();
Connection conexion = null;
String sqlSelect = "SELECT MEDICO, NOMBRE, APELLIDOS FROM TAMEDICO";
out.println("<hr>");
out.println("Fecha = " + sdf.format(calendario.getTime()));
out.println("<hr>");
out.println("<br>");
out.println("<b>PAR&Aacute;METROS DE LA BASE DE DATOS</b><br>");
out.println("<font size=-1><ul>" );
out.print("<li><b>Data Store de base de datos: </b>");
out.print(ParametrosConfiguracion.dataStore);
out.println("</li>");
out.print("<li><b>Usuario: </b>");
out.print(PersistenciaParametros.usuario);
out.println("</li>");
out.print("<li><b>Password: </b>");
out.print(PersistenciaParametros.password);
out.println("</li>");
out.print("<li><b>Maquina: </b>");
out.print(PersistenciaParametros.maquina);
out.println("</li>");
out.print("<li><b>Puerto: </b>");
out.print(PersistenciaParametros.puerto);
out.println("</li>");
out.print("<li><b>Instancia: </b>");
out.print(PersistenciaParametros.instancia);
out.println("</li>");
out.print("<li><b>Nombre del Data Source: </b>");
out.print(PersistenciaParametros.dataSource);
out.println("</li>");
out.println("</font></ul>" );
out.println("<hr>" );
out.println("<b>PROPIEDADES DE LA BASE DE DATOS</b><br>");
try
{
out.println("<font size=-1><ul>" );
conexion = ParametrosConfiguracion.dataStore.obtenerConexion();
DatabaseMetaData bd = conexion.getMetaData();
out.print("<li><b>Nombre BD: </b>");
out.print(bd.getDatabaseProductName());
out.println("</li>");
out.print("<li><b>Versi&oacute;n BD: </b>");
out.print(bd.getDatabaseProductVersion());
out.println("</li>");
out.print("<li><b>Usuario: </b>");
out.print(bd.getUserName());
out.println("</li>");
out.print("<li><b>Cadena de conexi&oacute;n: </b>");
out.print(bd.getURL());
out.println("</li>");
out.print("<li><b>Nombre del driver: </b>");
out.print(bd.getDriverName());
out.println("</li>");
out.print("<li><b>Versi&oacute;n del driver: </b>");
out.print(bd.getDriverVersion());
out.println("</li>");
out.println("</font></ul>" );
out.println("<hr>" );
out.println("<b>PRUEBA DE SELECCI&Oacute;N EN LA BASE DE DATOS</b><br>");
out.println("<font size=-1><ul>" );
out.print("<li><b>Conexión: </b>");
out.print(conexion);
out.println("</li>");
if(conexion != null)
{
out.print("<li><b>Sentencia SQL: </b>");
out.print(sqlSelect);
out.println("</li>");
PreparedStatement ps = conexion.prepareStatement(sqlSelect);
out.print("<li><b>PreparedStatement: </b>");
out.print(ps);
out.println("</li>");
ResultSet rs = ps.executeQuery();
out.print("<li><b>ResultSet: </b>");
out.print(rs);
out.println("</li>");
out.println("<ul>");
while(rs.next())
{
out.print("<li><b>");
out.print(rs.getLong(1));
out.print("</b>: ");
out.print(rs.getString(2));
out.print(" ");
out.print(rs.getString(3));
out.println("</li>");
}
out.println("</ul>");
rs.close();
out.println("<li><b>ResultSet cerrado: </b>");
out.println(rs);
out.println("</li>");
ParametrosConfiguracion.dataStore.liberarConexion(conexion);
out.print("<li><b>Conexión liberada: </b>");
out.print(conexion);
out.println("</li>");
}
}
catch(ExcepcionTarisan sqle)
{
out.print("<li><b>ExcepcionTarisan: </b>");
out.print(sqle);
out.println("</li>");
}
catch(SQLException sqle)
{
out.print("<li><b>SQLException: </b>");
out.print(sqle);
out.println("</li>");
}
catch(Exception sqle)
{
out.print("<li><b>Exception: </b>");
out.print(sqle);
out.println("</li>");
}
catch(Throwable sqle)
{
out.print("<li><b>Throwable: </b>");
out.print(sqle);
out.println("</li>");
}
out.println("</font></ul>" );
%>
</BODY>
</HTML>
+46
View File
@@ -0,0 +1,46 @@
<%@ 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" %>
<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" 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");
}
//-->
</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>
Analisis
<a href="javascript:window.open('https://192.168.2.69:8080/tarisan/jsp/resultado_analitica.jsp','Imprimir','width=300,height=120,left=150,top=100,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,toolbar=no,directories=no');">Analisisssssssss</a>
</body>
</html>