<% strUserName = request("Id") 'strUserName = session("UserName2") Response.Expires = 0 Response.Buffer = True ' Create a recordset object to store specific table information Set objRS = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From TblLogin where (UserName = '" + strUserName + "')" 'Set the recordset object equal to the SQL query string objRS.Open SQL, objADO, 1, 3 'Retrieving database info. strUserName = objRs.Fields("UserName") strPassword = objRs.Fields("Password") strFirstName = objRs.Fields("FirstName") strLastName = objRs.Fields("LastName") strCompany = objRs.Fields("AgencyName") strWebsite = objRs.Fields("Website") strAddress = objRs.Fields("Address") strCity = objRs.Fields("City") strState = objRs.Fields("State") strZip = objRs.Fields("Zip") strCountry = objRs.Fields("Country") strPhoneNumber = objRs.Fields("PhoneNumber") strFaxNumber = objRs.Fields("FaxNumber") strCell = objRs.Fields("CellPhone") strPager = objRs.Fields("Pager") strEmailAddress = objRs.Fields("EmailAddress") 'strDescription = objRs.Fields("AgentDescription") strAccessLevel = objRs.Fields("AccessLevel") strUploadPic = objRs.Fields("AgentPicture") 'Retrieving form input and assigning to a variable 'txtLastName is the name of the text box on the form 'strUserName2 = Request.Form ("txtUserName") strPassword2 = Request.Form("txtPassword") strLastName2 = Request.Form ("txtLastName") strFirstName2 = Request.Form("txtFirstName") strCompany2 = Request.Form ("txtAgencyName") strWebsite2 = Request.Form ("txtWebsite") strAddress2 = Request.Form("txtAddress") strCity2 = Request.Form("txtCity") strState2 = Request.Form("cboState") strZip2 = Request.Form("txtZip") strCountry2 = Request.Form ("Country") strPhoneNumber2 = Request.Form("txtPhoneNumber") strCell2 = Request.Form ("txtCell") strPager2 = Request.Form ("txtPager") strFaxNumber2 = Request.Form("txtFaxNumber") strEmailAddress2 = Request.Form("txtEmailAddress") 'strDescription2 = Request.Form ("txtDescription") strUploadPic2 = Request.Form("radUploadPic") 'This code only runs if the submit button is clicked if Request.Form <> "" then 'Sets an error message if any required fields are left blank if strPassword2 = "" or strLastName2 = "" or strFirstName2 = "" or strCompany2 = "" or strAddress2 = "" or strcity2 = "" or strState2 = "" or strZip2 = "" or strCountry2 = ""or strPhoneNumber2 = "" or strEmailAddress2 = "" then WarningErrMsg = "
Fields marked with an * are required." end if if not isnumeric(strPhoneNumber2) and strPhoneNumber2 <> "" then warningErrMsg = WarningErrMsg + "
Phone # can only contain numbers." end if if strPhoneNumber2 <> "" and len(strPhoneNumber2)<> "10" then warningErrMsg = WarningErrMsg + "
Phone # must contain 10 digits. Please include the area Code." end if if not isnumeric(strFaxNumber2) and strFaxNumber2 <> "" then warningErrMsg = WarningErrMsg + "
Fax # can only contain numbers." end if if strFaxNumber2 <> "" and len(strFaxNumber2)<> "10" then warningErrMsg = WarningErrMsg + "
Fax # must contain 10 digits. Please include the area Code." end if 'Checks for a valid email address if strEmailAddress2 <> "" and (instr( strEmailAddress2, "@") = 0 or instr( strEmailAddress2, ".") = 0) then WarningErrMsg = WarningErrMsg + "
Email Address must be in the form account@server.com." end if 'If error message was not set, then all error checks were passed; Connect to the database if warningErrMsg = "" then ' objRs.Fields("UserName") = strUserName2 objRs.Fields("Password") = strPassword2 objRs.Fields("LastName") = strLastName2 objRs.Fields("FirstName") = strFirstName2 objRs.Fields("AgencyName") = strCompany2 objRs.Fields("AgentDescription") = strDescription2 objRs.Fields("Website") = strWebsite2 objRs.Fields("Address") = strAddress2 objRs.Fields("City") = strCity2 objRs.Fields("State") = strState2 objRs.Fields("Zip") = strZip2 objRs.Fields("Country") = strCountry2 objRs.Fields("PhoneNumber") = strPhoneNumber2 objRs.Fields("FaxNumber") = strFaxNumber2 objRs.Fields("CellPhone") = strCell2 objRs.Fields("Pager") = strPager2 objRs.Fields("EmailAddress") = strEmailAddress2 objRs.Fields("AccessLevel") = "1" objRs.update 'if no error and if want to upload pic of self now do so if strUploadPic2 = "1" then Response.Redirect "AgentPicUpload.asp?Id=" & objRs("LoginId") end if Response.redirect "accountupdated.asp" end if end if %>

EDIT ADMIN ACCOUNT

Edit the user account information below.
Fields marked with an * are required.

<% if WarningErrMsg <> "" then %>
Error(s):<%= warningErrMsg %>
<% end if %>
User Name: <%= objRs.Fields("UserName") %>
Password: * <% if request.form <> "" then %> <% else %> " size="20"> <% end if %>
First Name: * <% if request.form <> "" then %> <% else %> <% end if %>
Last Name: * <% if request.form <> "" then %> <% else %> <% end if %>
Company: * <% if request.form <> "" then %> <% else %> <% end if %>
Website:full url <% if request.form <> "" then %> <% else %> <% end if %>
Address: * <% if request.form <> "" then %> <% else %> <% end if %>
City: * <% if request.form <> "" then %> <% else %> <% end if %>
State/Province:* <% sSQL = "SELECT * FROM TblStates order by StateId ASC" Set rsState = Server.CreateObject("ADODB.Recordset") rsState.Open sSQL, objADO, 3, 3 %>
Zip Code: * <% if request.form <> "" then %> <% else %> <% end if %>
Country:* <% sSQL = "SELECT * FROM TblCountries order by Country_Id ASC" Set rsCountry = Server.CreateObject("ADODB.Recordset") rsCountry.Open sSQL, objADO, 3, 3 %>
Email Address: * <% if request.form <> "" then %> <% else %> <% end if %>
Phone #: * <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
Cell #: <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
Pager: <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
Fax #: <% if request.form <> "" then %> <% else %> <% end if %> (Numbers Only) (Include Area Code)
<% if objRs("AgentPicture") <> "" then %> There is already a personal picture uploaded for this account. Do you want to edit it? <% else %> Upload a personal picture to be placed along property listings? <% end if %>
<% if objRs("AgentPicture") <> "" then %> Yes No <% else %> Yes No <% end if %>