Está en la página 1de 5

<%

'******************************************************************************
'* Programa: PersonasBuscar02.asp *
'* Objetivo: P�gina que permite consultar la lista de personas registradas en *
'* la base de datos, tabla Personas1. *
'* *
'* Ventana: Esta ventana debe ser vista en 300x400 *
'* *
'******************************************************************************

Option explicit
Dim XConexion1, XConjunto1, XConjunto2
Dim XOpcion, XOpcionD, XUsuario1, XNombreUsuario1, XTipoUsuario1
Dim I, XEncontradoU, SentenciaSQL
Dim XMensajeError, XOrdenBy, XInicio
Dim XABuscar, XWhere, XOrigen, XTopN

Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "Pragma", "No-cache"
Response.cachecontrol="private"

XUsuario1 = Session("ZUsuario")
XNombreUsuario1 = Session("ZNombreUsuario")
XTipoUsuario1 = Session("ZTipoUsuario1")

Session("ZMensajeError") = ""
XOrdenBy = Session("ZOrdenBy")
XABuscar = Request.QueryString("ABuscar")
XOrigen = Request.QueryString("Origen")
XOpcion = Request.QueryString("Opcion")

if isNumeric(MID(XABuscar,2,Len(XABuscar))) then
XWhere = " AND PersonaID = '" & UCase(MID(XABuscar,1,1)) &
FormatoEnteros(MID(XABuscar,2,Len(XABuscar)),"0000000000") & "' "
XABuscar = UCase(MID(XABuscar,1,1)) &
FormatoEnteros(MID(XABuscar,2,Len(XABuscar)),"0000000000")
else
if XABuscar <> "" then
XWhere = " AND Lower(NombreCompleto) LIKE Lower('%" & XABuscar & "%') "
XTopN = " "
else
XTopN = " LIMIT 15 "
XWhere = " "
end if
end if

I = 0

if XOrdenBy <> "PersonaID" and XOrdenBy <> "NombreCompleto" then


XOrdenBy = "NombreCompleto"
end if

Set XConexion1 = Server.CreateObject("ADODB.Connection")


XConexion1.Open Session("ZODBCNombre"), Session("ZUsuario"), Session("ZPassword")

Set XConjunto1 = Server.CreateObject("ADODB.RecordSet")


SentenciaSQL = "SELECT Polizas1.PolizaNro AS PolizaNro, AseguradoNro,
AseguradoID, NombreCompleto, " &_
"AseguradoStatus, PolizaStatus, CubreFamiliares,
ContratoAlias " &_
"FROM Asegurados1, Personas1, Polizas1 " &_
"WHERE PersonaID=AseguradoID AND " &_
"Polizas1.PolizaNro=Asegurados1.PolizaNro " & XWhere &_
"ORDER BY " & XOrdenBy & XTopN
' Response.Write SentenciaSQL

XConjunto1.Open SentenciaSQL, XConexion1


%>
<!--#include file="FormatoEnteros01.vs" -->
<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<meta http-equiv="PICS-Label" content='AlfaDos'>
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta name="Author" content="alfados.com">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta NAME="KEYWORDS" CONTENT="Software servicio funerario;">
<meta NAME="DESCRIPTION" CONTENT="AlfaDos">

<title><%=Session("ZOrganizacion1")%>: <%=Session("ZNombreInstancia")%></title>

</head>

<script language="JavaScript">
var Numero = 0;
var Origen='<%=XOrigen%>';

function ayuda(pag)

