<% Const EW_PAGE_ID = "add" Const EW_TABLE_NAME = "ClientInfo" %> <% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" ' Open connection to the database Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open EW_DB_CONNECTION_STRING ' Common page loading event (in userfn60.asp) Call Page_Loading() ' Page load event, used in current page Call Page_Load() Response.Buffer = True ' Load key values from QueryString Dim bCopy bCopy = True If Request.QueryString("ClientId").Count > 0 Then ClientInfo.ClientId.QueryStringValue = Request.QueryString("ClientId") Else bCopy = False End If ' Create form object Dim objForm Set objForm = New cFormObj ' Process form if post back If objForm.GetValue("a_add")&"" <> "" Then ClientInfo.CurrentAction = objForm.GetValue("a_add") ' Get form action Call LoadFormValues() ' Load form values ' Not post back Else If bCopy Then ClientInfo.CurrentAction = "C" ' Copy Record Else ClientInfo.CurrentAction = "I" ' Display Blank Record Call LoadDefaultValues() ' Load default values End If End If ' Close form object Set objForm = Nothing ' Perform action based on action code Select Case ClientInfo.CurrentAction Case "I" ' Blank record, no action required Case "C" ' Copy an existing record If Not LoadRow() Then ' Load record based on key Session(EW_SESSION_MESSAGE) = "No records found" ' No record found Call Page_Terminate(ClientInfo.ReturnUrl) ' Clean up and return End If Case "A" ' Add new record ClientInfo.SendEmail = True ' Send email on add success If AddRow() Then ' Add successful 'Send email SendEmail() Session(EW_SESSION_MESSAGE) = "Add New Record Successful" ' Set up success message Call Page_Terminate(ClientInfo.KeyUrl("../index.html", "")) ' Clean up and return Else Call RestoreFormValues() ' Add failed, restore form values End If End Select %> About Us_3community

<% If Session(EW_SESSION_MESSAGE) <> "" Then ' Mesasge in Session, display %>

<%= Session(EW_SESSION_MESSAGE) %>

<% Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session End If %>

*Denotes required fields. All others are optional.

First Name * Address 1
Last Name * Address 2
Email * City
Daytime Phone State
Cell Phone Zip
Country
How did you hear about us?

What is your best data and time to schedule an appointment for a tour? (Optional)

Appointment Date Pick a Date Pelican Point's Real Estate
Appointment Time Pick a Time! Golf Club

Please tell us more about your interests (price range, square footage, amenities): (Optional)

Price Range   to  
Square Footage   to  
Bedrooms
Baths
Comments

Experience first hand the real beauty and diversity of Pelican Point!
Email us, or call 225.746.1257 or 877.735.7646 to schedule your personal tour.

Model Homes & Sales Office Open 7 Days/Week
Monday-Friay 9 am-5 pm; Saturday 10 am-5 pm; Sunday 1 pm-5 pm

Sign Up to
     Stay Informed

 

 

 

 

 

 

