<% Response.Buffer = True %> <% If Request.Cookies("Webmaster") <> "Validated" Then Response.Redirect("/ctrfiles/stats/login.asp") End if If Request("ACTION") = "go" Then 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 Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\webroot\localuser\houseview\database\houseview.mdb;" For ix = 1 to Request.Form.Count if Len(Request.Form.Item(ix)) <> 0 then If Request("Report") = 1 Then If Request.Form.Item(ix) = "OO" Then Connect.execute("UPDATE Listings Set invoicedate = '"& strproperdate &"',invoicedate2 = '"& strproperdate &"' WHERE ID = " & Request.Form.Key(ix)) Else Connect.execute("UPDATE Listings Set invoicedate = '"& strproperdate &"' WHERE ID = " & Request.Form.Key(ix)) End if Elseif Request("Report") = 2 Then Connect.execute("UPDATE Listings Set invoicedate2 = '"& strproperdate &"' WHERE ID = " & Request.Form.Key(ix)) End if End if Next Connect.Close Set Connect = Nothing End if Dim MyFile MyFile = Server.MapPath("/database/houseview.mdb") connectme="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & MyFile & ";" Select Case Request("Report") Case 1 sqltemp="SELECT * FROM Listings WHERE (Trim(listingdate) <> '" & "" & "' AND invoicedate = '" & "" & "') OR (Trim(listingdate) <> '" & "" & "' AND ISNULL(invoicedate)) ORDER BY Cdate(Listings.Listingdate) DESC, Listings.MLS ASC" strmessage = "Siting Fees to be billed report as of " & FormatDateTime(now(),1) & " Sorted By Listing Date, MLS" Case 2 sqltemp="SELECT * FROM Listings WHERE (Trim(Pending) = '" & "Sld" & "' AND Trim(solddate) <> '" & "" & "' AND invoicedate2 = '" & "" & "') OR (Trim(Pending) = '" & "Sld" & "' AND Trim(solddate) <> '" & "" & "' AND ISNULL(invoicedate2)) ORDER BY Cdate(Listings.solddate) DESC, Listings.MLS" strmessage = "Solds to be billed report as of " & FormatDateTime(now(),1) & " Sorted By Sold date, MLS" Case 3 sqltemp="SELECT * FROM Listings WHERE Trim(Pending) = '" & "Wth" & "' ORDER BY Cdate(Listings.solddate) DESC, Listings.MLS" strmessage = "Withdrawn / Expired Listings " & FormatDateTime(now(),1) & " Sorted By Withdrawn date" Case 4 sqltemp="SELECT * FROM Listings WHERE Trim(listingdate) <> '" & "" & "' AND invoicedate <> '" & "" & "' ORDER BY Cdate(Listings.invoicedate) DESC, Listings.MLS" strmessage = "Sit Fees Billed as of " & FormatDateTime(now(),1) & " Sorted By Invoice Date" Case 5 sqltemp="SELECT * FROM Listings WHERE Trim(listingdate) <> '" & "" & "' AND invoicedate2 <> '" & "" & "' ORDER BY Cdate(Listings.invoicedate2) DESC, Listings.MLS" strmessage = "Solds Billed as of " & FormatDateTime(now(),1) & " Sorted By Invoice Date" Case 6 sqltemp="SELECT * FROM Listings ORDER BY Listings.MLS ASC" strmessage = "All Current houseviewonline.com Listings as of " & FormatDateTime(now(),1) & " By MLS" Case 7 sqltemp="SELECT * FROM Listings ORDER BY Cdate(Listings.listingdate) DESC, Listings.MLS" strmessage = "All Current houseviewonline.com Listings as of " & FormatDateTime(now(),1) & " By Listing Date" Case 8 sqltemp="SELECT * FROM Listings WHERE Trim(Listings.shoottype) = '" & "0" & "' OR Trim(Listings.shoottype) = '" & "" & "' OR ISNULL(Listings.shoottype) ORDER BY Cdate(Listings.listingdate) DESC, Listings.MLS" strmessage = "Not Complete or N/A Listings as of " & FormatDateTime(now(),1) & " By Listing Date, MLS" Case 9 sqltemp="SELECT * FROM Listings WHERE Trim(listingdate) <> '" & "" & "' AND invoicedate2 <> '" & "" & "' AND Trim(Pending) = '" & "Sld" & "' ORDER BY Cdate(Listings.invoicedate2) DESC, Listings.MLS" strmessage = "Sold Listings, invoiced and Marked for Deletion as of " & FormatDateTime(now(),1) & " Sorted By Invoice2 Date
Compare with payment before deletion." Case 10 sqltemp="SELECT * FROM Listings WHERE Listings.invoicedate <> '" & "" & "' AND Grouping = " & Cint(Request("Group")) & " ORDER BY Cdate(Listings.invoicedate) DESC, Listings.MLS" strmessage = "Group " & Request("Group") & " Listings, Sit fees invoiced as of " & FormatDateTime(now(),1) & " Sorted By Invoice Date" Case Else sqltemp="SELECT * FROM Listings ORDER BY Listings.MLS ASC" strmessage = "All Current houseviewonline.com Listings as of " & FormatDateTime(now(),1) End Select mypage=request("whichpage") If mypage="" then mypage=1 end if mypagesize=request.form("pagesize") If mypagesize="" then mypagesize=100 end if mySQL=request("SQLquery") IF mySQL="" THEN mySQL=SQLtemp END IF set RecordSet=Server.CreateObject("ADODB.Recordset") RecordSet.cursorlocation=aduseclient RecordSet.cachesize=5 RecordSet.open mySQL,connectme If NOT RecordSet.BOF AND NOT RecordSet.EOF then RecordSet.movefirst RecordSet.pagesize=mypagesize maxpages=cint(RecordSet.pagecount) maxrecs=cint(RecordSet.pagesize) RecordSet.absolutepage=mypage howmanyrecs=0 howmanyfields=RecordSet.fields.count -1 End if If Request("Report") < 3 Then 'Open Agents Dataset to query for pre-bill and Split Billing Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\webroot\localuser\houseview\database\houseview.mdb;" sqlnew="SELECT * FROM Agents ORDER BY Agents.RealitorAbb ASC" Set RS = Connect.execute(sqlnew) End if Function FigureCost(strprice,strtype,strreport) If strreport = 1 OR strreport = 4 then If strtype = "1" Then FigureCost = 10 Elseif strtype = "2" Then FigureCost = 25 Elseif strtype = "3" Then FigureCost = 10 Elseif strtype = "4" Then FigureCost = 20 Elseif strtype = "0" Then FigureCost = 0 Else FigureCost = 0 End if ElseIf strreport = 2 OR strreport = 5 then If strtype = "1" Then If strprice =< 60000 Then FigureCost = 35 Elseif strprice > 60000 AND strprice =< 90000 Then FigureCost = 50 Elseif strprice > 90000 AND strprice =< 120000 Then FigureCost = 75 Elseif strprice > 120000 Then FigureCost = 100 End if Elseif strtype = "2" Then FigureCost = 25 Elseif strtype = "3" Then FigureCost = 10 Elseif strtype = "4" Then FigureCost = 20 Else FigureCost = 0 End if Else If strtype = "1" Then FigureCost = 10 Elseif strtype = "2" Then FigureCost = 25 Elseif strtype = "3" Then FigureCost = 10 Elseif strtype = "4" Then FigureCost = 20 Else FigureCost = 0 End if End if End Function %> housevew <% If RecordSet.BOF AND RecordSet.EOF then %>


