%@LANGUAGE="VBSCRIPT"%> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% ' *** Edit Operations: declare variables MM_editAction = CStr(Request("URL")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Request.QueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Delete Record: declare variables if (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then MM_editConnection = MM_conRemax_STRING MM_editTable = "homes" MM_editColumn = "HomeID" MM_recordId = "" + Request.Form("MM_recordId") + "" MM_editRedirectUrl = "okaypage.asp" ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If End If %> <% ' *** Delete Record: construct a sql delete statement and execute it If (CStr(Request("MM_delete")) <> "" And CStr(Request("MM_recordId")) <> "") Then ' create the sql delete statement MM_editQuery = "delete from " & MM_editTable & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the delete Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% Dim combo__HomePick combo__HomePick = "1" if (Request.QueryString("HomeID") <> "") then combo__HomePick = Request.QueryString("HomeID") %> <% set combo = Server.CreateObject("ADODB.Recordset") combo.ActiveConnection = MM_conRemax_STRING combo.Source = "SELECT agents.AgentName, agents.AgentSurname, homes.* FROM agents, homes WHERE agents.AgentID = homes.AgentID and homes.HomeID = " + Replace(combo__HomePick, "'", "''") + "" combo.CursorType = 0 combo.CursorLocation = 2 combo.LockType = 3 combo.Open() combo_numRows = 0 %> <% Dim combo_2ndagent__HomePick combo_2ndagent__HomePick = "1" if (Request.QueryString("HomeID") <> "") then combo_2ndagent__HomePick = Request.QueryString("HomeID") %> <% set combo_2ndagent = Server.CreateObject("ADODB.Recordset") combo_2ndagent.ActiveConnection = MM_conRemax_STRING combo_2ndagent.Source = "SELECT agents.AgentName, agents.AgentSurname FROM agents, homes WHERE agents.AgentID = homes.AgentID2 and homes.HomeID = " + Replace(combo_2ndagent__HomePick, "'", "''") + "" combo_2ndagent.CursorType = 0 combo_2ndagent.CursorLocation = 2 combo_2ndagent.LockType = 3 combo_2ndagent.Open() combo_2ndagent_numRows = 0 %>
![]() |
|||
|
<% combo.Close() %> <% combo_2ndagent.Close() %>