<% ' If control is passed here, simply terminate the page without redirect Call Page_Terminate("") ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url, otherwise end response ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() conn.Close ' Close Connection Set conn = Nothing Set Security = Nothing Set ClientInfo = Nothing ' Go to url if specified If url <> "" Then Response.Clear Response.Redirect url End If ' Terminate response Response.End End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- %> <% ' Load default values Function LoadDefaultValues() End Function %> <% ' Load form values Function LoadFormValues() ' Load from form ClientInfo.FirstName.FormValue = objForm.GetValue("x_FirstName") ClientInfo.LastName.FormValue = objForm.GetValue("x_LastName") ClientInfo.Address1.FormValue = objForm.GetValue("x_Address1") ClientInfo.Address2.FormValue = objForm.GetValue("x_Address2") ClientInfo.City.FormValue = objForm.GetValue("x_City") ClientInfo.State.FormValue = objForm.GetValue("x_State") ClientInfo.Zip.FormValue = objForm.GetValue("x_Zip") ClientInfo.Phone.FormValue = objForm.GetValue("x_Phone") ClientInfo.AltPhone.FormValue = objForm.GetValue("x_AltPhone") ClientInfo.Email.FormValue = objForm.GetValue("x_Email") ClientInfo.Country.FormValue = objForm.GetValue("x_Country") ClientInfo.ContactPref.FormValue = objForm.GetValue("x_ContactPref") ClientInfo.HowHeard.FormValue = objForm.GetValue("x_HowHeard") ClientInfo.PriceRangeStart.FormValue = objForm.GetValue("x_PriceRangeStart") ClientInfo.PriceRangeEnd.FormValue = objForm.GetValue("x_PriceRangeEnd") ClientInfo.SQFtStart.FormValue = objForm.GetValue("x_SQFtStart") ClientInfo.SQFtEnd.FormValue = objForm.GetValue("x_SQFtEnd") ClientInfo.Bedrooms.FormValue = objForm.GetValue("x_Bedrooms") ClientInfo.Baths.FormValue = objForm.GetValue("x_Baths") ClientInfo.isRealEstate.FormValue = objForm.GetValue("x_isRealEstate") ClientInfo.isGolfClub.FormValue = objForm.GetValue("x_isGolfClub") ClientInfo.AppointmentDate.FormValue = objForm.GetValue("x_AppointmentDate") ClientInfo.AppointmentDate.CurrentValue = ew_UnFormatDateTime(ClientInfo.AppointmentDate.CurrentValue, 6) ClientInfo.AppointmentTime.FormValue = objForm.GetValue("x_AppointmentTime") ClientInfo.AppointmentTime.CurrentValue = ew_UnFormatDateTime(ClientInfo.AppointmentTime.CurrentValue, 4) ClientInfo.Comments.FormValue = objForm.GetValue("x_Comments") ClientInfo.Password.FormValue = objForm.GetValue("x_Password") End Function ' Restore form values Function RestoreFormValues() ClientInfo.FirstName.CurrentValue = ClientInfo.FirstName.FormValue ClientInfo.LastName.CurrentValue = ClientInfo.LastName.FormValue ClientInfo.Address1.CurrentValue = ClientInfo.Address1.FormValue ClientInfo.Address2.CurrentValue = ClientInfo.Address2.FormValue ClientInfo.City.CurrentValue = ClientInfo.City.FormValue ClientInfo.State.CurrentValue = ClientInfo.State.FormValue ClientInfo.Zip.CurrentValue = ClientInfo.Zip.FormValue ClientInfo.Phone.CurrentValue = ClientInfo.Phone.FormValue ClientInfo.AltPhone.CurrentValue = ClientInfo.AltPhone.FormValue ClientInfo.Email.CurrentValue = ClientInfo.Email.FormValue ClientInfo.Country.CurrentValue = ClientInfo.Country.FormValue ClientInfo.ContactPref.CurrentValue = ClientInfo.ContactPref.FormValue ClientInfo.HowHeard.CurrentValue = ClientInfo.HowHeard.FormValue ClientInfo.PriceRangeStart.CurrentValue = ClientInfo.PriceRangeStart.FormValue ClientInfo.PriceRangeEnd.CurrentValue = ClientInfo.PriceRangeEnd.FormValue ClientInfo.SQFtStart.CurrentValue = ClientInfo.SQFtStart.FormValue ClientInfo.SQFtEnd.CurrentValue = ClientInfo.SQFtEnd.FormValue ClientInfo.Bedrooms.CurrentValue = ClientInfo.Bedrooms.FormValue ClientInfo.Baths.CurrentValue = ClientInfo.Baths.FormValue ClientInfo.isRealEstate.CurrentValue = ClientInfo.isRealEstate.FormValue ClientInfo.isGolfClub.CurrentValue = ClientInfo.isGolfClub.FormValue ClientInfo.AppointmentDate.CurrentValue = ClientInfo.AppointmentDate.FormValue ClientInfo.AppointmentDate.CurrentValue = ew_UnFormatDateTime(ClientInfo.AppointmentDate.CurrentValue, 6) ClientInfo.AppointmentTime.CurrentValue = ClientInfo.AppointmentTime.FormValue ClientInfo.AppointmentTime.CurrentValue = ew_UnFormatDateTime(ClientInfo.AppointmentTime.CurrentValue, 4) ClientInfo.Comments.CurrentValue = ClientInfo.Comments.FormValue ClientInfo.Password.CurrentValue = ClientInfo.Password.FormValue End Function %> <% ' Load row based on key values Function LoadRow() Dim rs, sSql, sFilter sFilter = ClientInfo.SqlKeyFilter If Not IsNumeric(ClientInfo.ClientId.CurrentValue) Then LoadRow = False ' Invalid key, exit Exit Function End If sFilter = Replace(sFilter, "@ClientId@", ew_AdjustSql(ClientInfo.ClientId.CurrentValue)) ' Replace key value ' Call Row Selecting event Call ClientInfo.Row_Selecting(sFilter) ' Load sql based on filter ClientInfo.CurrentFilter = sFilter sSql = ClientInfo.SQL Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadRow = False Else LoadRow = True rs.MoveFirst Call LoadRowValues(rs) ' Load row values ' Call Row Selected event Call ClientInfo.Row_Selected(rs) End If rs.Close Set rs = Nothing End Function ' Load row values from recordset Sub LoadRowValues(rs) ClientInfo.ClientId.DbValue = rs("ClientId") ClientInfo.FirstName.DbValue = rs("FirstName") ClientInfo.LastName.DbValue = rs("LastName") ClientInfo.Address1.DbValue = rs("Address1") ClientInfo.Address2.DbValue = rs("Address2") ClientInfo.City.DbValue = rs("City") ClientInfo.State.DbValue = rs("State") ClientInfo.Zip.DbValue = rs("Zip") ClientInfo.Phone.DbValue = rs("Phone") ClientInfo.AltPhone.DbValue = rs("AltPhone") ClientInfo.Email.DbValue = rs("Email") ClientInfo.Country.DbValue = rs("Country") ClientInfo.ContactPref.DbValue = rs("ContactPref") ClientInfo.HowHeard.DbValue = rs("HowHeard") ClientInfo.PriceRangeStart.DbValue = rs("PriceRangeStart") ClientInfo.PriceRangeEnd.DbValue = rs("PriceRangeEnd") ClientInfo.SQFtStart.DbValue = rs("SQFtStart") ClientInfo.SQFtEnd.DbValue = rs("SQFtEnd") ClientInfo.Bedrooms.DbValue = rs("Bedrooms") ClientInfo.Baths.DbValue = rs("Baths") ClientInfo.isRealEstate.DbValue = ew_IIf(rs("isRealEstate"), "1", "0") ClientInfo.isGolfClub.DbValue = ew_IIf(rs("isGolfClub"), "1", "0") ClientInfo.AppointmentDate.DbValue = rs("AppointmentDate") ClientInfo.AppointmentTime.DbValue = rs("AppointmentTime") ClientInfo.Comments.DbValue = rs("Comments") ClientInfo.Password.DbValue = rs("Password") End Sub Function SendEmail() EmailFrom = "homes@livethepoint.com" EmailTo = "homes@livethepoint.com;jmcdaniel@baseline-tech.com;blair@tfxwebnet.com" Subject = "WEBSITE - New Appointment Request" ' prepare email body text Dim Body Body = Body & "First Name: " & ClientInfo.FirstName.CurrentValue & vbcrlf Body = Body & "Last Name: " & ClientInfo.LastName.CurrentValue & vbcrlf Body = Body & "Address 1: " & ClientInfo.Address1.CurrentValue & vbcrlf Body = Body & "Address 2: " & ClientInfo.Address2.CurrentValue & vbcrlf Body = Body & "City: " & ClientInfo.City.CurrentValue & vbcrlf Body = Body & "State: " & ClientInfo.State.CurrentValue & vbcrlf Body = Body & "Zip: " & ClientInfo.Zip.CurrentValue & vbcrlf Body = Body & "Daytime Phone: " & ClientInfo.Phone.CurrentValue & vbcrlf Body = Body & "Cell Phone: " & ClientInfo.AltPhone.CurrentValue & vbcrlf Body = Body & "Email Address: " & ClientInfo.Email.CurrentValue & vbcrlf Body = Body & "Country: " & ClientInfo.Country.CurrentValue & vbcrlf Body = Body & "How Heard: " & ClientInfo.HowHeard.CurrentValue & vbcrlf Body = Body & "Price Range: " & ClientInfo.PriceRangeStart.CurrentValue & " - " & ClientInfo.PriceRangeEnd.CurrentValue & vbcrlf Body = Body & "Square Feet: " & ClientInfo.SQFtStart.CurrentValue & " - " & ClientInfo.SQFtEnd.CurrentValue & vbcrlf Body = Body & "Bedrooms: " & ClientInfo.Bedrooms.CurrentValue & vbcrlf Body = Body & "Baths: " & ClientInfo.Baths.CurrentValue & vbcrlf Body = Body & "Real Estate: " & iif(ClientInfo.isRealEstate.CurrentValue = "1","Yes","No") & vbcrlf Body = Body & "Golf Club: " & iif(ClientInfo.isGolfClub.CurrentValue = "1","Yes","No") & vbcrlf Body = Body & "Appt. Date: " & ClientInfo.AppointmentDate.CurrentValue & vbcrlf Body = Body & "Appt. Time: " & ClientInfo.AppointmentTime.CurrentValue & vbcrlf Body = Body & "Comments: " & ClientInfo.Comments.CurrentValue & vbcrlf ' send email Dim mail Set mail = Server.CreateObject("CDO.Message") mail.To = EmailTo mail.From = EmailFrom mail.Subject = Subject mail.TextBody = Body mail.Send Subject = "Live The Point - Thank You for your request" Body = "Thank you for requesting information from Live The Point. Below is the information you submitted: " & vbcrlf & Body & vbcrlf & vbcrlf Body = Body & "Thank You," & vbcrlf & vbcrlf Body = Body & "LiveThePoint.com" mail.To = ClientInfo.Email.CurrentValue mail.From = EmailFrom mail.Subject = Subject mail.TextBody = Body mail.Send End Function Function IIf(condition,value1,value2) If condition Then IIf = value1 Else IIf = value2 End Function %> <% ' Add record Function AddRow() On Error Resume Next Dim rs, sSql, sFilter Dim rsnew Dim bCheckKey, sSqlChk, sWhereChk, rsChk Dim bInsertRow ' Check for duplicate key bCheckKey = True sFilter = ClientInfo.SqlKeyFilter If ClientInfo.ClientId.CurrentValue = "" Or IsNull(ClientInfo.ClientId.CurrentValue) Then bCheckKey = False Else sFilter = Replace(sFilter, "@ClientId@", ew_AdjustSql(ClientInfo.ClientId.CurrentValue)) ' Replace key value End If If Not IsNumeric(ClientInfo.ClientId.CurrentValue) Then bCheckKey = False End If If bCheckKey Then Set rsChk = ClientInfo.LoadRs(sFilter) If Not (rsChk Is Nothing) Then Session(EW_SESSION_MESSAGE) = "Duplicate value for primary key" rsChk.Close Set rsChk = Nothing AddRow = False Exit Function End If End If ' Add new record sFilter = "(0 = 1)" ClientInfo.CurrentFilter = sFilter sSql = ClientInfo.SQL Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = EW_CURSORLOCATION rs.Open sSql, conn, 1, 2 rs.AddNew If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description rs.Close Set rs = Nothing AddRow = False Exit Function End If ' Field FirstName Call ClientInfo.FirstName.SetDbValue(ClientInfo.FirstName.CurrentValue, "") rs("FirstName") = ClientInfo.FirstName.DbValue ' Field LastName Call ClientInfo.LastName.SetDbValue(ClientInfo.LastName.CurrentValue, "") rs("LastName") = ClientInfo.LastName.DbValue ' Field Address1 Call ClientInfo.Address1.SetDbValue(ClientInfo.Address1.CurrentValue, Null) rs("Address1") = ClientInfo.Address1.DbValue ' Field Address2 Call ClientInfo.Address2.SetDbValue(ClientInfo.Address2.CurrentValue, Null) rs("Address2") = ClientInfo.Address2.DbValue ' Field City Call ClientInfo.City.SetDbValue(ClientInfo.City.CurrentValue, Null) rs("City") = ClientInfo.City.DbValue ' Field State Call ClientInfo.State.SetDbValue(ClientInfo.State.CurrentValue, Null) rs("State") = ClientInfo.State.DbValue ' Field Zip Call ClientInfo.Zip.SetDbValue(ClientInfo.Zip.CurrentValue, Null) rs("Zip") = ClientInfo.Zip.DbValue ' Field Phone Call ClientInfo.Phone.SetDbValue(ClientInfo.Phone.CurrentValue, "") rs("Phone") = ClientInfo.Phone.DbValue ' Field AltPhone Call ClientInfo.AltPhone.SetDbValue(ClientInfo.AltPhone.CurrentValue, Null) rs("AltPhone") = ClientInfo.AltPhone.DbValue ' Field Email Call ClientInfo.Email.SetDbValue(ClientInfo.Email.CurrentValue, "") rs("Email") = ClientInfo.Email.DbValue ' Field Country Call ClientInfo.Country.SetDbValue(ClientInfo.Country.CurrentValue, Null) rs("Country") = ClientInfo.Country.DbValue ' Field ContactPref Call ClientInfo.ContactPref.SetDbValue(ClientInfo.ContactPref.CurrentValue, Null) rs("ContactPref") = ClientInfo.ContactPref.DbValue ' Field HowHeard Call ClientInfo.HowHeard.SetDbValue(ClientInfo.HowHeard.CurrentValue, Null) rs("HowHeard") = ClientInfo.HowHeard.DbValue ' Field PriceRangeStart Call ClientInfo.PriceRangeStart.SetDbValue(ClientInfo.PriceRangeStart.CurrentValue, Null) rs("PriceRangeStart") = ClientInfo.PriceRangeStart.DbValue ' Field PriceRangeEnd Call ClientInfo.PriceRangeEnd.SetDbValue(ClientInfo.PriceRangeEnd.CurrentValue, Null) rs("PriceRangeEnd") = ClientInfo.PriceRangeEnd.DbValue ' Field SQFtStart Call ClientInfo.SQFtStart.SetDbValue(ClientInfo.SQFtStart.CurrentValue, Null) rs("SQFtStart") = ClientInfo.SQFtStart.DbValue ' Field SQFtEnd Call ClientInfo.SQFtEnd.SetDbValue(ClientInfo.SQFtEnd.CurrentValue, Null) rs("SQFtEnd") = ClientInfo.SQFtEnd.DbValue ' Field Bedrooms Call ClientInfo.Bedrooms.SetDbValue(ClientInfo.Bedrooms.CurrentValue, Null) rs("Bedrooms") = ClientInfo.Bedrooms.DbValue ' Field Baths Call ClientInfo.Baths.SetDbValue(ClientInfo.Baths.CurrentValue, Null) rs("Baths") = ClientInfo.Baths.DbValue ' Field isRealEstate Call ClientInfo.isRealEstate.SetDbValue((ClientInfo.isRealEstate.CurrentValue <> "" And Not IsNull(ClientInfo.isRealEstate.CurrentValue)), Null) rs("isRealEstate") = ClientInfo.isRealEstate.DbValue ' Field isGolfClub Call ClientInfo.isGolfClub.SetDbValue((ClientInfo.isGolfClub.CurrentValue <> "" And Not IsNull(ClientInfo.isGolfClub.CurrentValue)), Null) rs("isGolfClub") = ClientInfo.isGolfClub.DbValue ' Field AppointmentDate Call ClientInfo.AppointmentDate.SetDbValue(ew_UnFormatDateTime(ClientInfo.AppointmentDate.CurrentValue, 6), Null) rs("AppointmentDate") = ClientInfo.AppointmentDate.DbValue ' Field AppointmentTime Call ClientInfo.AppointmentTime.SetDbValue(ew_UnFormatDateTime(ClientInfo.AppointmentTime.CurrentValue, 4), Null) rs("AppointmentTime") = ClientInfo.AppointmentTime.DbValue ' Field Comments Call ClientInfo.Comments.SetDbValue(ClientInfo.Comments.CurrentValue, Null) rs("Comments") = ClientInfo.Comments.DbValue ' Field Password Call ClientInfo.Password.SetDbValue(ClientInfo.Password.CurrentValue, Null) rs("Password") = ClientInfo.Password.DbValue ' Check recordset update error If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description rs.Close Set rs = Nothing AddRow = False Exit Function End If ' Call Row Inserting event bInsertRow = ClientInfo.Row_Inserting(rs) If bInsertRow Then ' Clone new rs object Set rsnew = ew_CloneRs(rs) rs.Update If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description AddRow = False Else AddRow = True End If Else rs.CancelUpdate If ClientInfo.CancelMessage <> "" Then Session(EW_SESSION_MESSAGE) = ClientInfo.CancelMessage ClientInfo.CancelMessage = "" Else Session(EW_SESSION_MESSAGE) = "Insert cancelled" End If AddRow = False End If rs.Close Set rs = Nothing If AddRow Then ClientInfo.ClientId.DbValue = rsnew("ClientId") ' Call Row Inserted event Call ClientInfo.Row_Inserted(rsnew) End If If IsObject(rsnew) Then rsnew.Close Set rsnew = Nothing End If End Function %> <% ' Page Load event Sub Page_Load() '***Response.Write "Page Load" End Sub ' Page Unload event Sub Page_Unload() '***Response.Write "Page Unload" End Sub %>