<% Dim strgroup,foundagencybol strgroup = Request("GRP") If strgroup <> "" Then strgroup = Cint(strgroup) End if 'Varible Conversions for FINIS update+++++++++++++++++++ Select Case strgroup Case 15 strgroup = 13 Case 5 strgroup = 44 Case 20 strgroup = 18 End Select 'Varible Conversions for FINIS update+++++++++++++++++++ foundagencybol = False Function FigurePayment(principal) Dim P 'Payment Dim I 'Interest Dim L 'Loan Term In Years Dim J Dim N Dim M 'Total of Loan Amount P = principal 'Interest Rate I = 7 'Loan term in years L = 30 'Calculate Monthly Interest J = I/(12 * 100) 'Length of loan in Months N = L * 12 'Now the magic..... M = P * ( J / (1 - (1 + J) ^ -N)) FigurePayment = FormatCurrency(Round(M, 2),0,0) End Function Dim MyFileObj,MLS_RS,myListingsSQL,OnAgency,myAgencySQL,OnFeatures,sqlnew Dim allfeatures,maxcounter,counter,marker Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject") set MLS_RS = Server.CreateObject("ADODB.Recordset") If Request("MODE") = "inhouse" AND Request("IH") = "yes" Then myListingsSQL = "SELECT * FROM " & strIHlistingstable & " WHERE MLS =" & Request.Querystring("MLS") Else myListingsSQL = "SELECT * FROM " & strlistingstable & " WHERE MLS =" & Request.Querystring("MLS") End if MLS_RS.cursorlocation = aduseclient MLS_RS.cachesize = 5 MLS_RS.open myListingsSQL,Connect set OnAgency = Server.CreateObject("ADODB.Recordset") myAgencySQL = "SELECT * FROM " & stragencytable & " WHERE grouping =" & strgroup OnAgency.cursorlocation = aduseclient OnAgency.cachesize = 5 OnAgency.open myAgencySQL,Connect 'Broker reiprocity listing, get agency data ......................... If OnAgency.EOF AND OnAgency.BOF Then foundagencybol = False Else Dim agid,agagency,aggrouping,agaddress,agcity,agstate,agzip,agphone Dim agfax,agemail,agother,aglogo,agextra1,agextra2,agextra3,agextra4,agextra5 foundagencybol = True agid = OnAgency.Fields("id") agagency = OnAgency.Fields("agency") aggrouping = OnAgency.Fields("grouping") agaddress = OnAgency.Fields("address") agcity = OnAgency.Fields("city") agstate = OnAgency.Fields("state") agzip = OnAgency.Fields("zip") agphone = OnAgency.Fields("phone") agfax = OnAgency.Fields("fax") agemail = OnAgency.Fields("email") agother = OnAgency.Fields("other") aglogo = OnAgency.Fields("logo") agextra1 = OnAgency.Fields("extra1") agextra2 = OnAgency.Fields("extra2") agextra3 = OnAgency.Fields("extra3") agextra4 = OnAgency.Fields("extra4") agextra5 = OnAgency.Fields("extra5") End if IF ISNull(MLS_RS.Fields("FEATURES")) Then 'Do Nothing Null Field Else If Trim(MLS_RS.Fields("FEATURES")) <> "" Then sqlnew = "SELECT * FROM " & strfeaturestable & " INNER JOIN " & strfeaturecatstable & " ON " & strfeaturestable & ".CatID = " & strfeaturecatstable & ".CatID WHERE" allfeatures = Split(Trim(MLS_RS.Fields("FEATURES")),"|") maxcounter = ubound(allfeatures) FOR counter = 0 TO maxcounter If Trim(allfeatures(counter)) <> "" Then If counter = 0 then sqlnew = sqlnew & " " & strfeaturestable & ".FeatureID = " & Cint(allfeatures(counter)) Else sqlnew = sqlnew & " OR " & strfeaturestable & ".FeatureID = " & Cint(allfeatures(counter)) End if End if Next sqlnew = sqlnew & " ORDER BY " & strfeaturestable & ".CatID ASC, " & strfeaturecatstable & ".Description" set OnFeatures = Server.CreateObject("ADODB.Recordset") OnFeatures.cursorlocation = aduseclient OnFeatures.cachesize = 5 OnFeatures.open sqlnew,Connect End if End if If foundagencybol Then %>
<%=agagency%> <%=agagency%>
 • Phone: <%=agphone%>
 • Fax: <%=agfax%>
 • <%=agemail%>
