<% If Request.Cookies("Webmaster") <> "Validated" Then Response.Redirect("/ctrfiles/stats/login.asp") End if Response.buffer = True Dim Connect,RecordSet,currentdesc,newhomedesc,currentcat,dwStripe,MyFileObj,MyTextFile,strLine,totalitems,i,voyagerfile Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject") Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("/voyager/list.txt"),1,-2) strLine = MyTextFile.Readall MyTextFile.Close voyagerfile = FormatDateTime(MyFileObj.GetFile(Server.MapPath("/voyager/list.txt")).DateLastModified,1) Set MyFileObj = Nothing strLine = Split(strLine, VbTab) totalitems = Ubound(strLine) Set Connect = Server.CreateObject("ADODB.Connection") MyFile = Server.MapPath("/Database/houseview.mdb") Connect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & MyFile If Request("MODE") = "WTH" Then Set RecordSet = Connect.Execute("SELECT * FROM Listings WHERE Trim(Pending) <> '" & "Wth" & "' ORDER BY Listings.MLS ASC") ElseIf Request("MODE") = "SLD" Then Set RecordSet = Connect.Execute("SELECT * FROM Listings WHERE Trim(Pending) <> '" & "Sld" & "' ORDER BY Listings.MLS ASC") Else Set RecordSet = Connect.Execute("SELECT * FROM Listings ORDER BY Listings.MLS ASC") End if Dim strproperdate,strproperyear,strpropermonth,strporperday strproperyear = Year(date()) If Len(Month(date())) < 2 Then strpropermonth = "0" & Month(date()) Else strpropermonth = Month(date()) End if If Len(Day(date())) < 2 Then strporperday = "0" & Day(date()) Else strporperday = Day(date()) End if strproperdate = strproperyear & "/" & strpropermonth & "/" & strporperday %> Houseviewonline.com
<% Function GetCat( dCat,cCat ) IF Int(dCat) < 100000 AND cCat < 4 Then GetCat = 1 ElseIf Int(strLine(i - 1)) > 100000 AND Int(strLine(i - 1)) < 200000 AND cCat < 4 Then GetCat = 2 ElseIf Int(strLine(i - 1)) > 200000 AND cCat < 4 Then GetCat = 3 Else GetCat = cCat End if End Function If Not RecordSet.BOF Then RecordSet.MoveFirst Do While Not RecordSet.EOF For i = 1 to totalitems step 1 If Trim(strLine(i)) = Trim(Recordset.Fields("MLS")) AND IsNumeric(strLine(i - 1)) Then newhomedesc = "
SOLD/EXPIRED/WITHDRAWN
" & FormatDateTime(now,1) & "" currentcat = Recordset.Fields("PriceCat") If Instr(1,strLine(i + 1), "SOLD",1) OR Instr(1,strLine(i + 1), "WITHDRAWN",1) OR Instr(1,strLine(i + 1), "EXPIRED",1) Then If Request("ACTION") = "go" Then IF Instr(1,strLine(i + 1), "SOLD",1) Then strmarker = "Sld" strsldatemarker = strproperdate ElseIF Instr(1,strLine(i + 1), "WITHDRAWN",1) Then strmarker = "Wth" strsldatemarker = strproperdate ElseIF Instr(1,strLine(i + 1), "EXPIRED",1) Then strmarker = "Wth" strsldatemarker = strproperdate Else strmarker = "" strsldatemarker = "" End if Connect.execute("UPDATE Listings Set solddate='"&strsldatemarker&"',Pending='"&strmarker&"',homedesc='"&newhomedesc&"',price='"&strLine(i - 1)&"',PriceCat='"&GetCat(strLine(i - 1),currentcat)&"' WHERE ID =" & Recordset.Fields("ID")) End if if dwStripe = "#ffffff" then dwStripe = "#e5e5ca" else dwStripe = "#ffffff" end if Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) ElseIf FormatCurrency(strLine(i - 1),0,0) <> FormatCurrency(Recordset.Fields("price"),0,0) Then If Request("ACTION") = "go" Then Connect.execute("UPDATE Listings Set price='"&strLine(i - 1)&"',PriceCat='"&GetCat(strLine(i - 1),currentcat)&"' WHERE ID =" & Recordset.Fields("ID")) End if if dwStripe = "#ffffff" then dwStripe = "#e5e5ca" else dwStripe = "#ffffff" end if Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) Response.Write("" & chr(13)) End if End if Next RecordSet.MoveNext Loop End If Connect.Close Set Connect = Nothing Set Recordset = Nothing %>
Voyager/Houseview Database Comparison Report for <%=FormatDateTime(now,1) %>
Voyager File Updated: <%=voyagerfile%>
<% If Request("ACTION") = "go" Then %>
Update Complete Update Text Files <% End if %>
MLS# Agent Location Status Voyager Price Website price
 • " & Trim(strLine(i)) & "" & Recordset.Fields("RealitorAbb") & "" & Recordset.Fields("Location") & "" & Left(Trim(strLine(i + 1)),Len(Trim(strLine(i + 1)))-1) & "" & FormatCurrency(strLine(i - 1),0,0) & "" & FormatCurrency(Recordset.Fields("price"),0,0) & "
 • " & Trim(strLine(i)) & "" & Recordset.Fields("RealitorAbb") & "" & Recordset.Fields("Location") & "Price Change" & FormatCurrency(strLine(i - 1),0,0) & "" & FormatCurrency(Recordset.Fields("price"),0,0) & "
" method="post">