<% Response.Buffer = True %> <% If Session("houseviewlogin") = "" OR Session("houseviewpass") = "" OR Session("houseviewgroup") = "" then Response.Redirect "login.asp" End If Dim sortdata, groupingdata sortdata = Session("houseviewAbb") if sortdata = "" then response.redirect ("login.asp") end if groupingdata = Session("houseviewgroup") %> <%=strtitle%>
<%=straddress%> <%=strtitle%> Billing
Currently Logged in: <%=Session("houseviewlogin")%> of <%=Session("houseviewAgency")%>
Outstanding Billing

<%StatWriteMenu%> <%=Session("houseviewAbb")%>  of:  <%=Session("houseviewAgency")%>  Outstatnding <%=GetReportType(Request("RPT"))%> Invoices
<% Dim MyFile MyFile = Server.MapPath("/database/houseview.mdb") connectme="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & MyFile & ";" if Request("RPT") = 1 Then sqltemp="SELECT * FROM Listings WHERE (Trim(Pending) = '" & "Sld" & "' AND Trim(solddate) <> '" & "" & "' AND invoicedate2 = '" & "" & "' AND Trim(LCase(RealitorAbb)) = '" & Trim(LCase(sortdata)) & "' ) OR (Trim(Pending) = '" & "Sld" & "' AND Trim(solddate) <> '" & "" & "' AND ISNULL(invoicedate2) AND Trim(LCase(RealitorAbb)) = '" & Trim(LCase(sortdata)) & "' ) ORDER BY Cdate(Listings.solddate) DESC, Listings.MLS" Elseif Request("RPT") = 2 Then sqltemp="SELECT * FROM Listings WHERE (Trim(listingdate) <> '" & "" & "' AND invoicedate = '" & "" & "' AND Trim(LCase(RealitorAbb)) = '" & Trim(LCase(sortdata)) & "' ) OR (Trim(listingdate) <> '" & "" & "' AND ISNULL(invoicedate) AND Trim(LCase(RealitorAbb)) = '" & Trim(LCase(sortdata)) & "' ) ORDER BY Cdate(Listings.Listingdate) DESC, Listings.MLS ASC" End if 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 Function FigureCost(strprice,strtype,strreport) If strreport = 2 then If strtype = "1" Then FigureCost = 10 Elseif strtype = "2" Then FigureCost = 25 Elseif strtype = "3" Then FigureCost = 10 Elseif strtype = "0" Then FigureCost = 0 Else FigureCost = 0 End if ElseIf strreport = 1 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 Else FigureCost = 0 End if Else If strtype = "1" Then FigureCost = 10 Elseif strtype = "2" Then FigureCost = 25 Elseif strtype = "3" Then FigureCost = 10 Else FigureCost = 0 End if End if End Function 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 Else GetShootType = "N/A" End Select End Function Function GetReportType(ReportType) Select Case ReportType Case "2" GetReportType = "SITTING FEE" Case "1" GetReportType = "PROPERTY SOLD" End Select End Function DO UNTIL RecordSet.eof OR howmanyrecs>=maxrecs if bgcolor = "#ffffff" then bgcolor = "#f5f5eb" else bgcolor = "#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)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) 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)) End if Else Response.Write(" " & Chr(13)) End if Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) Response.Write(" " & Chr(13)) If Request("RPT") = 1 Then Response.Write(" " & Chr(13)) Response.Write("" & Chr(13)) RecordSet.movenext howmanyrecs=howmanyrecs+1 LOOP %>
MLS# Price Bed Bath Location Address Agent Shoot Status Date Added Sld/Exp/Wth Date Days Active Sit Fee Billed Sold Billed Ammt. Due Invoice
" & 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("listingdate") & "" & RecordSet.Fields("solddate") & "N/AActvActv" & DateDiff("D",RecordSet.Fields("listingdate"),RecordSet.Fields("solddate")) & "" & RecordSet.Fields("invoicedate") & "" & RecordSet.Fields("invoicedate2") & "" & FormatCurrency(FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),Request("RPT")),0,0) & "" & RecordSet.Fields("ID")) Response.Write("S") Else Response.Write(" " & RecordSet.Fields("ID")) End if Response.Write("
<% Call PageNavBar %>
<% RecordSet.close set RecordSet=nothing Response.End 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 %>