%@LANGUAGE="VBSCRIPT"%> <%OPTION EXPLICIT%> <% '---------------------------------------- ' FILE: /admin/donationAction.asp ' PROJECT: JBC ' Developed for JBC by ' Saltmine Creative, Inc. ' www.saltmine.com '---------------------------------------- 'Set the connection dim objConn : set objConn = DAGetPersistentConnection(c_strDAJBCConnection) dim rsResults dim rsValidate dim strToEmail : strToEmail = c_DonationAgentEmail dim strDonationAmount : strDonationAmount = trim(Request("txtDonationAmount")) dim strDonationName : strDonationName = trim(Request("txtDonationName")) dim strCreditCardNum : strCreditCardNum = trim(Request("txtCreditCardNum")) dim strCreditCardType : strCreditCardType = trim(Request("txtTypeofCredit")) dim strExpirationMonth : strExpirationMonth = trim(Request("txtExpMonth")) dim strExpirationYear : strExpirationYear = trim(Request("txtExpYear")) dim strFirstName : strFirstName = trim(Request("txtFirstName")) dim strLastName : strLastName = trim(Request("txtLastName")) dim strMiddleInitial : strMiddleInitial = trim(Request("txtMiddleInitial")) dim strAddress1 : strAddress1 = trim(Request("txtAddress1")) dim strAddress2 : strAddress2 = trim(Request("txtAddress2")) dim strCity : strCity = trim(Request("txtCity")) dim strState : strState = trim(Request("txtState")) dim strZipCode : strZipCode = trim(Request("txtZipCode")) dim strCountryCode : strCountryCode = trim(Request("selCountryCode")) dim strEmail : strEmail = trim(Request("txtEmailAddress")) dim strPhone : strPhone = trim(Request("txtPhone")) dim strContactCode : strContactCode = Request("rdContactInfo") dim strdonationLocation : strdonationLocation = Request("rdlocation") dim intContactId : intContactId = 0 dim strMessage : strMessage = "" dim strBodyText : strBodyText = "" 'Setting the location for the donation if strdonationLocation = "fund" then strdonationLocation = "JBC Fund" else strdonationLocation = "JBC Foundation" end if 'Both indicates that they want their address and e-mail to be held if strContactCode = "Both" then if strEmail <> "" then Call DAExecuteQuery(objConn, rsValidate, "SET NOCOUNT ON EXEC spValidateContact " & "'" & strEmail & "'", false) end if if CBool(rsValidate("IsUnique")) then 'this is a new person Call DAExecuteQuery(objConn, rsResults, "Set NOCOUNT ON " &_ " EXEC spAddContact " &_ "'" & strDonationName & "'," &_ "'" & strLastName & "'," &_ "'" & strFirstName & "'," &_ "'" & strMiddleInitial & "'," &_ "'" & strAddress1 & "'," &_ "'" & strAddress2 & "'," &_ "'" & strCity & "'," &_ "'" & strState & "'," &_ "'" & strZipCode & "'," &_ "'" & strEmail & "'," &_ "'" & strPhone & "'," &_ "'" & date & "'," &_ "'" & strCountryCode & "'" , false) else 'this person already exists - so update their information Call DAExecuteQuery(objConn, rsResults, "SET NOCOUNT ON EXEC spGetContactbyEmailAddress " & "'" & strEmail & "'", false) if rsResults("ContactId") > 0 then intContactId = rsResults("ContactId") Call DAExecuteQueryNoResults(objConn, rsResults, "Set NOCOUNT ON " &_ " EXEC spUpdateContact " &_ intContactId & "," &_ "'" & strDonationName & "'," &_ "'" & strLastName & "'," &_ "'" & strFirstName & "'," &_ "'" & strMiddleInitial & "'," &_ "'" & strAddress1 & "'," &_ "'" & strAddress2 & "'," &_ "'" & strCity & "'," &_ "'" & strState & "'," &_ "'" & strZipCode & "'," &_ "'" & strEmail & "'," &_ "'" & strPhone & "'," &_ "'" & date & "'," &_ "'" & strCountryCode & "'") end if end if end if 'The user has chosen to just give their e-mail address if strContactCode = "Email" then if strEmail <> "" then Call DAExecuteQuery(objConn, rsValidate, "SET NOCOUNT ON EXEC spValidateContact " & "'" & strEmail & "'", false) if CBool(rsValidate("IsUnique")) then 'this is a new person Call DAExecuteQuery(objConn, rsResults, "Set NOCOUNT ON " &_ " EXEC spAddContact " &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & NULL & "'," &_ "'" & strEmail & "'," &_ "'" & NULL & "'," &_ "'" & date & "'," &_ "'" & strCountryCode & "'" , false) end if end if end if strBodyText = "D O N A T I O N S U B M I S S I O N" & VBCrlf & VBCrlf strBodyText = strBodyText & "I N F O R M A T I O N" & VBCrlf &_ "Donation Location: " & strdonationLocation & VBCrlf &_ "Donation Amount: " & strDonationAmount & VBCrlf & _ "Donation Name: " & strDonationName & VBCrlf & _ "Credit Card Number: " & strCreditCardNum & VBCrlf &_ "Credit Card Type: " & strCreditCardType & VBCrlf &_ "Expiration Month " & strExpirationMonth & VBCrlf &_ "Expiration Year: " & strExpirationYear & VBCrlf &_ "From: " & strFirstName & " " & strMiddleInitial & " " & strLastName & VBCrlf & _ "Address: " & strAddress1 & VBCrlf & _ strAddress2 & VBCrlf & _ "City: " & strCity & VBCrlf & _ "State: " & strState & VBCrlf & _ "Zip: " & strZipCode & VBCrlf & _ "Country: " & strCountryCode & VBCrlf &_ "Phone: " & strPhone & VBCrlf & _ "Email: " & strEmail & VBCrlf '* Try to send the e-mail. If it succeeds, send the user to the '* success page. If it fails, send them to the failure page. if SendOneMail( c_WebserverFingerName, c_WebserverEmail, strToEmail, "Donation Submittal", strBodyText) then strMessage = "We appreciate the contribution that you have chosen to donate." else strMessage = "We are experiencing technical problems, please resubmit your information." end if %>
<%=strMessage%>