|
|||||||||
|
|||||||||
![]() IMPORTANT NOTE: Please do not navigate using your browser's back button is it may cause some properties in your tour to be lost. Rents subject to change without notice. Specific unit availability subject to confirmation.
<%@ LANGUAGE="VBSCRIPT" %>
<%
' Make sure we Dim our variables.
'Option Explicit
' Allow for redirects in the code.
Response.Buffer = TRUE
' Set P3P for third party
Response.AddHeader "P3P","CP=""CAO PSA OUR"""
' Toggle on/off to test our pages.
On Error Resume Next
' Global (page-level) variables.
Dim objConn ' ADO database connection object
Dim objCommand ' ADO command object
Dim objRsReview ' ADO recordset for review query
Dim sWhere ' Stores built where statement
Dim sOrderBy ' Stores built order by statement
Dim vChkItem ' Stores aChkBoxes items
'ADO parameter objects
Dim prmApartmentId,prmCityId,prmSt,prmLeasePeriods,prmLessThanYearLease,prmNumberOfUnits,prmApplicationFee
Dim prmManagementId,prmSpecials,prmESchool,prmMSchool,prmHSchool,prmYearBuilt
Dim prmHotWater,prmAmenities,prmParking,prmHeat,prmLowPrice,prmHighPrice
Dim prmStarRating,prmDeposit,prmSqFtmin,prmSqFtmax,prmPatioBalcony,prmVaultedCeiling
Dim prmOutsideStorage,prmLinenCloset,prmFirePlace,prmWalkinCloset,prmGardenTub
Dim prmBedroomType
'text variables
Dim iApartmentId,iCityId,sSt,sLeasePeriods,sLessThanYearLease,iNumberOfUnits,cApplicationFee
Dim iManagementId,sSpecials,iESchool,iMSchool,iHSchool,iYearBuilt
Dim sHotWater,iAmenities,sParking,sHeat,cLowPrice,cHighPrice
Dim sStarRating,cDeposit,iSqFt,sPatioBalcony,sVaultedCeiling
Dim sOutsideStorage,sLinenCloset,sWalkinCloset,sGardenTub
Dim sBedroomType,aZip,aMap,aWD,aDesc,aChkBoxes
Dim intCount ' counter
Dim sBG ' background color variable
Dim iUnitID ' holds unitid unique id from recordset
Dim sFirstUnitId ' holds unitid of first record in list
Dim sCustomerId ' keeps track of current customer
Dim sPhone ' holds customer phone
Dim sFitness ' holds checkbox selection
Dim sFireplace ' holds checkbox selection
Dim sPool ' holds checkbox selection
Dim sGarage ' holds checkbox selection
Dim sLoft ' holds checkbox selection
Dim sStudy ' holds checkbox selection
Dim sFurnished ' holds checkbox selection
Dim sClubroom ' holds checkbox selection
Dim sBasketball ' holds checkbox selection
Dim sSunroom ' holds checkbox selection
Dim sGated ' holds checkbox selection
Dim sPets ' holds checkbox selection
Dim sTownhome ' holds checkbox selection
Dim sDuplex ' holds checkbox selection
Dim sLaundry ' holds checkbox selection
Dim sFreeCable ' holds checkbox selection
Dim sCvParking ' holds checkbox selection
Dim sJoggingTrail ' holds checkbox selection
Dim sWDProvided ' holds checkbox selection
Dim sWDConnections ' holds checkbox selection
Dim ssqftmin ' holds sqft minimum value
Dim ssqftmax ' holds sqft maximum value
Dim wTourIds ' holds the tour ids that get passed from prior page
Dim abspage
Dim pagecnt
Dim SortBy ' holds query string value for sorting records
Dim rsSortBy ' converts browser display value of SortBy with actual value
Dim MakeCity ' formats selected areas for search
Dim MakeLocation ' formats selected areas for search by zip code
' Global (page-level) constants.
Const cnPageTitle = "Search Apartment Information"
%>
<%
'**************************************************************************
'* Business Logic
'**************************************************************************
' Set submitted values to local variables.
cLowPrice = Trim(Request("txtLowPrice"))
cHighPrice = Trim(Request("txtHighPrice"))
sBedroomType = Request("optBedroomType")
aZip = Split(Request("hidZip"),",")
aMap = Split(Request("hidMap"),",")
aWD = Split(Request("hidWasherDryer"),",")
aChkBoxes = Split(Request("hidCheckBoxes"),",")
wTourIds = Request("sTourIDs")
ssqftmin = Request("sqftmin")
ssqftmax = Request("sqftmax")
rsSortBy = Request("SortBy")
If rsSortBy = "HighRent" Then
rsSortBy = "ui.Highprice"
End If
If rsSortBy = "AptName" Then
rsSortBy = "ai.ApartmentName"
End If
If rsSortBy = "Unit" Then
rsSortBy = "ui.Description"
End If
If rsSortBy = "SF" Then
rsSortBy = "ui.SqFt"
Else
rsSortBy = "ai.ApartmentName"
End If
' Create ADO objects.
With (Server)
Set objConn = .CreateObject("ADODB.Connection")
Set objCommand = .CreateObject("ADODB.Command")
Set objRsReview = .CreateObject("ADODB.Recordset")
End With
With (objCommand)
' Create connection to database.
objConn.Provider = "MSDataShape"
objConn.Open Application("sSQLSVRDSN")
'objConn.Open Application("sDSN")
.ActiveConnection = objConn
'Customer sql
.CommandText = "SELECT * FROM TBL_CustomerInfo WHERE CustomerName IS NOT NULL ORDER BY CustomerName "
.CommandType = adCmdText
'Main apartment info
'Order by string
sOrderBy = " ORDER BY ai.ApartmentName, ui.Description "
sWhere = " WHERE (ui.[Plan] <> '' OR ui.Description <> '' OR ui.SqFt Is Not Null OR LowPrice Is Not Null OR HighPrice Is Not Null) "
sWhere = sWhere & " AND ai.Map <> '' "
'Build parameter input list. '?' denotes a parameter.
'Low Price - changed to effective rent
If cLowPrice <> "" Then
'sWhere = sWhere & " AND (ui.EffRent >= ? or ui.LowPrice >= ?)"
sWhere = sWhere & " AND coalesce(ui.EffRent,ui.LowPrice) >= ?"
Set prmLowPrice = .CreateParameter(,adCurrency ,adParamInput,, cLowPrice)
.Parameters.Append prmLowPrice
End If
'High Price - changed to effective rent
If cHighPrice <> "" Then
'sWhere = sWhere & " AND (ui.EffRent <= ? or ui.LowPrice <= ?)"
sWhere = sWhere & " AND coalesce(ui.EffRent,ui.LowPrice) <= ?"
Set prmHighPrice = .CreateParameter(,adCurrency ,adParamInput,, cHighPrice)
.Parameters.Append prmHighPrice
End If
'Bedroom type
If sBedroomType <> "" AND lcase(sBedroomType) <> "all" Then
sWhere = sWhere & " AND Left(ui.Description,1) LIKE ?"
Set prmBedroomType = .CreateParameter(,adVarWChar ,adParamInput ,50 ,sBedroomType)
.Parameters.Append prmBedroomType
End If
'SQFT
If ssqftmin <> "" Then
sWhere = sWhere & " AND SqFt >= " & ssqftmin & " "
End If
If ssqftmax <> "" Then
sWhere = sWhere & " AND SqFt <= " & ssqftmax & " "
End If
'Fireplace
sFireplace = Request("Fireplace")
If sFireplace <> "" Then
sWhere = sWhere & " AND Fireplace <> '0' "
End If
'Pool
sPool = Request("Pools")
If sPool <> "" Then
sWhere = sWhere & " AND Pools <> '0' "
End If
'Garage
sGarage = Request("Garage")
If sGarage <> "" Then
sWhere = sWhere & " AND Garage <> '0' "
End If
'Furnished
sFurnished = Request("Furnished")
If sFurnished <> "" Then
sWhere = sWhere & " AND Furnished <> '0' "
End If
'Clubroom
sClubroom = Request("ClubRoom")
If sClubroom <> "" Then
sWhere = sWhere & " AND Clubroom <> '0' "
End If
'Basketball
sBasketball = Request("BasketBall")
If sBasketball <> "" Then
sWhere = sWhere & " AND Basketball <> '0' "
End If
'Sunroom
sSunroom = Request("SunRoom")
If sSunroom <> "" Then
sWhere = sWhere & " AND Sunroom <> '0' "
End If
'Gated
sGated = Request("AccessGates")
If sGated <> "" Then
sWhere = sWhere & " AND AccessGates <> '0' "
End If
'Pets
sPets = Request("Pet")
If sPets <> "" Then
sWhere = sWhere & " AND Pet <> '0' "
End If
'Townhome (passed from external sites)
sTownhome = sType
Select Case sTownhome
Case "townhome"
sWhere = sWhere & " AND Townhome <> '0' "
Case "duplex"
sWhere = sWhere & " AND Duplex <> '0' "
End Select
'Laundry
sLaundry = Request("Laundry")
If sLaundry <> "" Then
sWhere = sWhere & " AND Laundry <> '0' "
End If
'Free Cable
sFreeCable = Request("FreeCable")
If sFreeCable <> "" Then
sWhere = sWhere & " AND FreeCable <> '0' "
End If
'Covered Parking
sCvParking = Request("CoveredParking")
If sCvParking <> "" Then
sWhere = sWhere & " AND CoveredParking <> '0' "
End If
'Jogging Trail
sJoggingTrail = Request("JoggingTrail")
If sJoggingTrail <> "" Then
sWhere = sWhere & " AND JoggingTrail <> '0' "
End If
'W/D Provided
sWDProvided = Request("WDProvided")
If sWDProvided <> "" Then
sWhere = sWhere & " AND (WasherDryer = 'FA' or WasherDryer = 'SA') "
End If
'W/D Connections
sWDConnections = Request("WDConnections")
If sWDConnections <> "" Then
sWhere = sWhere & " AND (WasherDryer = 'FC' or WasherDryer = 'SC') "
End If
'Fitness Center
sFitness = Request("FitnessCenter")
If sFitness <> "" Then
sWhere = sWhere & " AND FitnessCenter <> '0' "
End If
%>
<%
'Location by zipcode
zAreas = Request("zAreas")
If zAreas = "" then
zAreas = zNW & ", " & zNE & ", " & zNC & ", " & zC & ", " & zE & ", " & zW & ", " & zSC & ", " & zSW & ", " & zSE & ", " & zUT & ", " & zRR
End if
MakeLocation = Replace(zAreas, ", ", "' OR ai.zip= '")
sWhere = sWhere & " AND (ai.zip = '" & MakeLocation & "') "
'Build sql select string.
.CommandText = "SHAPE {" & _
"SELECT DISTINCT ai.ApartmentName " & _
" , ai.NoInternet " & _
" , ai.ApartmentId " & _
" , ai.Commission " & _
" , ai.Address " & _
" , ai.St " & _
" , ai.Zip " & _
" , ai.Map " & _
" , ai.Location " & _
" , ai.Pet " & _
" , ai.Garage " & _
" , ai.GasCooking " & _
" , ai.GasPaid " & _
" , ai.AccessGates " & _
" , ai.FreeCable " & _
" , ai.Laundry " & _
" , ai.Pools " & _
" , ai.Jacuzzi " & _
" , ai.Volleyball " & _
" , ai.Alarms " & _
" , ai.FitnessCenter " & _
" , ai.RacquetBall " & _
" , ai.BasketBall " & _
" , ai.Tennis " & _
" , ai.Sauna " & _
" , ai.JoggingTrail " & _
" , ai.BusinessCenter " & _
" , ai.ClubRoom " & _
" , ai.ElectricityPaid " & _
" , ai.Furnished " & _
" , ui.Dishwasher " & _
" , ui.FrostFreeRefer " & _
" , ui.Icemaker " & _
" , ui.Microwave " & _
" , ui.UnitID " & _
" , ui.Description " & _
" , ui.SqFt " & _
" , ui.LowPrice " & _
" , ui.EffRent " & _
" , ui.WasherDryer " & _
" , imgi.ImageID " & _
" , imgi.ImageName " & _
" FROM ((TBL_ApartmentInfo AS ai " & _
" LEFT JOIN TBL_ApartmentUnitInfo AS ui ON ai.ApartmentId = ui.ApartmentId) " & _
" LEFT JOIN TBL_Images AS imgi ON ai.ApartmentId = imgi.ApartmentId) " & _
sWhere & " AND RegionId = '1' " & _
sOrderBy & "} "
.CommandType = adCmdText
'Open recordset
Call objRsReview.Open(objCommand,,adOpenForwardOnly ,adLockReadOnly)
End With
Dim sPG
sPG = Request("pg")
If Not objRsReview.EOF Then
If Len(sPG) = 0 OR sPG = "" Then
objRsReview.AbsolutePage = 1
Else
If CInt(sPG) <= objRsReview.PageCount Then
objRsReview.AbsolutePage = CInt(sPG)
Else
objRsReview.AbsolutePage = 1
End If
End If
End if
Session("paging") = objRsReview.AbsolutePage
'Session("paging_prev") = objRsReview.AbsolutePage
Session("paging_prev") = 1
abspage = objRsReview.AbsolutePage
pagecnt = objRsReview.PageCount
'**************************************************************************
'* Presentation Logic
'**************************************************************************
%>
|
|||||||||
![]() |
|||||||||
NORTH AUSTIN![]() ![]() ![]() |
|||||||||
All persons or firms named herein are licensed brokers or salespersons in the State of Texas. Copyright Austin Texas Apartments and Townhomes 2009. All rights reserved. Designed and maintained by AMB Design Studio. |