|
|

|

|

|

|

|
<%
else
Session("level") = request("level")
Session("FirstName") = request("FirstName")
Session("LastName") = request("LastName")
Session("Address1") = request("Address1")
Session("Address2") = request("Address2")
Session("City") = request("City")
Session("State") = request("State")
Session("Zip") = request("Zip")
Session("Phone") = request("Phone")
Session("Email") = request("Email")
Session("grade") = request("grade")
Session("tickets") = request("tickets")
Session("tix") = request("tix")
Session("beef") = request("beef")
Session("chicken") = request("chicken")
Session("vegetarian") = request("vegetarian")
Session("attend") = request("attend")
Session("unable") = request("unable")
Session("drinktickets") = request("drinktickets")
Session("drinktix") = request("drinktix")
Session("expresspay") = request("expresspay")
Session("seating") = request("seating")
Session("CC") = Request.Form("cc")
Session("cctype") = Request.Form("cctype")
Session("expmonth") = Request.Form("expmonth")
Session("expyear") = Request.Form("expyear")
Session("expdate") = Request.Form("expmonth") & Request.Form("expyear")
if Session("firstname")="" or Session("lastname")="" or Session("address1")="" or Session("Email")="" then
response.redirect("patronerror.asp")
end if
'For Each x in Request.Form
' If x <> "address2" or x <> "tickets" or x <> "beef" or x <> "chicken" or x <> "vegeterian" or x <> "attendance" or x <> "drinktickets" or x <> "drinktix" or x <> "expresspay" then
' If Request.Form(x) = "" Then
' Session.Contents("errormessage") = "" & UCase(x) & " is required."
'
%>
<%
'Response.End
'end if
'end if
'Next
Function ConvertCardNum(CardNum)
Set r = new RegExp
r.Global = True
r.IgnoreCase = True
r.Pattern = "([0-9*])"
cc = ""
cc = r.Replace(Mid(CardNum,1,len(CardNum)-4),"*") & Mid(CardNum,len(CardNum)-3,4)
ConvertCardNum = cc
End Function
If Session("drinktix") <> "" then
If Session("drinktix") > 0 then
Session("Cost") = (Session("level")) + (6 * (Session("drinktix")))
end if
else
Session("Cost") = Session("level")
end if
response.write("The following information was received")
response.write " "
response.write("Your patron level is "&Session("level"))
response.write " "
response.write(Session("FirstName"))
response.write " "
response.write(Session("LastName"))
response.write " "
response.write(Session("Address1"))
response.write " "
response.write(Session("Address2"))
response.write " "
response.write(Session("City"))
response.write " "
response.write(Session("State"))
response.write " "
response.write(Session("Zip"))
response.write " "
response.write(Session("Phone"))
response.write " "
response.write(Session("Email"))
response.write " "
response.write("Your childs grade"&Session("grade"))
response.write " "
response.write("You are attending the ball:"&Session("attend"))
response.write " "
response.write("You are unable to attend the ball but have made a patron donation:"&Session("unable"))
response.write " "
response.write("You requested " &Session("beef")&" beef entrees")
response.write " "
response.write("You requested "&Session("chicken")&" chicken entrees")
response.write " "
response.write("You requested "&Session("vegeterian")&" vegeterian entrees")
response.write " "
response.write("You purchased "&Session("drinktickets")&" drink tickets")
response.write " "
response.write("Additional Information : " &Session("seating"))
response.write " "
response.write("Credit Card charged " &Session("CC"))
response.write " "
response.write("Your total amount charged is "&Session("Cost"))
'if Session("copies") <= 0 then
' Session("copies") = 1
'end if
'Session("Cost") = (10 * Session("copies")) + (2 * Session.Contents("copies"))
IF Session("CC") = "5490993420233779" THEN
Session("Cost") = 0.01
End If
Select Case Session("ccType")
Case "Mastercard"
Net = Session("Cost") * .98
Case "Visa"
Net = Session("Cost") * .98
Case "Amex"
Net = Session("Cost") * .9675
Case "Discover"
Net = Session("Cost") * .9775
End Select
IF ErrorMessage = "" THEN
' create the PNCOMClient component
Set client = Server.CreateObject("PFProCOMControl.PFProCOMControl.1")
'build the parameter list, such that we have a sale transaction and
'a credit card tender.
parmList = "TRXTYPE=S&TENDER=C&ZIP=" & Session("ZIP") & "&COMMENT1=Ball 2007&COMMENT2=" & Session("firstname") & " " & Session.Contents("lastname")
'set the account form the html form
parmList = parmList & "&ACCT=" & Session("CC")
'set the password from the html form
parmList = parmList & "&PWD=chonline00"
'set the user from the HTML form
parmList = parmList & "&USER=campbellhall"
'set the vendor from the HTML form
parmList = parmList & "&VENDOR=campbellhall"
'set the partner from the HTML form
parmList = parmList & "&PARTNER=VeriSign"
'set the expiration date form the HTML form
parmList = parmList & "&EXPDATE=" & Session("Expdate")
'set the amount from the HTML form
parmList = parmList & "&AMT=" & Session("Cost")
Ctx1 = client.CreateContext("payflow.verisign.com", 443, 30, "", 0, "", "")
curString = client.SubmitTransaction(Ctx1, parmList, Len(parmList))
client.DestroyContext (Ctx1)
' handle the response
done = 0
Dim PNREF, RESPMSG, AUTHCODE, AVSADDR, AVSZIP, CVV2MATCH
'loop until we're done processing the entire string
Do while Len(curString) <> 0
'get the next name value pair
if InStr(curString,"&") Then
varString = Left(curString, InStr(curString , "&" ) -1)
else
varString = curString
end if
'Response.Write " "
'get the name part of the name/value pair
name = Left(varString, InStr(varString, "=" ) -1)
'get the value out of the name/value pair
value = Right(varString, Len(varString) - (Len(name)+1))
Select Case name
Case "PNREF"
PNREF = value
Case "RESPMSG"
RESPMSG = value
Case "AUTHCODE"
AUTHCODE = value
Case "AVSADDR"
AVSADDR = value
Case "AVSZIP"
AVSZIP = value
Case "CVV2MATCH"
CVV2MATCH = value
End Select
'write out the name/value pair in "name = value" format
'response.write name
'response.write " = "
'Response.Write value
'Response.Write " "
'skip over the &
if Len(curString) <> Len(varString) Then
curString = Right(curString, Len(curString) - (Len(varString)+1))
else
curString = ""
end if
Loop
IF RESPMSG = "Approved" THEN
Set Crypto = Server.CreateObject("crypto.Encryption")
ccnum = Crypto.EnCode(Session.Contents("cc"))
Body = "Your Ball Registration Information is below"& _
"" & _
"" & _
"| Firstname: | " & _
"" & Session("firstname") & " | " & _
" " & _
"" & _
"| Lastname: | " & _
"" & Session("lastname") & " | " & _
" " & _
"" & _
"| Address 1: | " & _
"" & Session("address1") & " | " & _
" " & _
"" & _
"| Address 2: | " & _
"" & Session("address2") & " | " & _
" " & _
"" & _
"| City: | " & _
"" & Session("city") & " | " & _
" " & _
"" & _
"| State: | " & _
"" & Session("state") & " | " & _
" " & _
"" & _
"| Zip: | " & _
"" & Session("zip") & " | " & _
" " & _
"" & _
"| Phone: | " & _
"" & Session("phone") & " | " & _
" " & _
"" & _
"| Email: | " & _
"" & Session("email") & " | " & _
" " & _
"" & _
"| Patron Level | " & _
"" & Session("level") & " | " & _
" " & _
"" & _
"| Drink Tickets: | " & _
"" & Session("drinktix") & " | " & _
" " & _
"" & _
"| Your childs grade | " & _
"" & Session("grade") & " | " & _
" "
if Session("attend")="Yes" Then
body=body & _
"" & _
"| I am attending the ball. | " & _
"" &"" & " | " & _
" "
end if
if session("unable")="unable" then
body=body & _
"" & _
"| I am unable to attend the ball but have made a patron donation. | " & _
"" & "" & " | " & _
" "
end if
body=body & _
"" & _
"| You requested | " & _
"" & Session("beef") &" beef entrees"& " | " & _
" " & _
"" & _
"| You requested | " & _
"" & Session("chicken") &" chicken entrees"& " | " & _
" " & _
"" & _
"| You requested | " & _
"" & Session("vegetarian") &" vegetarian entrees"& " | " & _
" "
body=body & _
"" & _
"| CC Type: | " & _
"" & Session("cctype") & " | " & _
" " & _
"" & _
"| Exp. Date: | " & _
"" & Session.Contents("expdate") & " | " & _
" " & _
"" & _
"| Amount Charged: | " & _
"" & FormatCurrency(Session.Contents("Cost")) & " | " & _
" " & _
" " & _
"Additional Information " & _
Session("seating") &" "
if Session("expresspay")="True" then
body=body & _
" I would like to Express pay. I will contact Carol Demirjian at 818-505-5306 to set this up."
end if
'send confirmation email
SET Mailer = nothing
SET Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.ContentType = "text/html"
Mailer.FromName = "2007 Campbell Hall Ball"
Mailer.FromAddress = "demirjc@campbellhall.org"
Mailer.RemoteHost = "smtp.campbellhall.org"
'Mailer.AddBCC "Gerardo Lopez", "glopez@abex.com"
Mailer.AddBCC "Alex Roberts", "robertal@campbellhall.org"
'Mailer.AddBCC "Carol Demirjian", "demirjc@campbellhall.org"
'Mailer.AddBCC "Courtney Peterson", "petersc@campbellhall.org"
Mailer.AddRecipient Session.Contents("firstname") & " " & Session.Contents("lastname"), Session.Contents("email")
Mailer.Subject = "2007 Campbell Hall Ball"
Mailer.BodyText = body
'send confirmation email
if not Mailer.SendMail then
Mailer.SendMail
else
Response.Write ""
end if
myname=Session("firstname")&" "&Session("lastname")
address=Session("address1")&" "&Session("address2")
dim misc
if Session("attend")="Yes" Then
misc=misc & "I am attending the ball"
end if
if session("unable")="unable" then
misc=misc & "I am unable to attend the ball but have made a patron donation."
end if
if Session("expresspay")="True" then
misc=misc & "I would like to Express pay. I will contact Carol Demirjian at 818-505-5306 to set this up."
end if
insertreg= "insert into registration (name,address,city,state,zip,phone,"&_
"email,childgrade,drinktickets,patronlevel,seatrequest, ccexp, cctype, total, submitdate, misc) values ('" & sql_esc(myname)&"','"& sql_esc(address)&"','"&sql_esc(Session("city"))&"','"&_
sql_esc(Session("state"))&"','"&sql_esc(Session("zip"))&"','"&sql_esc(Session("phone"))&"','"&sql_esc(Session("email"))&"','"&_
sql_esc(Session("grade"))&"','"&sql_esc(Session("drinktix"))&"','"&sql_esc(Session("level"))&"','"&sql_esc(Session("seating"))&"','"&sql_esc(Session("expdate"))&"','"&_
sql_esc(Session("cctype"))&"','"&sql_esc(FormatCurrency(Session.Contents("Cost")))&"','"& now()&"','"& sql_esc(misc)&"')"
Session("insertreg")=insertreg
'response.write(Session("insertreg"))
Conn.Execute(insertreg)
%>
<%Session("body")=body
response.redirect("patronconfirm.asp")%>
<%
Conn.Close
SET Conn = Nothing
else
Session.Contents("errormessage") = "Your Credit Card could not be charged. Please verify that all information is accurate."
%>
<%
end if
end if
end if
%>
|
|

|

|
|
|