E2BN Conference Booking Form

<% Rem E2BN prices Dim E2BNAtt6thDayDelegate Dim E2BNAtt7thDayDelegate Dim E2BNEvening5th Dim E2BNEvening6th Dim E2BNTuesdayEveningDinner Dim E2BNMondayEveningDinner Dim E2BNWholeConference E2BNAtt6thDayDelegate = 0 E2BNAtt7thDayDelegate = 0 E2BNEvening5th = 80 E2BNEvening6th = 80 E2BNTuesdayEveningDinner = 0 E2BNMondayEveningDinner = 0 E2BNWholeConference = 160 Rem Non-E2BN prices Dim NonE2BNAtt6thDayDelegate Dim NonE2BNAtt7thDayDelegate Dim NonE2BNEvening5th Dim NonE2BNEvening6th Dim NonE2BNTuesdayEveningDinner Dim NonE2BNMondayEveningDinner Dim NonE2BNWholeConference NonE2BNAtt6thDayDelegate = 75 NonE2BNAtt7thDayDelegate = 75 NonE2BNEvening5th = 80 NonE2BNEvening6th = 80 NonE2BNTuesdayEveningDinner = 25 NonE2BNMondayEveningDinner = 20 NonE2BNWholeConference = 350 Dim TotalCost TotalCost = 0 set dbConn = Server.CreateObject("ADODB.connection") Rem Connection to db sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Server.MapPath("e2bn1.mdb") & ";" & _ "Persist Security Info=False" dbConn.Open(sConnection) rem check whether form submitted if request("register") = "Save details" then surname=request("surname") surname=Replace(surname,"'","’") firstname=request("firstname") title=request("title") jobtitle=request("jobtitle") e2bn_lea=request("e2bn_lea") if e2bn_lea = "on" then e2bn_lea="1" else e2bn_lea="0" end if subject=request("subject") organisation=request("organisation") address1=request("address1") address2=request("address2") address3=request("address3") postcode=request("postcode") telephone=request("telephone") attending6=request("attending6") if attending6 = "on" then attending6="1" else attending6="0" end if attending7=request("attending7") if attending7 = "on" then attending7="1" else attending7="0" end if evening5=request("evening5") if evening5 = "on" then evening5="1" else evening5="0" end if evening6=request("evening6") if evening6 = "on" then evening6="1" else evening6="0" end if dinner=request("dinner") if dinner = "on" then dinner="1" else dinner="0" end if dinner5=request("dinner5") if dinner5 = "on" then dinner5="1" else dinner5="0" end if whole_conf=request("whole_conf") if whole_conf = "on" then whole_conf="1" else whole_conf="0" end if in_to=request("in_to") in_jobtitle=request("in_jobtitle") in_establishment=request("in_establishment") in_address1=request("in_address1") in_address2=request("in_address2") in_address3=request("in_address3") in_postcode=request("in_postcode") in_budget=request("in_budget") in_email=request("in_email") in_telephone=request("in_telephone") special=request("special") email=request("email") workshop6tham=request("workshop6tham") workshop6thpm=request("workshop6thpm") workshop7tham=request("workshop7tham") workshop7thpm=request("workshop7thpm") rem insert the delegate record parta="INSERT INTO details (surname,firstname,title,jobtitle,e2bn_lea,subject,organisation," & _ "address1,address2,address3,postcode,telephone,attending6,attending7,evening5,evening6,dinner,dinner5," & _ "whole_conf,in_to,in_jobtitle,in_establishment,in_address1,in_address2,in_address3,in_postcode," & _ "in_budget,in_email,in_telephone,special,email,workshop6tham,workshop6thpm,workshop7tham,workshop7thpm) " partb=" VALUES ('" & surname & "','" & firstname & "','" & title & "','" & jobtitle & "','" _ & e2bn_lea & "','" & subject & "','" & organisation & "','" & address1 & "','" & address2 & "','" _ & address3 & "','" & postcode & "','" & telephone & "','" & attending6 & "','" & attending7 & "','" _ & evening5 & "','" & evening6 & "','" & dinner & "','" & dinner5 & "','" & whole_conf & "','" & in_to & "','" _ & in_jobtitle & "','" & in_establishment & "','" & in_address1 & "','" & in_address2 & "','" _ & in_address3 & "','" & in_postcode & "','" & in_budget & "','" & in_email & "','" & in_telephone _ & "','" & special & "','" & email & "','" & workshop6tham & "','" & workshop6thpm & "','" & workshop7tham _ & "','" & workshop7thpm & "') " query=parta & partb ' response.write "

" & query & "

