<% 'Broker reciprocity listing, get agency data ......................... Set OnAgency = connect.Execute("SELECT * FROM " & stragencytable & " WHERE grouping =" & Cint(Request.Querystring("GROUPING"))) If OnAgency.EOF AND OnAgency.BOF Then foundagencybol = False Else Dim agid,agagency,aggrouping,agaddress,agcity,agstate,agzip,agphone,agfax,agemail,agother,aglogo,agextra1,agextra2,agextra3,agextra4,agextra5 foundagencybol = True agid = OnAgency.Fields("id") agagency = OnAgency.Fields("agency") aggrouping = OnAgency.Fields("grouping") agaddress = OnAgency.Fields("address") agcity = OnAgency.Fields("city") agstate = OnAgency.Fields("state") agzip = OnAgency.Fields("zip") agphone = OnAgency.Fields("phone") agfax = OnAgency.Fields("fax") agemail = OnAgency.Fields("email") agother = OnAgency.Fields("other") aglogo = OnAgency.Fields("logo") agextra1 = OnAgency.Fields("extra1") agextra2 = OnAgency.Fields("extra2") agextra3 = OnAgency.Fields("extra3") agextra4 = OnAgency.Fields("extra4") agextra5 = OnAgency.Fields("extra5") End if Set OnAgency = Nothing If Request.Form("btnUpdate") = "Update" Then if Request.Form("MLS") = "" then Response.Write("
You did not a MLS Number
") Response.Write ("
") Response.End end if sqlstatement = "UPDATE " & strIHlistingstable & " Set MLS = '" & Request.Form("MLS") & "', "_ & " PRICE ='" & Request.Form("PRICE") & "', " _ & " CITY ='" & Request.Form("CITY") & "', " _ & " STATE ='" & Request.Form("STATE") & "', " _ & " ZIP ='" & Request.Form("ZIP") & "', " _ & " GROUPING ='" & Request.Form("GROUPING") & "', " _ & " AGENT ='" & Request.Form("agentlast") & "," & Request.Form("agentfirst") & "', " _ & " AGENTPHONE ='" & Request.Form("AGENTPHONE") & "', " _ & " OFFICE ='" & Replace(Request.Form("OFFICE"),"'","''") & "', " _ & " OFFICEPHONE ='" & Request.Form("OFFICEPHONE") & "', " _ & " NOTES ='" & Replace(Request.Form("NOTES"),"'","''") & "', " _ & " BATHFULL ='" & Request.Form("BATHFULL") & "', " _ & " BATHFULL ='" & Request.Form("BATHHALF") & "', " _ & " FEATURES ='" & Request.Form("FEATURES") & "', " _ & " TYPE1 ='" & Request.Form("TYPE1") & "', " _ & " TYPE2 ='" & Request.Form("TYPE2") & "', " _ & " BASEMENT ='" & Request.Form("BASEMENT") & "', " _ & " SQFT ='" & Request.Form("SQFT") & "', " _ & " AGE ='" & Request.Form("AGE") & "', " _ & " TYPE3 ='" & Request.Form("TYPE3") & "', " _ & " MASTERLEVEL ='" & Request.Form("MASTERLEVEL") & "', " _ & " AUX1 ='" & Request.Form("AUX1") & "', " _ & " AUX2 ='" & Request.Form("AUX2") & "', " _ & " AUX3 ='" & Request.Form("AUX3") & "', " _ & " AUX4 ='" & Request.Form("AUX4") & "', " _ & " AUX5 ='" & Request.Form("AUX5") & "', " _ & " AUX6 ='" & Request.Form("AUX6") & "', " _ & " STREETNUM ='" & Replace(Request.Form("STREETNUM"),"'","''") & "', " _ & " STREETDIRECTION ='" & Request.Form("STREETDIRECTION") & "', " _ & " STREETNAME ='" & Replace(Request.Form("STREETNAME"),"'","''") & "', " _ & " CATEGORY ='" & getpropercat(Request.Form("TYPE1")) & "', " _ & " ACTIVEDATE ='" & Year(date()) & "/"& Month(date()) & "/"& Day(date()) & "', " _ & " EXPIREDATE = '" & Request.Form("EXPIREDATE") & "' WHERE MLS =" & Request.QueryString("ID") Connect.execute(sqlstatement) Updated = "True" End if IF foundagencybol Then Dim DataConnection, cmdDC, RecordSet Dim RecordToEdit, Updated, sqlstatement Set DataConnection = Server.CreateObject("ADODB.Connection") DataConnection.ConnectionTimeout = 20 DataConnection.Open "IDX" Set cmdDC = Server.CreateObject("ADODB.Command") cmdDC.ActiveConnection = DataConnection SQL = "SELECT * FROM " & strIHlistingstable & " WHERE MLS=" & Request.QueryString("ID") cmdDC.CommandText = SQL Set RecordSet = Server.CreateObject("ADODB.Recordset") RecordSet.Open cmdDC, , 2, 2 function getpropercat(cattocheck) Select case cattocheck case "Residential" getpropercat = 2 case "Land" getpropercat = 3 case "Commercial/Industrial" getpropercat = 1 case "Multi-Family" getpropercat = 4 case "Other" getpropercat = 2 End Select End Function '-- Delete Button If Request.Form("btnDelete") = "Delete" and Request.Form("Deleteit") = "on" Then Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FileExists(Server.MapPath("/IDX/inhousepics/" & RecordSet.Fields("MLS") & ".jpg")) Then objFSO.deletefile(Server.MapPath("/IDX/inhousepics/" & RecordSet.Fields("MLS") & ".jpg")) end if If objFSO.FileExists(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & "oh.txt")) Then objFSO.deletefile(Server.MapPath("/ctrfiles/notes/" & RecordSet.Fields("MLS") & "oh.txt")) end if Set objFSO = Nothing Connect.execute("DELETE FROM " & strIHlistingstable & " WHERE MLS=" & Request.QueryString("ID")) 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 %> --Administration--
<% If Updated = "True" Then %> MLS# <%= RecordSet.Fields("MLS")%> has been updated.

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

