home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey / EmailAddressAction.asp < prev    next >
Text File  |  2006-11-29  |  3KB  |  59 lines

  1. <!--#Include File="Include/Top_inc.asp"-->
  2. <%
  3. '***********************************************************************
  4. '   Application: SelectSurveyASP Advanced v8.1.11
  5. '   Author: Aaron Baril for ClassApps.com
  6. '   Page Description: This page works with EmailAddress.asp, and processes
  7. '                     the form for registering new email addresss by writing a database
  8. '                      record to the SUR_EMAIL_ADDRESS table.
  9. '
  10. '   COPYRIGHT NOTICE                                
  11. '
  12. '   See attached Software License Agreement
  13. '
  14. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  15. '***********************************************************************
  16. %>
  17. <!--#Include File="Include/Config_inc.asp"-->
  18. <!--#Include File="Include/Utility_inc.asp"-->
  19. <!--#Include File="Include/adovbs_inc.asp"-->
  20. <!--#Include File="Include/Constants_inc.asp"-->
  21. <!--#Include File="Include/ID_inc.asp"-->
  22. <!--#Include File="Include/CurrentUser_inc.asp"-->
  23. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  24. <%
  25.     'If the user does not have "Create" or "Admin" permission, redirect to the access denied page.
  26.     If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
  27.         Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
  28.     End If
  29.  
  30.     Dim strSQL
  31.     Dim conEmailAddress
  32.     Dim lngEmailAddressID
  33.         
  34.     'Initialization
  35.     Set conEmailAddress = Server.CreateObject("ADODB.Connection")
  36.     conEmailAddress.Open SURVEY_APP_CONNECTION
  37.     
  38.     'Get the email address ID
  39.     lngEmailAddressID = Request.Form("EmailAddressID")
  40.         
  41.     'Create the UPDATE statement and execute        
  42.     strSQL = "UPDATE sur_email_address " & _
  43.              "SET email_address = " & SQLEncode(Request.Form("txtEmailAddress")) & ", " & _
  44.              "first_name = " & SQLEncode(Request.Form("txtFirstName")) & ", " & _
  45.              "last_name = " & SQLEncode(Request.Form("txtLastName")) & ", " & _
  46.              "custom_data_1 = " & SQLEncode(Request.Form("txtCustomData1")) & ", " & _
  47.              "custom_data_2 = " & SQLEncode(Request.Form("txtCustomData2")) & ", " & _
  48.              "custom_data_3 = " & SQLEncode(Request.Form("txtCustomData3")) & ", " & _
  49.              "active_yn = " & SQLEncode(Request.Form("cboActive")) & _
  50.              " WHERE email_address_id = " & lngEmailAddressID
  51.     conEmailAddress.Execute ConvertSQL(strSQL), , adCmdText
  52.         
  53.     'Clean up
  54.     conEmailAddress.Close
  55.     Set conEmailAddress = Nothing
  56.  
  57.     'Redirect back to the list of email addresss
  58.     Response.Redirect "EmailAddressList.asp?EmailListID=" & Request.Form("EmailListID") & "&EmailListName=" & Request.Form("EmailListName")
  59. %>