%
' set the initial load status of the required fields
pageErrors = false
ShipFNameOK = false
ShipNameOK = false
ShippingAddressOK = false
ShippingCityOK = false
ShippingStateOK = false
ShippingCodeOK = false
Phone1OK = false
EmailOK = false
guestFNameOK = false
today = date()
call main()
' BARB
' All of this ASP above must come at the top of the file and before the DocType definition.
%>
Registration - PTG California State Conference
Register for ... Use The Force
<%
function main()
if request("submit.x") <> "" then
if request("GuestFName") = "" and request("qty9") <> "" then
guestOK = false
else
guestOK = true
end if
' if all the required data has been entered go ahead and process the form and submit it to Tremaine
if request("ShipFName") <> "" and request("ShipName") <> "" and request("ShippingAddress") <> "" and request("ShippingCity") <> "" and request("ShippingState") <> "" and request("ShippingCode") <> "" and request("Phone1") <> "" and request("Email") <> "" and guestOK = true then
' format the date and time
xToday = date()
postDate = WeekdayName(Weekday(xToday)) + ", " + MonthName(Month(xToday)) + " " + CStr(Day(xToday)) + ", " + CStr(Year(xToday)) + " at " + CStr(FormatDateTime(time(), 4)) + ":" + CStr(Second(time()))
' start a running total of amount paid
regTotal = 0
' contact information
body= "Form: ...Use The Force - REGISTRATION" & vbCrLf
body=body & "Date: " & postDate & vbCrLf & vbCrLf
body=body & "CONTACT INFORMATION:" & vbCrLf
body=body & "Company Name : " & request("ShipCoName") & vbCrLf
body=body & "Tech Registration First Name : " & request("ShipFName") & vbCrLf
body=body & "Tech Registration Last Name : " & request("ShipName") & vbCrLf
body=body & "Tech Registration Nick Name : " & request("NickName") & vbCrLf
body=body & "Address Line 1 : " & request("ShippingAddress") & vbCrLf
body=body & "Address Line 2 : " & request("ShippingAddress2") & vbCrLf
body=body & "City : " & request("ShippingCity") & vbCrLf
body=body & "State : " & request("ShippingState") & vbCrLf
body=body & "Zip : " & request("ShippingCode") & vbCrLf
body=body & "Country : " & request("ShippingCountry") & vbCrLf
body=body & "Phone : " & request("Phone1") & vbCrLf
body=body & "Fax : " & request("Ph2Fax") & vbCrLf
body=body & "Email : " & request("Email") & vbCrLf & vbCrLf
' registration information
body=body & "REGISTRATION INFORMATION:" & vbCrLf
if today < #2/5/2009# then
if request("r1Stat") = "PTGMember" then
body=body & "PTG Member Registration - Amount Paid : 275" & vbCrLf
regTotal = regTotal + 275
else
body=body & "PTG Non-Member Registration - Amount Paid : 350" & vbCrLf
regTotal = regTotal + 350
end if
else
if request("r1Stat") = "PTGMember" then
body=body & "PTG Member Registration - Amount Paid : 325" & vbCrLf
regTotal = regTotal + 325
else
body=body & "PTG Non-Member Registration - Amount Paid : 400" & vbCrLf
regTotal = regTotal + 400
end if
end if
body=body & "Member Status : " & request("memstatus") & vbCrLf
body=body & "Member of Chapter : " & request("referredby") & vbCrLf
if request("vegi") = "" then
body=body & "Registrant Requests a Vegitarian Meal : No" & vbCrLf
else
body=body & "Registrant Requests a Vegitarian Meal : Yes" & vbCrLf
end if
body=body & "Registrant Requests an Extra Meal : " & request("qty5") & vbCrLf
if request("qty5") = "No" then
body=body & "Amount paid for extra meal : 0" & vbCrLf & vbCrLf
else
body=body & "Amount paid for extra meal : 55" & vbCrLf & vbCrLf
regTotal = regTotal + 55
end if
' Hyperdrive Thursday classes
body=body & "Hyperdrive Thursday : " & request("qty3") & vbCrLf
if request("qty3") = "Tuning" or request("qty3") = "Regulation" then
regTotal = regTotal + 50
body=body & "Amount paid for Tuning or Regulation class : 50" & vbCrLf
end if
' Use The Force Friday class
if request("Touch") = "" then
body=body & "Friday - Action Touch Design : No" & vbCrLf
else
body=body & "Friday - Action Touch Design : Yes" & vbCrLf
end if
' Saturday class
if request("Saturday") = "" then
body=body & "Saturday class : No" & vbCrLf & vbCrLf
else
body=body & "Saturday class : Yes" & vbCrLf & vbCrLf
end if
' Supernova Sunday class
if request("Repair") = "" then
body=body & "Supernova Sunday - Technical Repair Skills : No" & vbCrLf & vbCrLf
else
body=body & "Supernova Sunday - Technical Repair Skills : Yes" & vbCrLf & vbCrLf
end if
' guest registration information
body=body & "GUEST REGISTRATION INFORMATION:" & vbCrLf
body=body & "Guest First Name : " & request("GuestFName") & vbCrLf
body=body & "Guest Last Name : " & request("GuestName") & vbCrLf
body=body & "Guest Nick Name : " & request("GuestNickName") & vbCrLf
if request("qty9") = "" then
body=body & "Guest Registration - Amount Paid : 0" & vbCrLf
else
body=body & "Guest Registration - Amount Paid : 137.50 " & vbCrLf
regTotal = regTotal + 137.50
end if
if request("qty9Vegi") = "" then
body=body & "Guest Requests Vegitarian Meal : No" & vbCrLf & vbCrLf
else
body=body & "Guest Requests Vegitarian Meal : Yes" & vbCrLf & vbCrLf
end if
' additional information
body=body & "ADDITIONAL INFORMATION & COMMENTS:" & vbCrLf
body=body & request("comments") & vbCrLf & vbCrLf
' total registration price
body=body & "Total Amount of this registration : " & regTotal
registrationSubject="...Use The Force - Technician Registration from: " & request("ShipFName") & " " & request("ShipName")
registrationFrom="registrar@calstateptgconference.com"
' email recipient list
call SendEmail("admin@ca-ptg.org",registrationFrom,registrationSubject,body)
call SendEmail("jnogden@123la.net",registrationFrom,registrationSubject,body)
' redirect to paypal cc billing page on Tremains server
' register_bur.php starts with a notice of redirect/confirmation page. It will need to be reformatted to fit in with ...UTF.
' coordinate that work with Tremaine.
response.redirect "http://www.ca-ptg.org/register/register_bur.php?ptotal="®Total&"&pphone="&request("Phone1")&"&pfnamepar="&request("ShipFName")&"&pnamepar="&request("ShipName")&"&pconampar="&request("NickName")&"&paddress1par="&request("ShippingAddress")&"&paddress2par="&request("ShippingAddress2")&"&pcitypar="&request("ShippingCity")&"&pstatepar="&request("ShippingState")&"&pzippar="&request("ShippingCode")&"&pcountrypar="&request("ShippingCountry")&"&pemail="&request("Email")&"&pbillfnamepar="&request("ShipFName")&"&pbillnamepar="&request("ShipName")&"&pbilladdresspar="&request("ShippingAddress")&"&pbillcitypar="&request("ShippingCity")&"&pbillstatepar="&request("ShippingState")&"&pbillcountrypar="&request("ShippingCountry")&"&pbillzippar="&request("ShippingCode")
' when register_bur.php has completed the registrant will be returned here.
' this confirmation page is already in place but needs to be completed.
response.redirect "confirmation.shtml"
else
' we are here because some of the required data was not input by the registrant.
' check for data input errors, redisplay page with error message and ask user to correct
pageErrors = true
if request("ShipFName") = "" and ShipFNameOK = false then
ShipFNameOK = true
else
ShipFNameOK = false
end if
if request("ShipName") = "" and ShipNameOK = false then
ShipNameOK = true
else
ShipNameOK = false
end if
if request("ShippingAddress") = "" and ShippingAddressOK = false then
ShippingAddressOK = true
else
ShippingAddressOK = false
end if
if request("ShippingCity") = "" and ShippingCityOK = false then
ShippingCityOK = true
else
ShippingCityOK = false
end if
if request("ShippingState") = "" and ShippingStateOK = false then
ShippingStateOK = true
else
ShippingStateOK = false
end if
if request("ShippingCode") = "" and ShippingCodeOK = false then
ShippingCodeOK = true
else
ShippingCodeOK = false
end if
if request("Phone1") = "" and Phone1OK = false then
Phone1OK = true
else
Phone1OK = false
end if
if request("Email") = "" and EmailOK = false then
EmailOK = true
else
EmailOK = false
end if
if request("guestFName") = "" and guestFNameOK = false then
guestFNameOK = true
else
guestFNameOK = false
end if
end if
end if
end function
sub SendEmail(vTo, vFrom, vSubject, vBody)
Dim strFrom, strSubject, strBody 'Strings for fromaddress, subject, body
Dim objCDOMail 'The CDO object
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
'cdoSendUsingPort
.Item(sch & "sendusing") = 2
'Email Server
.Item(sch & "smtpserver") = "pro54.abac.com"
'Basic authentication
.Item(sch & "smtpauthenticate") = 1
'Type your email account below
.Item(sch & "sendusername") = "registrar@calstateptgconference.com"
'Type your email password below
.Item(sch & "sendpassword") = "ivories"
.Item(sch & "smtpserverport") = 465
'SSL connection enabled
.Item(sch & "smtpusessl") = true
.update
End With
' Create an instance of the NewMail object.
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = cdoConfig
' Set the properties of the object
objMessage.From = vFrom
objMessage.To = vTo 'The recipient of the form data
objMessage.Subject = vSubject
objMessage.TextBody = vBody
' Some useful extra variables
'objMessage.Cc = ""
'objMessage.Bcc = ""
' Send the message!
objMessage.Send
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method.
Set objMessage = Nothing
end sub
%>