<% RecordSet.Close Set RecordSet = Nothing Set cmdDC = Nothing DataConnection.Close Set DataConnection = Nothing Response.End End If %>
Edit In-House Listing # <%=RecordSet.Fields("MLS")%> ...
&GROUPING=<%=Request.Querystring("GROUPING")%>" method="post" name="addinhouselisting">
<% Set FSO = Server.CreateObject("Scripting.FileSystemObject") If FSO.FileExists(Server.MapPath("/IDX/inhousepics/" & RecordSet.Fields("MLS") & ".jpg")) Then %> .jpg" width="133" height="103" name="weblogourl0" id="weblogo0" Style="{cursor : pointer;}" ALT="Clcik to Add Agent Photo" OnClick="javascript:uploadlogo();"> <% Else %> Clcik to Add Agent Photo <% End if Set FSO = Nothing %> In-house Listing Number:
" class="grey" onKeyUp="if (!validatekeys(this.value)) alert('Not a Valid Liting Number. \n Entry Has to be whole numbers only without Punctuation. \n Please Correct this!')">
Price:
" class="grey" onKeyUp="if (!validatekeys(this.value)) alert('Not a Valid Price. \n Entry Has to be whole numbers only without a $ or Comma. \n Please Correct this!')">
City:
" class="grey">
State:
" class="grey" MAXLENGTH="2">
Zip:
" class="grey" MAXLENGTH="5" onKeyUp="if (!validatekeys(this.value)) alert('Not a Valid Zip Code. \n Entry Has to be whole numbers only without Punctuation. \n Please Correct this!')">
<% Dim stragentdata,stragentfirst,stragentlast stragentdata = Split(RecordSet.Fields("AGENT"), ",") stragentfirst = stragentdata(1) stragentlast = stragentdata(0) %> Agent First Name:
Agent Last Name:
Agent Phone:
" class="grey" MAXLENGTH="25">
Bedrooms:
" class="grey" MAXLENGTH="5">
Full Baths:
" class="grey" MAXLENGTH="5">
Half Baths:
" class="grey" MAXLENGTH="5">
Feature Category:
Selected Features:
" class="grey">
Property Class:
Property Type 1:
Property Type 2:
Basement:
Square Ft.:
" class="grey" MAXLENGTH="15">
Age:
" class="grey" MAXLENGTH="15">
Street #:
" class="grey" MAXLENGTH="15">
Dir:
Street Name:
" class="grey">
Property Description:
Listing Experation Date:
" class="grey" >

"> "> "> "> "> "> Delete

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

Unable to Locate Agency, please contatct youe systems administrator...

<% End if Connect.Close Set Connect = nothing %>