{window.open(pag,"","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,
resizable=yes,width=380,height=400");}

function CerrarVentana()
{window.close();}

function SeleccionarPersona(CedulaL, CedulaN, NombreCompleto, PolizaNro,


AseguradoNro) {
var Parametro = 'CedulaL='+CedulaL + '&CedulaN='+CedulaN +
'&PolizaNro='+PolizaNro + '&AseguradoNro='+AseguradoNro + '&Origen='+Origen+
'&Opcion=<%=XOpcion%>';
window.location.replace("PersonasBuscar03.asp?" + Parametro);
}

function BuscarUsuarios1(Entrada2) {
var Parametro = 'ABuscar=' + Entrada2.ABuscar.value + '&Origen=' + Origen;
window.location.replace("PersonasBuscar02.asp?" + Parametro);
}
</script>

<body text="#000000" link="#000066" vlink="#330000" alink="#993300" topmargin="2">

<!-- INICIO TABLA PRINCIPAL -->


<center>
<table BORDER="0" CELLSPACING="0" cellpadding="1" WIDTH="540"
bordercolor="DarkBlue">
<tr>
<td width="540" align=right>
<table border="0" cellspacing="0" cellpadding="0">
<tr height=20>
<td width=360 align=left>
<font style="font-family:Arial; font-size:14pt" color=MediumBlue>Consulta de
Titulares</font>
</td>
<form name="Entrada2" method="post">
<td align=right width=180 valign=bottom>
<font style="font-family:Arial; font-size:9pt" color="MediumBlue">
Buscar:
</font>
<input NAME="ABuscar" value="<%=XABuscar%>" SIZE="15" MAXLENGTH="20"
style="font-size:9pt" title="Parte del nombre a buscar">
<input type="button" value=">>>" name="accion1"
onclick="JavaScript:BuscarUsuarios1(Entrada2);" style="font-size:9pt" title="Pulse
para iniciar la busqueda">
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
</center>

<center>
<table BORDER="1" CELLSPACING="0" CELLPADDING="1" WIDTH="540" bordercolor="<
%=Session("ZBordeForma1")%>" style="border-collapse:collapse" background="<
%=Session("ZFondoForma1")%>">
<tr height=22 valign="top">
<td height=22>
<table border="0" cellspacing="0" width=540 height=22>
<tr height=22>
<td width="15%" bgcolor=Yellow>
<font face="arial" color="#9932cc" style="font-size:10pt">C�dula/RIF</font>
</td>
<td width="50%" bgcolor=Yellow>
<font face="arial" color="#9932cc" style="font-size:10pt">Nombre</font>
</td>
<td width="20%" bgcolor=Yellow>
<font face="arial" color="#9932cc" style="font-size:10pt">Contratante</font>
</td>
<td width="10%" bgcolor=Yellow>
<font face="arial" color="#9932cc" style="font-size:10pt">Familiares<font>
</td>
</tr>
</table>
</td>
</tr>

<tr height=20>
<td valign="top" height=20>
<table border="0" cellspacing="0" width=540 height=20>
<% Do While Not XConjunto1.EOF %>
<tr height=20>
<td width="15%">
<font style="font-family:Arial;font-size:9pt;color:#000060">
<% if (XConjunto1("AseguradoStatus")<>"IN" and
XConjunto1("PolizaStatus")<>"TE") then %>
<a href="javascript:SeleccionarPersona('<
%=MID(XConjunto1("AseguradoID"),1,1)%>', '<
%=MID(XConjunto1("AseguradoID"),2,Len(XConjunto1("AseguradoID")))%>', '<
%=XConjunto1("NombreCompleto")%>', '<%=XConjunto1("PolizaNro")%>', '<
%=XConjunto1("AseguradoNro")%>');">
<%=XConjunto1("AseguradoID")%>
</a>
<% else %>
<label title="Titular no puede ser seleccionado, se encuentra inactivo">
<%=XConjunto1("AseguradoID")%>
</label>
<% end if %>
</font>
</td>
<td width="50%">
<font style="font-family:Arial;font-size:9pt;color:#000060">
<% if (XConjunto1("AseguradoStatus")<>"IN" and
XConjunto1("PolizaStatus")<>"TE") then %>
<a href="javascript:SeleccionarPersona('<
%=MID(XConjunto1("AseguradoID"),1,1)%>', '<
%=MID(XConjunto1("AseguradoID"),2,Len(XConjunto1("AseguradoID")))%>', '<
%=XConjunto1("NombreCompleto")%>', '<%=XConjunto1("PolizaNro")%>', '<
%=XConjunto1("AseguradoNro")%>');">
<%=XConjunto1("NombreCompleto")%>
</a>
<% else %>
<label title="Titular no puede ser seleccionado, se encuentra inactivo">
<%=XConjunto1("NombreCompleto")%>
</label>
<% end if %>
</font>
</td>
<td width="20%">
<font face="arial" color="#000060" style="font-family:Arial;font-size:9pt;"
title="Contrato Nro:<%=FormatoEnteros(XConjunto1("PolizaNro"),"000000")%>"><
%=XConjunto1("ContratoAlias")%></font>
</td>
<td width="10%" align=center>
<font style="font-family:Arial;font-size:9pt;color:#000060">
<%=XConjunto1("CubreFamiliares")%>
</font>
</td>
</tr>
<% XConjunto1.MoveNext %>
<% Loop %>
<%
XConjunto1.Close
XConexion1.Close
%>
<tr height=30 align=center valign=middle>
<td colspan="3">
<p>
<input type="button" value="Cerrar" name="Accion2"
onclick="CerrarVentana();" style="font-size:9pt" title="Pulse para abandonar esta
ventana">
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<!-- FIN TABLA PRINCIPAL -->

<center>
<table BORDER="0" WIDTH="80%">
<tr>
<td align="center">
<font face="Arial" style="font-size:7pt">Desarrollado por Alfados</font>
</td>
</tr>
</table>
</center>

</body>
</html>

<script language="JavaScript">
window.document.Entrada2.ABuscar.focus();
window.status = 'PersonasBuscar02.asp';
<% if XMensajeError <> "" then %>
alert('<%=XMensajeError%>')
<% XMensajeError = "" %>
<% end if %>
</script>

También podría gustarte