<%=agaddress%> <%=agcity%>, <%=agstate%> <%=agzip%>
<% End if If NOT MLS_RS.EOF AND NOT MLS_RS.BOF Then Dim xmlIsValidTour,xmlaid,xmlmls,xmlagent,xmlagency,xmlkey,xmlagencyid,xmlagentid function SoapTest(valmls,valaid,valkey) SoapTest = SoapTest & "" SoapTest = SoapTest & "" SoapTest = SoapTest & "" SoapTest = SoapTest & "" & valmls & "" SoapTest = SoapTest & "" & valaid & "" SoapTest = SoapTest & "" & valkey & "" SoapTest = SoapTest & "" SoapTest = SoapTest & "" SoapTest = SoapTest & "" end function function IsValidTour(valmls,valaid,valkey,valserver) IsValidTour = False Dim xmldom,xmlhttp set xmldom = server.CreateObject("Microsoft.XMLDOM") set xmlhttp = server.CreateObject("Microsoft.XMLHTTP") on error resume next xmlhttp.open "POST", valserver, false xmlhttp.setRequestHeader "Man", "POST" & " " & valserver & " HTTP/1.1" xmlhttp.setRequestHeader "MessageType", "CALL" xmlhttp.setRequestHeader "ContentType", "text/xml" xmlhttp.send(SoapTest(valmls,valaid,valkey)) if xmlhttp.Status = 200 then Set xmldom = xmlhttp.responseXML xmlIsValidTour = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/VALID").Text xmlmls = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/MLS").Text xmlagent = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/Agent").Text xmlagency = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/Agency").Text xmlagencyid = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/AgencyID").Text xmlagentid = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/AgentID").Text xmlkey = xmldom.selectSingleNode("SOAP:Envelope/SOAP:Body/Tour/Key").Text If xmlIsValidTour = "Yes" Then IsValidTour = True Else IsValidTour = False End if Else xmlIsValidTour = "No" xmlaid = "Didn't Work
" xmlmls = "status=" & xmlhttp.status xmlagent = "
" & xmlhttp.statusText xmlagency = "
" & Request.ServerVariables("ALL_HTTP") xmlagencyid = "
" xmlagentid = "
" xmlkey = "
HTTP Request Erorr" IsValidTour = False End if set xmlhttp = nothing set xmldom = nothing end function If IsValidTour(Request.Querystring("MLS"),1,"RTLHVO1","http://www.realtourlive.com/SOAP/") Then %>
<% ElseIf IsValidTour(Request.Querystring("MLS"),5,"RTLHVO1","http://www.realtourlive.com/SOAP/") Then %>
<% End if %>
  [ <--Back ]  [ &FILTER=<%=Request("FILTER")%>">Detailed Search]
&FI=yes" width="305" height="229" border="0" ALT="<% If Request("MODE") <> "inhouse" Then Response.Write ("MLS# ")%><%=MLS_RS.Fields("MLS")%>" NAME="housepic"> <% If MyFileObj.FileExists("D:\webroot\localuser\houseview\images\" & MLS_RS.Fields("MLS") & "\outpgf.htm") Then %> HouseVieownline.com /outpgf.htm" onclick="NewWindow(this.href,'HouseViewOnline','750','500','yes');return false" onfocus="this.blur()" TITLE="Outside Images courtesy of HouseViewOnline.com"> <% End if %> <% If MyFileObj.FileExists("D:\webroot\localuser\houseview\images\" & MLS_RS.Fields("MLS") & "\inpgf.htm") Then %> /inpgf.htm" onclick="NewWindow(this.href,'HouseViewOnline','750','500','yes');return false" onfocus="this.blur()" TITLE="Inside Images courtesy of HouseViewOnline.com"> <% End if %> <% 'Get Panoramic pictures from asp file----------------------------------------------------------- Dim strfoundpanos,txtfile,stralltxtfile,strpanostring,strpanostringfirst strfoundpanos = False If MyFileObj.FileExists("D:\webroot\localuser\houseview\images\" & MLS_RS.Fields("MLS") & "\pano1_thumb_0360.jpg") Then If MyFileObj.FileExists("D:\webroot\localuser\houseview\images\" & MLS_RS.Fields("MLS") & "\" & MLS_RS.Fields("MLS") & ".asp") then Set txtfile = MyFileObj.OpenTextFile("D:\webroot\localuser\houseview\images\" & MLS_RS.Fields("MLS") & "\" & MLS_RS.Fields("MLS") & ".asp") stralltxtfile = txtfile.ReadAll IF Instr(1,stralltxtfile,"P1",1) Then strpanostringfirst = Mid(stralltxtfile,Instr(1,stralltxtfile,"P1",1),Len(stralltxtfile)) strpanostring = Mid(strpanostringfirst,1,Instr(1,strpanostringfirst,"PT8=",1)+2) strfoundpanos = True txtfile.Close Set txtfile = Nothing End if End if End if 'Get Panoramic pictures from asp file----------------------------------------------------------- If strfoundpanos Then %> " onclick="NewWindow(this.href,'HouseViewOnline','750','500','yes');return false" onfocus="this.blur()" TITLE="Panoramic Images courtesy of HouseViewOnline.com"> <% End if %>
<%=MLS_RS.Fields("NOTES")%>
For Additional Information Contact:<% If strgroup <> MLS_RS.Fields("GROUPING") Then Response.Write("**")%>
<% Private Function RetrieveAgentPhoto(stragentfirst,stragentlast) Dim objFileTextStream,strstart,strLine set objFileTextStream = MyFileObj.OpenTextFile("D:\webroot\localuser\houseview\database\agents.txt") Do While objFileTextStream.AtEndOfStream <> TRUE strstart = Trim(Server.HTMLEncode(objFileTextStream.ReadLine)) if strstart = "TRUE" then strLine = Trim(Server.HTMLEncode(objFileTextStream.ReadLine)) strLine = Split(strLine, "^") If Instr(1,LCase(Trim(strLine(0))),stragentfirst,1) AND Instr(1,LCase(Trim(strLine(1))),stragentlast,1) Then RetrieveAgentPhoto = LCase(Trim(strLine(2))) Exit Do Else RetrieveAgentPhoto = "" End if end if Loop objFileTextStream.Close set objFileTextStream = Nothing End Function Dim stragentdata,stragentfirst,stragentlast If Len(Trim(MLS_RS.Fields("Agent"))) > 5 Then stragentdata = Split(MLS_RS.Fields("Agent"), ",") stragentfirst = stragentdata(1) stragentlast = stragentdata(0) Else Response.Write("N/A") End if If strgroup = MLS_RS.Fields("GROUPING") Then Response.Write("" & chr(13)) Response.Write("") Response.Write("") Response.Write("
 & chr(34) & stragentfirst & " & stragentfirst & " " & stragentlast & "
" & MLS_RS.Fields("AGENTPHONE") & "
" & chr(13)) %>
<%=MLS_RS.Fields("OFFICE")%>
<%=MLS_RS.Fields("OFFICEPHONE")%>
Email
<% Else If foundagencybol Then %>
<%=agagency%> <%=agagency%>
 • Phone: <%=agphone%>
 • Fax: <%=agfax%>
 • <%=agemail%>
<%=agaddress%>
<%=agcity%>, <%=agstate%> <%=agzip%>

<% Else Response.Write("Agency Data Not Found....IDX error 001") End if End if %>
<%=FormatCurrency(MLS_RS.Fields("PRICE"),0,0)%>
<% If Request("MODE") <> "inhouse" Then Response.Write ("MLS# ")%> <%=MLS_RS.Fields("MLS")%>
<%=MLS_RS.Fields("CITY")%>, <%=MLS_RS.Fields("STATE")%> <%=MLS_RS.Fields("ZIP")%>
Type: <%=MLS_RS.Fields("TYPE1")%>
         <%=MLS_RS.Fields("TYPE2")%>
         <%=MLS_RS.Fields("TYPE3")%>
Beds: <%=MLS_RS.Fields("BED")%>
Baths: <%=MLS_RS.Fields("BATHFULL")%>
Half Baths: <%=MLS_RS.Fields("BATHHALF")%>
Square Feet: <%=MLS_RS.Fields("SQFT")%>
Basement: <%=MLS_RS.Fields("BASEMENT")%>
Age: <%=MLS_RS.Fields("AGE")%>:
Estimated Payment: <%=FigurePayment(MLS_RS.Fields("PRICE"))%>*
Coming Soon!  
<% If strgroup <> MLS_RS.Fields("GROUPING") Then %> <% End if %> <% Dim MyTextFile,strLine,strcity,strstreet,strstate,strzip,strtime,strnotes If MyFileObj.FileExists(Server.MapPath("/ctrfiles/notes/" & Trim(MLS_RS.Fields("MLS")) & "oh.txt" )) Then %>
" TITLE="Request More Information">
&Down=0&Rate=7.00','MortgageCalculator','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=275,height=305,left=50,top=50'); return false;" TITLE="Calculate Monthly Payments">
&MLS=<%=MLS_RS.Fields("MLS")%>&GRP=<%=Request.Querystring("GRP")%>&FILTER=<%=Request.Querystring("FILTER")%>&MODE=<%=Request.Querystring("MODE")%>&IH=<%=Request.Querystring("IH")%>&EMAIL=<%=agemail%>&AGENCY=<%=Server.URLEncode(agagency)%>','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=520,height=150,left=50,top=50'); return false;" TITLE="Request More Information">


OPEN HOUSE:   <% Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("/ctrfiles/notes/" & Trim(MLS_RS.Fields("MLS")) & "oh.txt" )) strLine = Trim(Server.HTMLEncode(MyTextFile.ReadLine)) strLine = Split(strLine, "|") strcity = strLine(0) strstreet = strLine(1) strstate = strLine(2) strzip = strLine(3) strtime = strLine(4) strnotes =strLine(5) MyTextFile.Close %> <%=Replace(strstreet,"+"," ")%> <%=Replace(strcity,"+"," ")%>  <%=strtime%>  <%=strnotes%> <% End if %>
Features:

<% If ISNull(MLS_RS.Fields("FEATURES")) Then 'Do Nothing, null Filed Else If Trim(MLS_RS.Fields("FEATURES")) <> "" Then If Not OnFeatures.BOF Then OnFeatures.MoveFirst Do Until OnFeatures.EOF If marker <> OnFeatures.Fields(6) Then Response.Write("------" & OnFeatures.Fields(6) & "------
") End if Response.Write(" • " & OnFeatures.Fields(1) & "
") marker = OnFeatures.Fields(1) OnFeatures.MoveNext Loop End if End if End if %>
*Estimated Payment: Assuming 0% down, 30 year fixed rate of 7.00%
<% If strgroup <> MLS_RS.Fields("GROUPING") Then %> **This listing courtesy of:
 <%=stragentfirst%> <%=stragentlast%>  <% If Trim(MLS_RS.Fields("Agent")) <> Trim(MLS_RS.Fields("OFFICE")) Then Response.Write("of " & Trim(MLS_RS.Fields("OFFICE"))) End if %> , <%=MLS_RS.Fields("OFFICEPHONE")%>



The data relating to real estate for sale on this web site comes in part from the Broker Reciprocity Program of the Cape Girardeau County Regional MLS. Real estate listings held by brokerage firms other than The Listing Broker are marked with the Broker Reciprocity logo and detailed information about them includes the name of the listing brokers.
<% End if %>




IDX Data Intergration Provided by
houseViewonline.com IDX Broker Reciprocity
Data Updated on: <%=FormatDateTime(MyFileObj.GetFile(Server.MapPath("/IDX/listings-residential.txt")).DateLastModified,2)%>
<% Else Response.Write("

Invalid or Outdated Item....


") End if Connect.Close Set Connect = Nothing Set MLS_RS = Nothing Set OnAgency = Nothing Set OnFeatures = Nothing Set MyFileObj = Nothing %>