% 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 %>
|
|
|
|
|
|
|||
|
|
![]() |
|
|
||||
|
|
|||||||
|
|
|||||||
|
|
![]() <% If Session(EW_SESSION_MESSAGE) <> "" Then ' Mesasge in Session, display %> <%= Session(EW_SESSION_MESSAGE) %> <% Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session End If %>Experience first hand the real beauty and diversity of Pelican Point! Model Homes & Sales Office Open 7 Days/Week |
|
|||||
|
|
|||||||
|
|
|
||||||
|
|
|||||||
|
|
|||||||
|
|
|
||||||
|
|
|
|
|
|
|
|
|