<% Response.Buffer = True If Request.Cookies("Webmaster") <> "Validated" Then Response.Redirect("/ctrfiles/stats/login.asp") End if Dim MyFile,objFSO,MyOutStream Set objFSO = Server.CreateObject("Scripting.FileSystemObject") MyFile = Server.MapPath("/database/houseview.mdb") Dim DataConnection, cmdDC, RecordSet Dim RecordToEdit, Updated Set DataConnection = Server.CreateObject("ADODB.Connection") DataConnection.ConnectionTimeout = 20 DataConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & MyFile & ";" 'Sql Server Connection String------------------------- 'DataConnection.Open "Driver={SQL Server};Server=208.18.48.246;Database=houseviewonline;Uid=houseviewonline;Pwd=supernova04;" Set cmdDC = Server.CreateObject("ADODB.Command") cmdDC.ActiveConnection = DataConnection SQL = "SELECT Listings.ID, Listings.* FROM Listings WHERE (((Listings.ID)=" & Request.QueryString("ID") & "));" cmdDC.CommandText = SQL Set RecordSet = Server.CreateObject("ADODB.Recordset") RecordSet.Open cmdDC, , 2, 2 If Request.Form("btnUpdate") = "Update" Then if Request.Form("RealitorAbb") = "" then Response.Write("
You did not Include a Realitor
") Response.Write ("
") Response.End end if if Request.Form("Location") = "" then Response.Write("
You did not Include a Location
") Response.Write ("
") Response.End end if if Request.Form("price") = "" then Response.Write("
You did not Include a Price
") Response.Write ("
") Response.End end if if Request.Form("PriceCat") = "" then Response.Write("
You did not Include a Price Category
") Response.Write ("
") Response.End end if if Request.Form("MLS") = "" then Response.Write("
You did not Include a MLS#
") Response.Write ("
") Response.End end if if Request.Form("Bdrm") = "" then Response.Write("
You did not Include a Bedroom Count
") Response.Write ("
") Response.End end if if Request.Form("Bthrm") = "" then Response.Write("
You did not Include a Bathroom Count
") Response.Write ("
") Response.End end if if Request.Form("Grouping") = "" then Response.Write("
You did not Include a Agent Code
") Response.Write ("
") Response.End 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 Dim strnewmls strnewmls = Trim(Replace(Request.Form("MLS"),",","")) If Trim(RecordSet.Fields("MLS")) <> strnewmls Then If objFSO.folderexists(Server.MapPath("/images/" & RecordSet.Fields("MLS") & "/")) Then objFSO.MoveFolder Server.MapPath("/images/" & RecordSet.Fields("MLS")) , Server.MapPath("/images/" & strnewmls) Set WaitObj = Server.CreateObject ("WaitFor.Comp") WaitObj.WaitForSeconds 3 Set WaitObj = Nothing Set MyOutStream = objFSO.OpenTextFile(Server.MapPath("/images/" & strnewmls & "/" & strnewmls & ".asp"), 2, TRUE) MyOutStream.Write(Request.Form("new")) MyOutStream.Close If objFSO.FileExists(Server.MapPath("/ctrfiles/" & RecordSet.Fields("MLS") & ".cnt")) Then objFSO.deletefile(Server.MapPath("/ctrfiles/" & RecordSet.Fields("MLS") & ".cnt")) end if If objFSO.FileExists(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & ".txt")) Then objFSO.deletefile(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & ".txt")) end if End if If objFSO.FileExists(Server.MapPath("/images/" & strnewmls & "/" & RecordSet.Fields("MLS") & ".jpg")) Then Set Image = Server.CreateObject("AspImage.Image") Image.Loadimage Server.MapPath("/images/" & strnewmls & "/" & RecordSet.Fields("MLS") & ".jpg") Image.FileName = Server.MapPath("/images/" & strnewmls & "/" & strnewmls & ".jpg") Image.JPEGQuality = 100 Image.SaveImage Set Image = nothing End if If objFSO.FileExists(Server.MapPath("/images/" & strnewmls & "/" & RecordSet.Fields("MLS") & "sm.jpg")) Then Set Image = Server.CreateObject("AspImage.Image") Image.Loadimage Server.MapPath("/images/" & strnewmls & "/" & RecordSet.Fields("MLS") & "sm.jpg") Image.FileName = Server.MapPath("/images/" & strnewmls & "/" & strnewmls & "sm.jpg") Image.JPEGQuality = 100 Image.SaveImage Set Image = nothing End if Else Set MyOutStream = objFSO.OpenTextFile(Server.MapPath("/images/" & RecordSet.Fields("MLS") & "/" & RecordSet.Fields("MLS") & ".asp"), 2, TRUE) MyOutStream.Write(Request.Form("new")) MyOutStream.Close end if RecordSet.Fields("MLS") = strnewmls RecordSet.Fields("price") = Request.Form("price") RecordSet.Fields("PriceCat") = Request.Form("PriceCat") RecordSet.Fields("Bdrm") = Replace(Request.Form("Bdrm"),",","") RecordSet.Fields("Bthrm") = Replace(Request.Form("Bthrm"),",","") RecordSet.Fields("Location") = Request.Form("Location") RecordSet.Fields("RealitorAbb") = Request.Form("RealitorAbb") RecordSet.Fields("Pending") = Request.Form("Pending") If Request.Form("Pending") = "Sld" OR Request.Form("Pending") = "Wth" Then RecordSet.Fields("solddate") = strproperdate Else RecordSet.Fields("solddate") = Request.Form("solddate") End if RecordSet.Fields("Pano") = Request.Form("Pano") Filtereddesc = Trim(Request.Form("homedesc")) Filtereddesc = Replace(Filtereddesc,vbCrLf,"
") RecordSet.Fields("homedesc") = Filtereddesc RecordSet.Fields("address") = Replace(Request.Form("address"),",","") RecordSet.Fields("city") = Replace(Request.Form("city"),"'","''") RecordSet.Fields("state") = Replace(Request.Form("state"),"'","''") RecordSet.Fields("zip") = Replace(Request.Form("zip"),"'","''") RecordSet.Fields("externaltour") = Replace(Request.Form("externaltour"),"'","''") RecordSet.Fields("Grouping") = Request.Form("Grouping") RecordSet.Fields("listingdate") = Request.Form("listingdate") RecordSet.Fields("photographer") = Request.Form("photographer") RecordSet.Fields("invoicedate") = Request.Form("invoicedate") RecordSet.Fields("invoicedate2") = Request.Form("invoicedate2") RecordSet.Fields("shoottype") = Request.Form("shoottype") formatedlistingnotes = Request.Form("listingnotes") formatedlistingnotes = Replace(formatedlistingnotes,",","") formatedlistingnotes = Replace(formatedlistingnotes,vbCrLf," ") formatedlistingnotes = Replace(formatedlistingnotes,"'","''") RecordSet.Fields("listingnotes") = formatedlistingnotes RecordSet.Update Updated = "True" End If '-- Delete Button If Request.Form("btnDelete") = "Delete" and Request.Form("Deleteit") = "on" Then If Request.Form("Delefolder") = "on" Then If objFSO.FolderExists(Server.MapPath("/images/" & RecordSet.Fields("MLS") & "/")) Then objFSO.deleteFolder(Server.MapPath("/images/" & RecordSet.Fields("MLS") & "/")) end if If objFSO.FileExists(Server.MapPath("/ctrfiles/" & RecordSet.Fields("MLS") & ".cnt")) Then objFSO.deletefile(Server.MapPath("/ctrfiles/" & RecordSet.Fields("MLS") & ".cnt")) end if If objFSO.FileExists(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & ".txt")) Then objFSO.deletefile(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & ".txt")) end if End if RecordToDelete = Request.QueryString("ID") RecordSet.Delete Updated = "TrueDeleted" elseif Request.Form("btnDelete") = "Delete" and Request.Form("Deleteit") <> "on" Then Response.Write("
You Pressed Delete without Checking the Delete Checkbox, are sure you want to delete this?
") Response.Write ("
") Response.End 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 = "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 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 %>

  Administration Edit Listing::.

<% If Updated = "True" Then %> MLS# <%= RecordSet.Fields("MLS")%> has been updated.

<% End If %> <% If Updated = "TrueDeleted" Then %> Record <%= RecordToDelete %> has been Deleted!

<% Response.End End If %>

" method="post" name="addlisting"> Editing information for MLS#:<%=RecordSet.Fields("MLS")%>

<% Dim strchecked1,strchecked2,strchecked3,strchecked4,strchecked5,strchecked6,strchecked7,strchecked8 if RecordSet.Fields("Pending") = "No" then strchecked1 = "CHECKED" strchecked2 = "" strchecked3 = "" strchecked4 = "" strchecked7 = "" strchecked8 = "" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Yes" then strchecked1 = "" strchecked2 = "CHECKED" strchecked3 = "" strchecked4 = "" strchecked7 = "" strchecked8 = "" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Wth" then strchecked1 = "" strchecked2 = "" strchecked3 = "CHECKED" strchecked4 = "" strchecked7 = "" strchecked8 = "" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Sld" then strchecked1 = "" strchecked2 = "" strchecked3 = "" strchecked4 = "CHECKED" strchecked7 = "" strchecked8 = "" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Rtd" then strchecked1 = "" strchecked2 = "" strchecked3 = "" strchecked4 = "" strchecked7 = "CHECKED" strchecked8 = "" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Ntd" then strchecked1 = "" strchecked2 = "" strchecked3 = "" strchecked4 = "" strchecked7 = "" strchecked8 = "CHECKED" strchecked9 = "" elseif RecordSet.Fields("Pending") = "Stg" then strchecked1 = "" strchecked2 = "" strchecked3 = "" strchecked4 = "" strchecked7 = "" strchecked8 = "" strchecked9 = "CHECKED" else strchecked1 = "" strchecked2 = "" strchecked3 = "" strchecked4 = "" strchecked7 = "" strchecked8 = "" strchecked9 = "" end if if RecordSet.Fields("Pano") = "Yes" then strchecked5 = "CHECKED" strchecked6 = "" elseif RecordSet.Fields("Pano") = "No" then strchecked5 = "" strchecked6 = "CHECKED" else strchecked5 = "" strchecked6 = "" end if %> <% Dim stmarker0,stmarker1,stmarker2,stmarker3 If ISNULL(Trim(RecordSet.Fields("shoottype"))) OR Trim(RecordSet.Fields("shoottype")) = "" Then stmarker0 = " SELECTED" stmarker1 = "" stmarker2 = "" stmarker3 = "" Else Select Case Trim(RecordSet.Fields("shoottype")) Case "0" stmarker0 = " SELECTED" stmarker1 = "" stmarker2 = "" stmarker3 = "" stmarker4 = "" Case "1" stmarker0 = "" stmarker1 = " SELECTED" stmarker2 = "" stmarker3 = "" stmarker4 = "" Case "2" stmarker0 = "" stmarker1 = "" stmarker2 = " SELECTED" stmarker3 = "" stmarker4 = "" Case "3" stmarker0 = "" stmarker1 = "" stmarker2 = "" stmarker3 = " SELECTED" stmarker4 = "" Case "4" stmarker0 = "" stmarker1 = "" stmarker2 = "" stmarker3 = "" stmarker4 = " SELECTED" End Select End if %>
MLS#: " class="grey">
Price: " class="grey">
Price Category:
(1)=$0-100k, (2)=$100-200K, (3)=$200K+, (4)=Land, (5)=Commercial, (6)=Rental, (7)=Sub-Div
Agent:
location:
Group Code: " size="2" class="grey">
Address: " class="grey">
City: " class="grey">
State: " class="grey">
Zip: " class="grey">
Bedrooms: " class="grey">
Bathrooms: " class="grey">
Listing Status: OnClick="javascript:placeorigdata()">Normal OnClick="javascript:placeorigdata()">Pending OnClick="javascript:placesolddata()">Withdrawn/Expired OnClick="javascript:placesolddata()">Sold OnClick="javascript:placesolddata()">Rented OnClick="javascript:placeorigdata()">Not-Rented OnClick="javascript:placeorigdata()">Staged
Inside or Pano's >Yes >No
External Tour: " class="grey">
Home Description:
/<%=RecordSet.Fields("MLS")%>.asp?MLS=<%=RecordSet.Fields("MLS")%>" TARGET=_blank>View MLS#<%=RecordSet.Fields("MLS")%>
Date Record Created: " class="grey"> <% If IsNULL(Trim(RecordSet.Fields("listingdate"))) OR Trim(RecordSet.Fields("listingdate")) = "" Then Strlastmoddate = FormatDateTime(objFSO.GetFile(Server.MapPath("/images/" & RecordSet.Fields("MLS") & "/" & RecordSet.Fields("MLS") & ".asp")).DateLastModified,1) %> Choose Date Last Modified on: <%=Strlastmoddate%> <% End if %>
Photographer: " class="grey">
Shoot Type:
Date 1st Invoiced: " class="grey"> Choose Date
&Report=1&Amt=<%=FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),1)%>&S=no&ID=<%=RecordSet.Fields("ID")%>&date=<%=RecordSet.Fields("Listingdate")%>&DB=no" TARGET=_blank>Reprint 1st Invoice
Date 2nd Invoiced: " class="grey"> Choose Date
<% If Trim(RecordSet.Fields("shoottype")) = "2" Then %> &Report=1&Amt=<%=FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),2)%>&S=no&ID=<%=RecordSet.Fields("ID")%>&date=<%=RecordSet.Fields("Listingdate")%>&DB=yes" TARGET=_blank>Reprint 2nd PRE-BILL Invoice
&Report=1&Amt=<%=FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),2)%>&S=no&ID=<%=RecordSet.Fields("ID")%>&date=<%=RecordSet.Fields("Listingdate")%>" TARGET=_blank>Reprint 2nd Invoice <% Else %> &Report=2&Amt=<%=FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),2)%>&S=yes&ID=<%=RecordSet.Fields("ID")%>&date=<%=RecordSet.Fields("Listingdate")%>&DB=yes" TARGET=_blank>Reprint 2nd PRE-BILL Invoice
&Report=2&Amt=<%=FigureCost(RecordSet.Fields("price"),RecordSet.Fields("shoottype"),2)%>&S=yes&ID=<%=RecordSet.Fields("ID")%>&date=<%=RecordSet.Fields("Listingdate")%>" TARGET=_blank>Reprint 2nd Invoice <% End if %>
Date Sold/Withdrawn/Expired: " class="grey"> Choose Date
Listing Notes:
Edit MLS# Page:

Delete
Delete Folder?


Add/Replace Images/Files to MLS#<%= RecordSet.Fields("MLS")%>?
 " TARGET="Files" TITLE="Add New Images or Files" onClick="javascript:document.all.Files.style.height='300px';">Add Files   " TARGET="Files" TITLE="Edit Image Display Pages" onClick="javascript:document.all.Files.style.height='1500px';">Edit Images   " onclick="NewWindowB(this.href,'Images','650','480','yes');return false" onfocus="this.blur()">Edit Images Wide 


<% Set objFSO = Nothing RecordSet.Close Set RecordSet = Nothing Set cmdDC = Nothing DataConnection.Close Set DataConnection = Nothing %>