No Current Records to Display....
<% RecordSet.close set RecordSet=nothing Response.End End if %>

<% Call PageNavBar %>
&ACTION=go" method="post"> <% If Request("Report") < 3 Then %> <% End if %> <% Dim strtotal strtotal = 0 Function GetShootType(shoottype) Select Case shoottype Case "0" GetShootType = "N/A" Case "1" GetShootType = "I/O" Case "2" GetShootType = "O/O" Case "3" GetShootType = "MLS" Case "4" GetShootType = "Rntl" Case Else GetShootType = "N/A" End Select End Function Function FlagShow(reporttype,groupingtype) FlagShow = " " If Request("Report") < 3 Then If Not RS.BOF Then RS.MoveFirst Do Until RS.EOF If LCase(Trim(RS.Fields("RealitorAbb"))) = LCase(Trim(groupingtype)) Then If Trim(RS.Fields("prebill")) = "Yes" Then If reporttype = 1 Then FlagShow = "" & RecordSet.Fields("ID") & "S" ElseIf reporttype = 2 Then FlagShow = "Pre-Bill?" End if End if 'genttitle = RS.Fields("AgentFirst") & " " & RS.Fields("AgentLast") & " of " & RS.Fields("RealitorDesc") End if If LCase(Trim(RS.Fields("RealitorAbb"))) = LCase(Trim(groupingtype)) Then Exit Do RS.MoveNext Loop End if End if End Function Dim bgcolor DO UNTIL RecordSet.eof OR howmanyrecs>=maxrecs if bgcolor = "#ffffff" then bgcolor = "#f5f5eb" else bgcolor = "#ffffff" end if if RecordSet.Fields("Pending") = "Yes" then bgcolor="Yellow" 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)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) IF Request("Report") = 3 then Response.Write(" " & Chr(13)) Else Response.Write(" " & Chr(13)) End if Response.Write(" " & Chr(13)) IF Request("Report") = 3 then Response.Write(" " & Chr(13)) Else Response.Write(" " & Chr(13)) End if If ISNULL(RecordSet.Fields("solddate")) OR RecordSet.Fields("solddate") = "" Then If Trim(RecordSet.Fields("Pending")) = "Wth" Then Response.Write(" " & Chr(13)) Elseif Trim(RecordSet.Fields("Pending")) = "Yes" Then Response.Write(" " & Chr(13)) Elseif Trim(RecordSet.Fields("Pending")) = "No" Then Response.Write(" " & Chr(13)) Elseif Trim(RecordSet.Fields("Pending")) = "Rtd" Then Response.Write(" " & Chr(13)) Elseif Trim(RecordSet.Fields("Pending")) = "Ntd" Then Response.Write(" " & Chr(13)) End if Else Response.Write(" " & Chr(13)) End if IF Request("Report") = 4 OR Request("Report") = 1 OR Request("Report") = 10then Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Elseif Request("Report") = 5 OR Request("Report") = 2 then Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Else Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) End if If Request("Report") < 3 AND Trim(RecordSet.Fields("shoottype")) <> "0" Then Response.Write(" " & Chr(13)) If Request("Report") = 2 OR Request("Report") = 5 OR ISDate(RecordSet.Fields("invoicedate2")) Then Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Else Response.Write("" & Chr(13)) Response.Write(" " & Chr(13)) End if Else Response.Write("" & Chr(13)) End if Response.Write("" & Chr(13)) If Trim(RecordSet.Fields("listingnotes")) <> "" OR NOT ISNULL(RecordSet.Fields("listingnotes"))Then Response.Write("" & Chr(13)) End if strtotal = strtotal + FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),Request("Report")) RecordSet.movenext howmanyrecs=howmanyrecs+1 LOOP %> <% If Request("Report") < 3 Then %> <% End if %>
<%=strmessage%> <%=mypage%> of <%=maxpages%>
MLS# Price Bd Bt Location Address Agent Type Status Created Date Sld/Exp/Wth Date Days Active Inv 1 Date Inv 2 DatePrice Inv# Mrk SInv#
" & RecordSet.Fields("MLS") & "" & FormatCurrency(RecordSet.Fields("price"),0,0) & "" & RecordSet.Fields("Bdrm") & "" & RecordSet.Fields("Bthrm") & "" & RecordSet.Fields("Location") & "" & RecordSet.Fields("Address") & "" & RecordSet.Fields("RealitorAbb") & "" & GetShootType(RecordSet.Fields("shoottype")) & "" & RecordSet.Fields("Pending") & "" & RecordSet.Fields("Pending") & "" & RecordSet.Fields("listingdate") & "" & RecordSet.Fields("solddate") & "" & RecordSet.Fields("solddate") & "N/AActvActvRtlN-Rtl" & DateDiff("D",RecordSet.Fields("listingdate"),RecordSet.Fields("solddate")) & "" & RecordSet.Fields("invoicedate") & "" & RecordSet.Fields("invoicedate2") & "" & RecordSet.Fields("invoicedate") & "" & RecordSet.Fields("invoicedate2") & "" & RecordSet.Fields("invoicedate") & "" & RecordSet.Fields("invoicedate2") & "" & FormatCurrency(FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),Request("Report")),0,0) & "" & RecordSet.Fields("ID")) Response.Write("S") Else Response.Write(" " & RecordSet.Fields("ID")) End if Response.Write("" & Chr(13)) If RecordSet.Fields("shoottype") = 2 OR RecordSet.Fields("shoottype") = 4 then Response.Write(" " & FlagShow(Request("Report"),RecordSet.Fields("RealitorAbb")) & "    
" & RecordSet.Fields("listingnotes") & "
Total to be billed: <%=FormatCurrency(strtotal,0,0)%>

<% RecordSet.close set RecordSet=nothing If Request("Report") < 3 Then Connect.Close Set Connect = Nothing Set RS = Nothing End if Call PageNavBar sub PageNavBar() pad="" scriptname=request.servervariables("script_name") response.write "" response.write "" response.write "
" response.write "" if (mypage mod 10) = 0 then counterstart = mypage - 9 else counterstart = mypage - (mypage mod 10) + 1 end if counterend = counterstart + 9 if counterend > maxpages then counterend = maxpages if counterstart <> 1 then ref="First : " Response.Write ref ref="Previous " Response.Write ref end if Response.Write "Jump to page[" for counter=counterstart to counterend If counter>=10 then pad="" end if if cstr(counter) <> mypage then ref="" & pad & counter & "" else ref="" & pad & counter & "" end if response.write ref if counter <> counterend then response.write " " next Response.Write "]" if counterend <> maxpages then ref=" Next" Response.Write ref ref=" : Last" Response.Write ref end if response.write "
" response.write "
" end sub %>