<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% 'Make a transaction dispatcher instance Dim tNGs: Set tNGs = new tNG_dispatcher tNGs.Init "" %> <% ' Start trigger Dim formValidation: Set formValidation = new tNG_FormValidation formValidation.Init formValidation.addField "q_name", true, "text", "", "", "", "" tNGs.prepareValidation formValidation ' End trigger %> <% 'start Trigger_SendEmail trigger 'remove this line if you want to edit the code by hand Function Trigger_SendEmail (ByRef tNG) Dim emailObj: Set emailObj = new tNG_Email emailObj.Init tNG emailObj.setFrom "{KT_defaultSender}" emailObj.setTo "mat@hbweb.co.uk" emailObj.setCC "" emailObj.setBCC "" emailObj.setSubject "HBWeb.co.uk - Quote Enquiry" 'WriteContent method emailObj.setContent "Quote Enquiry from HBWeb.co.uk v8" & vbNewLine & "" & vbNewLine & "Sent on (Server Time): {q_date}" & vbNewLine & "" & vbNewLine & "{q_name}" & vbNewLine & "" & vbNewLine & "{q_address_1}" & vbNewLine & "{q_address_2}" & vbNewLine & "{q_address_3}" & vbNewLine & "{q_postcode}" & vbNewLine & "" & vbNewLine & "{q_tel}" & vbNewLine & "{q_mob}" & vbNewLine & "" & vbNewLine & "{q_email}" & vbNewLine & "" & vbNewLine & "What is the Quote for?" & vbNewLine & "{q_what_for}" & vbNewLine & "" & vbNewLine & "How many pages/prints?" & vbNewLine & "{q_pages}" & vbNewLine & "" & vbNewLine & "Do you need, or have a logo already?" & vbNewLine & "{q_logo}" & vbNewLine & "" & vbNewLine & "Any colour scheme?" & vbNewLine & "{q_colour_scheme}" & vbNewLine & "" & vbNewLine & "Any special needs?" & vbNewLine & "{q_special_needs}" & vbNewLine & "" & vbNewLine & "About your company" & vbNewLine & "{q_about_company}" & vbNewLine & "" & vbNewLine & "Who are your competitors?" & vbNewLine & "{q_competitors}" & vbNewLine & "" & vbNewLine & "How do you foresee the design looking?" & vbNewLine & "{q_foresee_site}" & vbNewLine & "" & vbNewLine & "Any other useful information?" & vbNewLine & "{q_comments}" & vbNewLine & "" & vbNewLine & "" emailObj.setEncoding "ISO-8859-1" emailObj.setFormat "Text" emailObj.setImportance "Normal" Set Trigger_SendEmail = emailObj.Execute() End Function 'end Trigger_SendEmail trigger %> <% Dim quote1 Dim quote1_cmd Dim quote1_numRows Set quote1_cmd = Server.CreateObject ("ADODB.Command") quote1_cmd.ActiveConnection = MM_hbwebv6_STRING quote1_cmd.CommandText = "SELECT * FROM adult_ed" quote1_cmd.Prepared = true Set quote1 = quote1_cmd.Execute quote1_numRows = 0 %> <% ' Make an insert transaction instance Dim ins_quote: Set ins_quote = new tNG_insert ins_quote.init MM_hbwebv6_STRING tNGs.addTransaction ins_quote ' Register triggers ins_quote.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1") ins_quote.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation) ins_quote.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "contact_quote_confirmed.asp") ins_quote.registerTrigger Array("AFTER", "Trigger_SendEmail", 40) ' Add columns ins_quote.setTable "quote" ins_quote.addColumn "q_name", "STRING_TYPE", "POST", "q_name", "" ins_quote.addColumn "q_address_1", "STRING_TYPE", "POST", "q_address_1", "" ins_quote.addColumn "q_address_2", "STRING_TYPE", "POST", "q_address_2", "" ins_quote.addColumn "q_address_3", "STRING_TYPE", "POST", "q_address_3", "" ins_quote.addColumn "q_postcode", "STRING_TYPE", "POST", "q_postcode", "" ins_quote.addColumn "q_tel", "STRING_TYPE", "POST", "q_tel", "" ins_quote.addColumn "q_mob", "STRING_TYPE", "POST", "q_mob", "" ins_quote.addColumn "q_email", "STRING_TYPE", "POST", "q_email", "" ins_quote.addColumn "q_what_for", "STRING_TYPE", "POST", "q_what_for", "" ins_quote.addColumn "q_pages", "STRING_TYPE", "POST", "q_pages", "" ins_quote.addColumn "q_logo", "STRING_TYPE", "POST", "q_logo", "" ins_quote.addColumn "q_colour_scheme", "STRING_TYPE", "POST", "q_colour_scheme", "" ins_quote.addColumn "q_special_needs", "STRING_TYPE", "POST", "q_special_needs", "" ins_quote.addColumn "q_about_company", "STRING_TYPE", "POST", "q_about_company", "" ins_quote.addColumn "q_competitors", "STRING_TYPE", "POST", "q_competitors", "" ins_quote.addColumn "q_foresee_site", "STRING_TYPE", "POST", "q_foresee_site", "" ins_quote.addColumn "q_comments", "STRING_TYPE", "POST", "q_comments", "" ins_quote.addColumn "q_date", "STRING_TYPE", "POST", "q_date", "{NOW_DT}" ins_quote.setPrimaryKey "q_id", "NUMERIC_TYPE", "", "" %> <% 'Execute all the registered transactions tNGs.executeTransactions %> <% 'Get the transaction recordset Dim rsquote Dim rsquote_numRows Set rsquote = tNGs.getRecordset("quote") rsquote_numRows = 0 %> HBWeb.co.uk - Complete this form for a quote <% Response.Write tNGs.displayValidationRules()%>