" on error resume next dbConn.Execute query,recaffected if err<>0 then for each objerr in dbConn.Errors Response.Write("

Error inserting record - " & objerr.Description & "

") next else Response.Write("

Your booking details have been stored.

") rem now update the booked figures for the relevant workshops Set rsWorkshops = Server.CreateObject("ADODB.Recordset") if workshop6tham <> "" then rem get record for 6th am and increase booking field rsWorkshops.Open "select * from am_workshops where title='" & workshop6tham & "'", dbConn, 3 currbookings=0 currbookings=rsWorkshops("booked1") currbookings=currbookings+1 rem increment the booking figure rsWorkshops.close rem now update it query="update am_workshops set booked1='" & currbookings & "' where title='" & workshop6tham & "'" ' response.write "

" & query & "

" on error resume next dbConn.Execute query,recaffected if err<>0 then for each objerr in dbConn.Errors Response.Write("

Error updating workshop (6th. am) record - " & objerr.Description & "

") next else ' Response.Write("

Workshop record (6th. am) updated

") end if end if if workshop6thpm <> "" then rem get record for 6th pm and increase booking field rsWorkshops.Open "select * from pm_workshops where title='" & workshop6thpm & "'", dbConn, 3 currbookings=0 currbookings=rsWorkshops("booked1") currbookings=currbookings+1 rem increment the booking figure rsWorkshops.close rem now update it query="update pm_workshops set booked1='" & currbookings & "' where title='" & workshop6thpm & "'" ' response.write "

" & query & "

" on error resume next dbConn.Execute query,recaffected if err<>0 then for each objerr in dbConn.Errors Response.Write("

Error updating workshop (6th. pm) record - " & objerr.Description & "

") next else ' Response.Write("

Workshop record (6th. pm) updated

") end if end if if workshop7tham <> "" then rem get record for 7th am and increase booking field rsWorkshops.Open "select * from am_workshops where title='" & workshop7tham & "'", dbConn, 3 currbookings=0 currbookings=rsWorkshops("booked2") currbookings=currbookings+1 rem increment the booking figure rsWorkshops.close rem now update it query="update am_workshops set booked2='" & currbookings & "' where title='" & workshop7tham & "'" ' response.write "

" & query & "

" on error resume next dbConn.Execute query,recaffected if err<>0 then for each objerr in dbConn.Errors Response.Write("

Error updating workshop (7th. am) record - " & objerr.Description & "

") next else ' Response.Write("

Workshop record (7th. am) updated

") end if end if if workshop7thpm <> "" then rem get record for 7th pm and increase booking field rsWorkshops.Open "select * from pm_workshops where title='" & workshop7thpm & "'", dbConn, 3 currbookings=0 currbookings=rsWorkshops("booked2") currbookings=currbookings+1 rem increment the booking figure rsWorkshops.close rem now update it query="update pm_workshops set booked2='" & currbookings & "' where title='" & workshop7thpm & "'" ' response.write "

" & query & "

" on error resume next dbConn.Execute query,recaffected if err<>0 then for each objerr in dbConn.Errors Response.Write("

Error updating workshop (7th. pm) record - " & objerr.Description & "

") next else ' Response.Write("

Workshop record (7th. pm) updated

") end if end if Set rsWorkshops = Nothing Dim mailbody mailbody="Your booking details are below:" & vbcrlf & vbcrlf Response.Write("

Confirmation of booking details:

") rem list new delegate details Set rsDetails = Server.CreateObject("ADODB.Recordset") rsDetails.Open "SELECT * FROM details where surname='" & surname & "' and firstname='" & firstname & "'", dbConn, 3 response.write "

First Name: " & rsDetails("firstname") & "

" & vbcrlf mailbody = mailbody & "First Name: " & rsDetails("firstname") & vbcrlf response.write "

Surname: " & rsDetails("surname") & "

" & vbcrlf mailbody = mailbody & "Surname: " & rsDetails("surname") & vbcrlf response.write "

Booking reference: " & rsDetails("reference") & "

" & vbcrlf mailbody = mailbody & "Booking reference: " & rsDetails("reference") & vbcrlf if attending6 = "1" then response.write "

Attending on 6th.

" & vbcrlf mailbody = mailbody & "Attending on 6th." & vbcrlf end if if attending7 = "1" then response.write "

Attending on 7th.

" & vbcrlf mailbody = mailbody & "Attending on 7th." & vbcrlf end if if evening5 = "1" then response.write "

Attending evening of the 5th.

" & vbcrlf mailbody = mailbody & "Attending evening of the 5th." & vbcrlf end if if evening6 = "1" then response.write "

Attending evening of the 6th.

