% 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
%>