%'Include Data Connection%> <%'Include ADO constants include file for VBScript%> <% 'open data connection Call OpenConn() %> <%'Include Utility Scripts%> <% Dim intSubmissionId Dim intDynamicFormId Dim strUserLangId Dim strDynamicFormName 'get the dynamic form id intDynamicFormId = Request.QueryString("id") If intDynamicFormId <> "" And IsNumeric(intDynamicFormId) Then intDynamicFormId = CInt(intDynamicFormId) Set rsDynamicForm = GetDynamicForm(intDynamicFormId) If rsDynamicForm.EOF = False Then 'populate the variable with the database fields strDynamicFormName = rsDynamicForm("DYNAMIC_FORM_NAME_EN") rsDynamicForm.Close Set rsDynamicForm = Nothing Else Set rsDynamicForm = Nothing 'redirect the user Response.Redirect "/admin/dynamic_forms.asp" End If End If 'get the dynamic form id intDynamicFormId = Request.QueryString("id") 'if a form entry was submitted and the process page redirected the user back to this one then... If Request.QueryString("suc") <> "" Then 'if the form was submitted from the admin side then... 'according to the success status value: Select Case Request.QueryString("suc") 'if the success status is 1 (success) then... Case "1" 'set the feedback error to zero Session("FeedbackError") = 0 'if the success status is anything other than 1 (success) then... Case Else 'set the feedback error to one Session("FeedbackError") = 1 End Select 'if the submission id was submitted (so we can submit to an external form) then... If Request.QueryString("sub") <> "" And IsNumeric(Request.QueryString("sub")) And LCase(Request.QueryString("mode")) <> "edit" Then 'get the submission id intSubmissionId = Request.QueryString("sub") 'get the language strUserLangId = Request.QueryString("lang") 'get external from url array Dim strExternalURL, arExternalURL, intURLCounter Dim rsDynamicForm Dim intIsAdmin intDynamicFormId = CInt(Request.QueryString("id")) intIsAdmin = Request.QueryString("admin") Set rsDynamicForm = GetDynamicForm(intDynamicFormId) strExternalURL = rsDynamicForm("DYNAMIC_FORM_EXTERNAL_FORM_URL_" & strUserLangId) rsDynamicForm.Close Set rsDynamicForm = Nothing 'split the URL list into the array arExternalURL = Split(strExternalURL, ",") 'for every URL: For intURLCounter = 0 To UBound(arExternalURL) 'if the array element is not an empty string then... If Trim(arExternalURL(intURLCounter)) <> "" Then 'submit to external form Response.Write("" & vbCRLF) End If Next End If 'get the application mode strMode = Request.QueryString("mode") 'give the user feedback with regards to the success of the database transaction Session("FeedbackMode") = LCase(strMode) Session("FeedbackModule") = "dynamic_form_admin_entry" 'if the application is in add mode then... If strMode = "add" Then 'redirect user to blank form Session("Referer") = "/admin/dynamic_form_admin_entry.asp?mode=" & strMode & "&id=" & intDynamicFormId Else 'redirect user to blank form entries Session("Referer") = "/admin/dynamic_form_entries.asp?id=" & intDynamicFormId End If Response.Write("") Response.Write("") 'end add/edit (db transactions) 'if a form entry was not submitted then... Else 'display the admin form Dim bolThisPageIsBeingDisplayedOnAdminSide Dim strJavaScript_EN, strJavaScript_FR Dim strHTML_EN, strHTML_FR Dim strHTML, strJavaScript bolThisPageIsBeingDisplayedOnAdminSide = True 'if we are in edit mode If LCase(strMode) = "edit" Then 'find out which form results to display intSubmissionId = Request.QueryString("sub") If intSubmissionId <> "" And IsNumeric(intSubmissionId) Then intSubmissionId = CInt(intSubmissionId) End If Else intSubmissionId = 0 End If 'if mode is edit then... If intSubmissionId > 0 Then 'get submission language strUserLangId = GetSubmissionLanguage(intSubmissionId) Else 'default admin-side language variable to english strUserLangId = "en" 'strUserLangId = "fr" End If 'get the form with admin fields Call GetDynamicFormValidationAndHTMLString(intDynamicFormId, intSubmissionId, bolThisPageIsBeingDisplayedOnAdminSide, strJavaScript_EN, strHTML_EN, strJavaScript_FR, strHTML_FR) 'if the user language is english then... If strUserLangId = "en" Then 'get the english form and js validation strHTML = strHTML_EN strJavaScript = strJavaScript_EN 'if the user language is french then... Else 'get the english form and js validation strHTML = strHTML_FR strJavaScript = strJavaScript_FR 'end:if the user language is english then... End If %>
<% End If 'close the data connection Call CloseConn() %>