<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Dim cn : Set cn = Server.CreateObject("ADODB.Connection") '------------------------------- ' Create database connection string, login and password variables '------------------------------- Dim strConn, strLogin, strPassword strConn = "Driver={MySQL};DATABASE=fairla2_xmb3;UID=fairla2_issue;PASSWORD=coconuts" %> Fair Lakes Condominium - Contact Management
<% success = 0 '------------------------------- ' Lookup field in the database based on provided criteria ' Input: Table (Table), Field Name (fName), criteria (sWhere) '------------------------------- function DLookUp(Table, fName, sWhere) on error resume next Dim Res : Res = cn.execute("select " & fName & " from " & Table & " where " & sWhere).Fields(0).Value if IsNull(Res) then Res = "" DLookUp = Res if bDebug then response.write err.Description on error goto 0 end function function ToHTML(strValue) if IsNull(strValue) then ToHTML = "" else ToHTML = Server.HTMLEncode(strValue) end if end function If "Comment"=Request("ActionType") Then Response.Write("

") If Request.Form("name") = "" Then Response.Write("
Please enter your name.") validation_error = 1 End If If Request.Form("email") = "" OR InStr(1, Request.Form("email"), "@", vbTextCompare) = 0 Then Response.Write("
Please enter a valid email address.") validation_error = 1 End If If Left(Request.Form("address_number"), 2) <> "12" Then Response.Write("
The address number is not valid.") validation_error = 1 End If If NOT IsNumeric(Request.Form("address_number")) OR Request.Form("address_number") < "12600" OR Request.Form("address_number") > "12800" Then Response.Write("
The address number is not valid. All addresses are on Fair Crest Court. If your address is not Fair Crest Court, this Web site is not the correct one for your community.") validation_error = 1 End If If NOT IsNumeric(Request.Form("unit_number")) AND NOT Request.Form("unit_number") = "" Then Response.Write("
The unit number is not valid.") validation_error = 1 End If If validation_error = 0 Then Set cn = Server.CreateObject("ADODB.Connection") cn.open strConn addressNumber = Request.Form("address_number") unitNumber = Request.Form("unit_number") IF unitNumber <> "" THEN addressNumber = addressNumber + "/" + unitNumber END IF addrAndSubject = addressNumber + " " + Request.Form("subject") 'issueDesc = Request.Form("comments") Set newMsg = CreateObject("CDONTS.NewMail") newMsg.BodyFormat=0 newMsg.From=Request.Form("email") newMsg.To="management@fairlakescondo.com" newMsg.Subject = "FLCA Web Inquiry" mailBody = "
Name: " + Request.Form("name") issueBody = "Name: " + Request.Form("name") unitNumber = request.form("unit_number") fullAddress= Request.Form("address_number") if unitNumber <> "" THEN fullAddress = fullAddress + " #" + unitNumber END IF mailBody = mailBody + "
Address: " + fullAddress issueBody= issueBody + VBcrlf + "Address: " + Request.Form("address_number") + " #" + Request.Form("unit_number") mailBody = mailBody + "
E-Mail: " + Request.Form("email") issueBody= issueBody + VBcrlf + "E-Mail: " + Request.Form("email") If Request.Form("contact_me") = "true" Then mailBody = mailBody + "
I would like to be contacted regarding this comment/concern.

" issueBody = issueBody + VBcrlf + "I would like to be contacted regarding this comment/concern." + VBcrlf + VBcrlf End If mailBody = mailBody + "

" issueBody = issueBody + VBcrlf + VBcrlf mailBody = mailBody + "Comment/Concern:
" + Replace(Request.Form("comments"), "'", "''") issueBody = issueBody + "Comment/Concern:" + VBcrlf + Replace(Request.Form("comments"), "'", "''") If Request.Form("address_number") = "126XX" AND Request.Form("unit_number") = "303" THEN 'Don't log the issue in the tracker, just send the email TO BOARD newMsg.To="directors@fairlakescondo.com" mailBody = replace(mailBody,vbcrlf,"
") + "" newMsg.Body = mailBody newMsg.Send success = 1 response.write ("

Thank you for your comment/concern.

Your note will be forwarded to the Management Company.

Return to the Fair Lakes Condominium Home Page") 'Send a receipt to the person who wrote the email Set newMsg = CreateObject("CDONTS.NewMail") newMsg.BodyFormat=0 newMsg.From="do-not-reply@fairlakescondo.com" newMsg.To = Request.Form("email") newMsg.BCc = "robb.moskowitz@fairlakescondo.com" newMsg.Subject = Request.Form("subject") mailBody = "An Issue has been created on your behalf. Thank you.
" mailBody = "" & mailBody & "" newMsg.Body = mailBody newMsg.Send Set newMsg = nothing 'End Don't log the issue in the tracker, just send the email ELSE 'Insert the issue now so that we have an issue number for the email sSQL = "insert into issues (" & _ "issue_name," & _ "issue_desc," & _ "priority_id," & _ "status_id," & _ "assigned_to," & _ "date_submitted," & _ "user_id," & _ "assigned_to_orig)" & _ " values (" & _ "'" & addrAndSubject & "' ," & _ "'" & issueBody & "' ," & _ "3," & _ "1," & _ "1," & _ "DATE_ADD(SYSDATE(), INTERVAL 3 HOUR)," & _ "20," & _ "1" & _ ")" cn.Execute sSql 'Get the new issue number 'issueNumber = Dlookup("issues","max(issue_id)","user_id='20'") issueNumber = cn.execute("select max(issue_id) from issues where user_id=20").Fields(0).Value 'response.write(issueNumber) mailBody=mailBody + "

Respond to Unit Owner..." mailBody = replace(mailBody,vbcrlf,"
") + "" newMsg.Body = mailBody newMsg.Send success = 1 response.write ("

Thank you for your comment/concern.

Your note will be forwarded to the Management Company.

Return to the Fair Lakes Condominium Home Page") 'Send a receipt to the person who wrote the email Set newMsg = CreateObject("CDONTS.NewMail") newMsg.BodyFormat=0 newMsg.From="do-not-reply@fairlakescondo.com" newMsg.To = Request.Form("email") newMsg.BCc = "robb.moskowitz@fairlakescondo.com" newMsg.Subject = "Issue #" & issueNumber & ": " & Request.Form("subject") mailBody = "Issue #" & issueNumber & " has been created on your behalf. Thank you.
" mailBody = "" & mailBody & "" newMsg.Body = mailBody newMsg.Send Set newMsg = nothing END IF End If End If If success = 0 Then email_addr = Request.Form("email") If email_addr = "" Then email_addr = "12xxx" End If %>


Submit a Comment or Concern to SCS Management Company

Name:

Unit Number: #

Subject:

Comment/Concern:

E-Mail Address:

I would like to be contacted regarding this comment/concern.

<% End If %>