%
GOTOIT = REquest("GOTOIT")
IF GOTOIT = "SearchFor" then
Session("PRice")= REquest("Price")
Session("HoldType") = Request("HoldType")
Session("HeadlineSize") = Request("HeadlineSize") ' = PurchaseType in PropertyInfo
' ssql = "Select * From PropertyType Where TypeID = " & Session("HoldType")
'set srs = Server.createobject("ADODB.recordset")
'srs.open ssql,oconn,1,3,adcmdtext
'Session("HoldTypeWord") = srs("PropertyType")
'srs.close
select case Session("HoldType")
case 0
Session("HoldTypeWord")="TO LET"
P = "(Tenure =0) "
case 1
Session("HoldTypeWord")="FOR SALE"
P = "(Tenure =1) "
End select
PRopertyType = REquest("PRopertyType")
If Len(PropertyType)=0 then
errcnt1 = "Please Select a property Type from the list below"
end if
sqlBuild = "Select * From PropertyInfo Where "
SqlBuild = SqlBuild & P & " AND ("
PropertyCategory = PropertyType
PIR= " PropertyCategory = "
PC = PropertyCategory
PCl = instr(PC,"11")
if PCl>0 then
' response.write "yep"
PC = " PropertyCategory Like '%%' "
PIR = ""
Else
PC = Replace(PropertyCategory,", ", " OR PropertyCategory=")
end if
'Now Look at the sort order variable and decide what order to sort
If SearchResOrder = "HighToLow" then
vSearchRes = " ORDER BY AskingPrice DESC, AskingRent DESC"
end if
If SearchResOrder = "LowToHigh" then
vSearchRes =" ORDER BY AskingPrice , AskingRent"
end if
'Now deal with Headline size
If Session("HeadlineSize") > 0 then
Headline = " AND (HeadlineSize >=" & Session("HeadlineSize") & ")"
End if
Session("SQL") = sqlBuild & PIR & PC & ")" & Headline & " AND (Retired=0)" & vSearchRes
' Response.write PRopertyType
if request("g") =1 then
noprop = "Sorry we have no proprties meeting your request"
end if
If LEn(errcnt1)=0 then
response.redirect "searchres2.asp"
end if
end if
If Request.Servervariables("REMOTE_ADDR") ="82.38.1.36" then
Response.write Session("SQL") & "
"
Response.write errcnt1
end if
%>