To contact us for a quote, please complete the form below.

  <% Response.Write tNGs.getErrorMsg() %>

Your information
" size="32" /> <%=(tNGs.displayFieldHint("q_name"))%> <%=(tNGs.displayFieldError("quote", "q_name"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_address_1"))%> <%=(tNGs.displayFieldError("quote", "q_address_1"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_address_2"))%> <%=(tNGs.displayFieldError("quote", "q_address_2"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_address_3"))%> <%=(tNGs.displayFieldError("quote", "q_address_3"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_postcode"))%> <%=(tNGs.displayFieldError("quote", "q_postcode"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_tel"))%> <%=(tNGs.displayFieldError("quote", "q_tel"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_mob"))%> <%=(tNGs.displayFieldError("quote", "q_mob"))%>
" size="32" /> <%=(tNGs.displayFieldHint("q_email"))%> <%=(tNGs.displayFieldError("quote", "q_email"))%>
Information for the quote ...
<%=(tNGs.displayFieldHint("q_what_for"))%> <%=(tNGs.displayFieldError("quote", "q_what_for"))%>
<%=(tNGs.displayFieldHint("q_pages"))%> <%=(tNGs.displayFieldError("quote", "q_pages"))%>
<%=(tNGs.displayFieldHint("q_logo"))%> <%=(tNGs.displayFieldError("quote", "q_logo"))%>
<%=(tNGs.displayFieldHint("q_colour_scheme"))%> <%=(tNGs.displayFieldError("quote", "q_colour_scheme"))%>
<%=(tNGs.displayFieldHint("q_special_needs"))%> <%=(tNGs.displayFieldError("quote", "q_special_needs"))%>
<%=(tNGs.displayFieldHint("q_about_company"))%> <%=(tNGs.displayFieldError("quote", "q_about_company"))%>
<%=(tNGs.displayFieldHint("q_competitors"))%> <%=(tNGs.displayFieldError("quote", "q_competitors"))%>
<%=(tNGs.displayFieldHint("q_foresee_site"))%> <%=(tNGs.displayFieldError("quote", "q_foresee_site"))%>
<%=(tNGs.displayFieldHint("q_comments"))%> <%=(tNGs.displayFieldError("quote", "q_comments"))%>
" />

 

 

<% quote1.Close() Set quote1 = Nothing %>