" & vbcrlf mailbody = mailbody & "Attending evening of the 6th." & vbcrlf end if if dinner5 = "1" then response.write "

Dinner required on 5th.

" & vbcrlf mailbody = mailbody & "Dinner required on 5th." & vbcrlf end if if dinner = "1" then response.write "

Dinner required on 6th.

" & vbcrlf mailbody = mailbody & "Dinner required on 6th." & vbcrlf end if if workshop6tham <> "" then response.write "

Attending 6th (AM) workshop: " & workshop6tham & "

" & vbcrlf mailbody = mailbody & "Attending 6th (AM) workshop:" & workshop6tham & vbcrlf end if if workshop6thpm <> "" then response.write "

Attending 6th (PM) workshop: " & workshop6thpm & "

" & vbcrlf mailbody = mailbody & "Attending 6th (PM) workshop:" & workshop6thpm & vbcrlf end if if workshop7tham <> "" then response.write "

Attending 7th (AM) workshop: " & workshop7tham & "

" & vbcrlf mailbody = mailbody & "Attending 7th (AM) workshop:" & workshop7tham & vbcrlf end if if workshop7thpm <> "" then response.write "

Attending 7th (PM) workshop: " & workshop7thpm & "

" & vbcrlf mailbody = mailbody & "Attending 7th (PM) workshop:" & workshop7thpm & vbcrlf end if rem work out and display total cost if e2bn_lea = "1" then if evening5 = "1" then TotalCost=TotalCost+E2BNEvening5th end if if evening6 = "1" then TotalCost=TotalCost+E2BNEvening6th end if if whole_conf = "1" then TotalCost=TotalCost+E2BNWholeConference end if else if attending6 = "1" then TotalCost=TotalCost+NonE2BNAtt6thDayDelegate end if if attending7 = "1" then TotalCost=TotalCost+NonE2BNAtt7thDayDelegate end if if evening5 = "1" then TotalCost=TotalCost+NonE2BNEvening5th end if if evening6 = "1" then TotalCost=TotalCost+NonE2BNEvening6th end if if dinner5 = "1" then TotalCost=TotalCost+NonE2BNMondayEveningDinner end if if dinner = "1" then TotalCost=TotalCost+NonE2BNTuesdayEveningDinner end if if whole_conf = "1" then TotalCost=TotalCost+NonE2BNWholeConference end if end if Response.Write("

Total cost: £" & TotalCost & "

") mailbody = mailbody & "Total cost: £" & TotalCost & vbcrlf rem EMAIL CODE HERE - (will need to be changed to suit server) rem Dim Mail rem Set Mail = Server.CreateObject("aspSmartMail.SmartMail") rem Email code for WINDOWS SERVER strHost = "mail.stuss.com" rem If Request("Register") <> "" Then Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = strHost rem Mail.SenderAddress = "jeff.howson@e2bn.net" rem Email code for WINDOWS SERVER rem Mail.SenderName = "E2BN Administrator" rem Email code for WINDOWS SERVER rem Mail.Recipients.Add email rem Email code for WINDOWS SERVER Mail.From = "jeff.howson@e2bn.net" ' From address Mail.FromName = "E2BN Administrator" ' optional Mail.AddAddress Request("email") rem create message subject and body Mail.Subject = "Your conference registration" rem Email code for WINDOWS SERVER Mail.Body = mailbody rem send the mail Email code for WINDOWS SERVER On Error Resume Next ' catch errors rem Mail.SendMail ' Email code for WINDOWS SERVER Mail.Send ' send message If Err.Number <> 0 Then ' error occurred response.write "

Error sending email - " & Err.Description & "

" else response.write "

The delegate has been emailed

" End If Response.Write("

A confirmation email has been sent to: " & email & "

") Response.Write("

") Set rsDetails = Nothing end if else %>

(* indicates mandatory fields.)

First name *
Surname *
Title *
Position
E2BN Lea
Teaching Subject
Organisation *
Address *
  *
 
Postcode *
Telephone *
Email address *
I will be attending the conference on:
Tuesday 6th July
Wednesday 7th July
I will require accomodation (Bed & Breakfast) on:
5th Evening (Prior to conference)
6th Evening
I will require dinner on:
Tuesday 6th July (The E2BN Conference Dinner)
Monday 5th July

Invoice To
Invoice Position
Invoice Establishment
Invoice Address

Invoice Postcode
Budget Code
Invoice E-mail
Invoice Tel
Special Requirements, Diet/Access etc.
Workshops - 6th. am.
Workshops - 6th. pm.
Workshops - 7th. am.
Workshops - 7th. pm.

<% end if dbConn.Close Set dbConn = Nothing %>