<%@ Language=VBScript %> <%option explicit%> <% Dim bCheck, bError, sForm, CCTypes(5), ExpMonth(11), ExpYear(4), StartYear(4), i, Quantities(8), mailfrom mailfrom = "orders@poweriZer.co.uk" Const SPANS = "" Const SPANE = "" Const CostChild = 174.99 Const CostAdult = 224.99 'Const CostPR3050 = 199.99 'Const CostPR5070 = 269.99 'Const CostPR7090 = 269.99 For i=0 To 8 Quantities(i) = i Next CCTypes(0) = "American Express" CCTypes(1) = "Delta" CCTypes(2) = "Mastercard" CCTypes(3) = "Switch" CCTypes(4) = "VISA" CCTypes(5) = "other" For i = 0 To 11 If i<9 Then ExpMonth(i) = "0" & CStr(i+1) Else ExpMonth(i) = CStr(i+1) End If Next For i = Year(Now) To Year(Now)+4 ExpYear(i-Year(Now)) = CStr(i) Next For i = Year(Now)-4 To Year(Now) StartYear(i-Year(Now)+4) = CStr(i) Next %> Home " Else MakeTxtRow = "" End If End Function Function MakeTxtAreaRow(sLabel, sName, nRows, nCols) MakeTxtAreaRow = "" End Function Function MakeSelectRow(sLabel, sName, aOptions, sMsg) MakeSelectRow = "" End Function Function CheckIfBlank(bCheck, sFormItem, sErrMsg) If bCheck And Request.Form(sFormItem) = "" Then CheckIfBlank = "
" & SPANS & sErrMsg & SPANE & "" bError = True Else CheckIfBlank = "" End If End Function Function OrderCost() 'OrderCost = "£" & FormatNumber((Request.Form("PR3050")*CostPR3050) + (Request.Form("PR5070")*CostPR5070) + (Request.Form("PR7090")*CostPR7090), 2) OrderCost = "£" & FormatNumber((Request.Form("F40")*CostChild) _ + (Request.Form("F50")*CostChild) _ + (Request.Form("F60")*CostChild) _ + (Request.Form("M60")*CostAdult) _ + (Request.Form("M70")*CostAdult) _ + (Request.Form("M80")*CostAdult) _ + (Request.Form("M90")*CostAdult) _ + (Request.Form("M100")*CostAdult) _ + (Request.Form("M110")*CostAdult)) End Function Sub DumpForm Dim x For Each x In Request.Form Response.Write("
Request.Form("" & x & "") = " & Request.Form(x)) Next End Sub %>
 

 

" If Request.Form("IssueNumber") <> "" Then sBody = sBody & "" End If sBody = sBody & "" sBody = sBody & "" sBody = sBody & "" sBody = sBody & "
<% 'DumpForm If Request.Form("action") = "" Then %>

If you would like to buy your own PoweriZers, please fill in the details below.
Please note - we can only deliver to a UK postal address.

Special Introductory Prices!!

<% bCheck = False Response.Write(ShowForm()) Else ' Check form bCheck = True sForm = ShowForm() If bError Then %>

<%=SPANS%>Order not completed<%=SPANE%>

There were problems with the information you entered.
Please check the form below, correct the problems and try again.

<% Response.Write(sForm) Else 'response.write("

OK, order cost = " & OrderCost() & "

") Dim oMail, sBody ' Build generic e-mail body sBody = "
     
 
" sBody = sBody & "" sBody = sBody & "" sBody = sBody & "" sBody = sBody & "" sBody = sBody & "" sBody = sBody & "" If Request.Form("F40") > 0 Then sBody = sBody & "" End If If Request.Form("F50") > 0 Then sBody = sBody & "" End If If Request.Form("F60") > 0 Then sBody = sBody & "" End If If Request.Form("M60") > 0 Then sBody = sBody & "" End If If Request.Form("M70") > 0 Then sBody = sBody & "" End If If Request.Form("M80") > 0 Then sBody = sBody & "" End If If Request.Form("M90") > 0 Then sBody = sBody & "" End If If Request.Form("M100") > 0 Then sBody = sBody & "" End If If Request.Form("M110") > 0 Then sBody = sBody & "" End If sBody = sBody & "" ' send the customer an e-mail Set oMail = Server.CreateObject("Persits.MailSender") With oMail .Host = Application("mailhost") .AddAddress Request.Form("Email") .FromName = "Elron Enterprises (www.poweriZer.co.uk)" .From = mailfrom .IsHTML = True .Body = "

Thank you for your order

Your order has been received and will be processed as soon as possible. If you have any queries about your order, please feel free to contact us." & sBody & "

