[an error occurred while processing this directive]
[an error occurred while processing this directive]
<%
'_______TITULO DE PAGINA_____________________
Dim title
'_______EL PAGINADO BUSQUEDA DEBE SER MULTIPLO DE TRES____________________________________________________________________
PaginadoBusqueda=5
'____________________________________________________________
PaginadoApartamentos=5
if cookieidioma=1 then%>
"" then%>left<%else%>center<%end if%>"rowspan="2" valign="top" bgcolor="#FFFFFF">
<%end if%>
<%
dim IdZona, IdAmbiente, IdDisponibilidad
dim capacidad, Zona, Disponibilidad
dim RsBuscar
if Request.Querystring("Accion")&"" = "Buscar" then
session("strdesde")=""
session("strhasta")=""
end if
IdAmbiente=Request.form("CboCapacidad")
IdZona=Request.form("CboZona")
if IdAmbiente&""="" then
idambiente=null
end if
if IdAmbiente=4 then
IdAmbiente= null
end if
if IdZona="0" then
IdZona= null
end if
if request.QueryString("Cod")<>"" then
IdZona=request.QueryString("Cod")
end if
'__El CBOCAPACIDAD TIENE VALUES DESDE 4____________________________
if IdAmbiente ="4" then
IdAmbiente= null
end if
strDesde= request.Form("HideDesde") & ""
strHasta= request.Form("HideHasta") & ""
strVer= request.Form("cboMostrar") & ""
'response.write("HOLSADKLFKAFHFKAHJDSFLHJDSFDSA")
if strDesde&""="" then
strDesde=session("strDesde")
end if
if strHasta&""="" then
strHasta=session("strHasta")
end if
if strVer&""="" then
strver=session("strver")
end if
if Request.Querystring("Accion")="Buscar" then
session("strDesde")=strDesde
session("strHasta")=StrHasta
session("strver")=strVer
end if
'______PARA EL RESULTADO BUSQUEDA________________________________________________________________________________________
Dim IdAmbienteBusqueda, IdZonaBusqueda
IdAmbienteBusqueda=IdAmbiente
IdZonaBusqueda=IdZona
if Request.querystring("IdAmbiente")&""<>"" then
IdAmbiente=Request.querystring("IdAmbiente")
IdAmbienteBusqueda=IdAmbiente
end if
if Request.querystring("IdZona")&""<>"" then
IdZona=Request.querystring("IdZona")
IdZonaBusqueda=IdZona
end if
'_________________________________________________________________________________________--
Dim DesdeAnio, DesdeMes, DesdeDia
Dim HastaAnio, HastaMes, HastaDia
Dim FechaDesde, FechaHasta
FechaDesde = strDesde & ""
FechaHasta = strHasta & ""
if FechaDesde = "" and FechaHasta <> "" then
FechaDesde = date
end if
If FechaDesde <> "" then
'Hay que invertir dia por mes
DesdeAnio=Year (FechaDesde)
DesdeMes =Month(FechaDesde)
DesdeDia =Day(FechaDesde)
'DesdeMes =Month(FechaDesde)
'DesdeDia =Day (FechaDesde)
else
DesdeAnio=Null
DesdeMes =Null
DesdeDia =Null
end if
if FechaHasta <> "" then
'Hay que invertir dia por mes
HastaAnio = Year (FechaHasta)
HastaMes = Month(FechaHasta)
HastaDia = Day (FechaHasta)
'HastaMes =Month(FechaHasta)
'HastaDia =Day (FechaHasta)
else
HastaAnio=Null
HastaMes =Null
HastaDia =Null
end if
if not isNull(strVer) then
if cstr(strVer) = "0" then
strVer=null
end if
end if
'Recordset de Retorno
Dim RsDepartamento
'response.Write(lngAmbiente & "," & lngZona & "," & CookieIdioma)
'response.Flush()
Dim Sql
if IdZona = "" then IdZona = null
if IdAmbiente = "" then IdAmbiente = null
if strDesde = "" then strDesde = null
if strHasta = "" then strHasta = null
if strVer = "" then strVer = null
'if IdTipoApartamento = "" then IdTipoApartamento= NULL
'________________________________________________________________________________________-
'___________A CONSIDERAR_______________________________________________________________________
'response.Write("")
' response.Flush()
'IdTipo Apartamento solo es null cuando no se encuentra en alguna de las primeras opciones
'set RsDepartamento = EjecutarText (Sql, Array(IdZona,IdAmbiente,null,null, DesdeAnio, DesdeMes, DesdeDia,HastaAnio, HastaMes, HastaDia,IdZonaBusqueda, IdAmbiente, Null, strVer, null))
'response.Write(" " & lngZonaBusqueda & "- " & lngAmbiente & "- " & CookieIdioma & "- " & DesdeAnio & "- " & DesdeMes & "- " & DesdeDia & "- " & HastaAnio & "- " & HastaMes & "- " & HastaDia & "- " & strVer & "- " & IdTipoApartamento)
'_________FIN DE CONSIDERAR__________________________________________________________________________________________________
if Request.Querystring("Accion")&""<>"Buscar" then
strdesde=session("strdesde")
strhasta=session("strhasta")
end if
Select case Request.Querystring("Orden")
case "1"
session("OrdenBusqueda")="DepartamentoBuscarCP"
case "2"
session("OrdenBusqueda")="DepartamentoBuscarSup"
case "3"
session("OrdenBusqueda")="DepartamentoBuscarAmb"
case "4"
session("OrdenBusqueda")="DepartamentoBuscarPre"
end select
Dim Orden
Orden=session("OrdenBusqueda")
'if Orden&""="" then
' session("OrdenBusqueda")="Departamento.Codigo"
' Orden="Departamento.Codigo"
'end if
If Request.Querystring("Accion")&""="Buscar" then
session("OrdenBusqueda")="DepartamentoBuscarCod"
Orden="DepartamentoBuscarCod"
end if
if Request.form("CboPrecio")="3" then
session("OrdenBusqueda")="DepartamentoBuscarPre"
Orden="DepartamentoBuscarPre"
elseif Request.form("CboPrecio")="2" then
session("OrdenBusqueda")="DepartamentoBuscarPreAsc"
Orden="DepartamentoBuscarPreAsc"
end if
'sql = "SELECT DISTINCT(Departamento.IdDepartamento) AS IDDepartamento, [Orden], [Departamento.Codigo], [FotoBusqueda], [Razon], [Descripcion], Color,[DepartamentoTraduccion.Tarifa30],[Departamento.Superficie],[Departamento.IdAmbiente],[Departamento.CantidadPersonas] "
'sql = sql & "FROM (((Departamento LEFT JOIN DepartamentoTraduccion ON Departamento.IdDepartamento=DepartamentoTraduccion.IdDepartamento) LEFT JOIN DepartamentoFecha ON Departamento.IdDepartamento=DepartamentoFecha.IdDepartamento) INNER JOIN TipoPropiedad ON TipoPropiedad.IdTipoPropiedad=Departamento.IdTipoPropiedad) INNER JOIN Zona ON Departamento.IdZona=Zona.IdZona "
'sql = sql & "WHERE ([@IdZona] Is Null Or Departamento.IdZona=[@IdZona]) And ([@IdAmbiente] Is Null Or Departamento.IdAmbiente=[@IdAmbiente]) And ([@idIdioma] Is Null Or idIdioma=[@idIdioma]) And ([@DesdeAnio] Is Null Or (Anio>=[@DesdeAnio] Or Anio Is Null)) And ([@DesdeMes] Is Null Or (Mes>=[@DesdeMes] Or Mes Is Null)) And ([@DesdeDia] Is Null Or (Dia>=[@DesdeDia] Or Dia Is Null)) And ([@HastaAnio] Is Null Or (Anio<=[@HastaAnio] Or Anio Is Null)) And ([@HastaMes] Is Null Or (Mes<=[@HastaMes] Or Mes Is Null)) And ([@HastaDia] Is Null Or (Dia<=[@HastaDia] Or Dia Is Null)) And ([@Ocupado] Is Null Or (Ocupado<>([@Ocupado]) Or Ocupado Is Null)) And ([@IdTipoPropiedad] Is Null Or DEpartamento.IdTipoPropiedad=[@IdTipoPropiedad]) And ([Departamento.Estado]=-1) "
'if Orden="Departamento.Codigo" then
'sql = sql & "ORDER BY ["&Orden&"] ASC"
'else
'sql = sql & "ORDER BY ["&Orden&"] DESC"
'end if
'************2º QUERY*********************************
'sql = "SELECT DISTINCT(Departamento.IdDepartamento) AS IDDepartamento, [Orden], [Departamento.Codigo], [FotoBusqueda], [Razon], [Descripcion], Color,[DepartamentoTraduccion.Tarifa30],[Departamento.Superficie],[Departamento.IdAmbiente],[Departamento.CantidadPersonas] "
'sql = sql & "FROM (((Departamento LEFT JOIN DepartamentoTraduccion ON Departamento.IdDepartamento=DepartamentoTraduccion.IdDepartamento) LEFT JOIN DepartamentoFecha ON Departamento.IdDepartamento=DepartamentoFecha.IdDepartamento) INNER JOIN TipoPropiedad ON TipoPropiedad.IdTipoPropiedad=Departamento.IdTipoPropiedad) INNER JOIN Zona ON Departamento.IdZona=Zona.IdZona "
'sql = sql & "WHERE (? Is Null Or Departamento.IdZona=?) And (? Is Null Or Departamento.IdAmbiente=?) And (? Is Null Or idIdioma=?) And (? Is Null Or (Anio>=? Or Anio Is Null)) And (? Is Null Or (Mes>=? Or Mes Is Null)) And (? Is Null Or (Dia>=? Or Dia Is Null)) And (? Is Null Or (Anio<=? Or Anio Is Null)) And (? Is Null Or (Mes<=? Or Mes Is Null)) And (? Is Null Or (Dia<=? Or Dia Is Null)) And (? Is Null Or (Ocupado<> ? Or Ocupado Is Null)) And (? Is Null Or DEpartamento.IdTipoPropiedad=?) And ([Departamento.Estado]=-1) "
'if Orden="Departamento.Codigo" then
'sql = sql & "ORDER BY ["&Orden&"] ASC"
'else
'sql = sql & "ORDER BY ["&Orden&"] DESC"
'end if
'*******************************************************
'sql = "SELECT DISTINCT(Departamento.IdDepartamento) AS IDDepartamento, [Orden], [Departamento.Codigo], [FotoBusqueda], [Razon], [Descripcion], Color,[DepartamentoTraduccion.Tarifa30],[Departamento.Superficie],[Departamento.IdAmbiente],[Departamento.CantidadPersonas] FROM (((Departamento LEFT JOIN DepartamentoTraduccion ON Departamento.IdDepartamento=DepartamentoTraduccion.IdDepartamento) LEFT JOIN DepartamentoFecha ON Departamento.IdDepartamento=DepartamentoFecha.IdDepartamento) INNER JOIN TipoPropiedad ON TipoPropiedad.IdTipoPropiedad=Departamento.IdTipoPropiedad) INNER JOIN Zona ON Departamento.IdZona=Zona.IdZona WHERE (Null Is Null Or Departamento.IdZona=Null) And (Null Is Null Or Departamento.IdAmbiente=Null) And (1 Is Null Or idIdioma=1) And (Null Is Null Or DEpartamento.IdTipoPropiedad=Null) ORDER BY [Orden] ,[Departamento.Codigo] ASC"
'if Orden="Departamento.Codigo" then
'sql = sql & "ORDER BY [Orden] ,[Departamento.Codigo] ASC"
'else
'sql = sql & "ORDER BY [Orden] DESC"
'end if
if IDZona = "" then
IDZona = null
end if
if IDAmbiente = "" then
IDAmbiente = null
end if
if desdeAnio = "" then
desdeanio = null
end if
if hastaAnio ="" then
hastaAnio = null
end if
if desdeMes = "" then
desdeMes = null
end if
if hastaMes = "" then
hastaMes = null
end if
if hastaDia ="" then
hastaDia = null
end if
if desdeDia = "" then
desdeDia = null
end if
set RsBuscar=EjecutarSP(Orden,array(IdZona,IdAmbiente,CookieIdioma,DesdeAnio,DesdeMes,DesdeDia,HastaAnio,HastaMes,HastaDia,strVer,null))
'set RsBuscar=Ejecutartext(sql,array())
'lngResultados = RsBuscar.recordcount
'set RsBuscar=Ejecutartext(sql,array(null,null,1,null,null,null,null,null,null,null,null,null))
%>
<%
Dim strCriteriosBusqueda
'Campos para levantar en la Base
Dim strDomicilio, strZona
DIm DescripcionTruncada
Dim Sujeto, SujetoBusqueda
if IdAmbiente <> "" then
'Se tiene que buscar de la base
set strDomicilio=ejecutarText("Select Descripcion from Ambiente where IdAmbiente = ?", Array(IdAmbiente))
strCriteriosBusqueda = strCriteriosBusqueda & strDomicilio("Descripcion")
end if
if IdZona <> "" then
'Se tiene que buscar de la base
set strZona=ejecutarText("Select IDZona, Nombre from Zona where IdZona = ?", Array(IdZona))
strCriteriosBusqueda = strCriteriosBusqueda & " " & strZona("Nombre")
else
set strZona = Nothing
end if
if strDesde <> "" then
strCriteriosBusqueda = strCriteriosBusqueda & " - " & strDesde
end if
if strHasta <> "" then
strCriteriosBusqueda = strCriteriosBusqueda & " - " & strHasta
end if
if strVer <> "" then
Dim Aux
If strVer = NULL then
Aux="Todos"
else
Aux="Disponibles"
end if
strCriteriosBusqueda = trim(strCriteriosBusqueda & " - " & Aux)
if mid(strCriteriosBusqueda,1,1) ="-" then
strCriteriosBusqueda = Mid(strCriteriosBusqueda,2)
end if
end if
%>
<%Dim RsDepto, IdDpto, RsDtoTraduccionTraer, RsAmbiente, IdAmb,a
set idAmb= Request.querystring("IdAmbiente")
set IdDpto= Request.QueryString("IdDepto")
Session("IdDepartamento") = IdDpto
set RsDptoTraduccionTraer= EjecutarSp("DepartamentoTraduccionTraer",Array(IdDpto,CookieIdioma))
set RsAmbiente=EjecutarText("Select * from Ambiente where IdAmbiente=?",Array(IdAmb))
set RsDepto= EjecutarText("Select * From Departamento where IdDepartamento=?",array(IdDpto))
dim Razon
if RsDptoTraducciontraer.eof then
Razon=""
DescripcionDpto=""
Comodidades=""
Ubicacion=""
else
Razon=RsDptoTraduccionTraer("Razon")
DescripcionDpto=RsDptoTraduccionTraer("Descripcion")
Comodidades=RsDptoTraduccionTraer("Comodidades")
Ubicacion=RsDptoTraduccionTraer("Ubicacion")
end if
%>