Customer details
Name" & Request.Form("Name") & "
Address" & Request.Form("Address") & "
" & Request.Form("Postcode") & "
Name" & Request.Form("Telephone") & "
Name" & Request.Form("Email") & "
Order details
F40" & Request.Form("F40") & "
F50" & Request.Form("F50") & "
F60" & Request.Form("F60") & "
M60" & Request.Form("M60") & "
M70" & Request.Form("M70") & "
M80" & Request.Form("M80") & "
M90" & Request.Form("M90") & "
M100" & Request.Form("M100") & "
M110" & Request.Form("M110") & "
Order cost " & OrderCost() & ", paid by " & Request.Form("CardType") & "
" On Error Resume Next .Send If Err.Number <> 0 Then Response.Write("") End If End With ' now add on the bits for Elron sBody = "

New Order

" & sBody sBody = sBody & "
Card number" & Request.Form("CardNumber") & "
Issue number" & Request.Form("IssueNumber") & "
Security code" & Request.Form("SecurityCode") & "
Start date" & Request.Form("StartMonth") & "/" & Request.Form("StartYear") & "
Expiry date" & Request.Form("ExpMonth") & "/" & Request.Form("ExpYear") & "
" ' send Elron the details Set oMail = Server.CreateObject("Persits.MailSender") With oMail .Host = Application("mailhost") .AddAddress Application("email") .FromName = "Elron Sales Page" .From = mailfrom .IsHTML = True .Body = sBody On Error Resume Next .Send If Err.Number <> 0 Then Response.Write("") End If End With %>

Thank you for your order

You have been sent an e-mail confirming your order. We will process it as quickly as possible and send out your PoweriZers as soon as we can. If you have any queries about your order, please feel free to contact us.

<% End If %><%End If%><% Response.End Function ShowForm() Dim sForm bError = False sForm = sForm & "
" sForm = sForm & "" sForm = sForm & "" sForm = sForm & MakeTxtRow("Your name", "Name", 40, True) sForm = sForm & MakeTxtAreaRow("Your address", "Address", 6, 30) sForm = sForm & MakeTxtRow("Your post code", "Postcode", 15, True) sForm = sForm & MakeTxtRow("Telephone number", "Telephone", 20, True) sForm = sForm & MakeTxtRow("E-mail", "Email", 40, True) sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & MakeSelectRow("Card type", "CardType", CCTypes, "") sForm = sForm & MakeTxtRow("Card number", "CardNumber", 30, True) sForm = sForm & MakeTxtRow("Issue number (if applicable)", "IssueNumber", 5, False) sForm = sForm & MakeTxtRow("Security code", "SecurityCode", 5, True) sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "" sForm = sForm & "
Your details

Your order" If bCheck Then If Request.Form("F40") + Request.Form("F50") + Request.Form("F60") + Request.Form("M60") + Request.Form("M70") + Request.Form("M80") + Request.Form("M90") + Request.Form("M100") + Request.Form("M110") = 0 Then bError = True sForm = sForm & "
" & SPANS & "Nothing ordered" & SPANE & "" End If End If sForm = sForm & "
Children's models" sForm = sForm & MakeSelectRow("F40 (weight 35-45Kg)", "F40", Quantities, "  £" & CostChild & " per pair") sForm = sForm & MakeSelectRow("F50 (weight 45-55Kg)", "F50", Quantities, "  £" & CostChild & " per pair") sForm = sForm & MakeSelectRow("F60 (weight 55-65Kg)", "F60", Quantities, "  £" & CostChild & " per pair") sForm = sForm & "
Adult's models" sForm = sForm & MakeSelectRow("M60 (weight 55-65Kg)", "M60", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & MakeSelectRow("M70 (weight 65-75Kg)", "M70", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & MakeSelectRow("M80 (weight 75-85Kg)", "M80", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & MakeSelectRow("M90 (weight 85-95Kg)", "M90", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & MakeSelectRow("M100 (weight 95-105Kg)", "M100", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & MakeSelectRow("M110 (weight 105-115Kg)", "M110", Quantities, "  £" & CostAdult & " per pair") sForm = sForm & "
See the PoweriZer models page for more details.

Payment details
Start date  
Expiry date  
  
" sForm = sForm & "
" ShowForm = sForm End Function Function MakeTxtRow(sLabel, sName, nSize, bRequired) If bRequired Then MakeTxtRow = "
" & sLabel & CheckIfBlank(bCheck, sName, "Required") & " " & "" & "
" & sLabel & " " & "" & "
" & sLabel & CheckIfBlank(bCheck, sName, "Required") & " " & "" & "
" & sLabel & " " & "" & sMsg & "