home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / EmailAddress.asp < prev    next >
Text File  |  2006-10-25  |  9KB  |  226 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 allows for editing an existing email address
  7. '                      or creating a new one.  Users can also view and manage
  8. '                      the list of email addresses for an email list.
  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/SurveyUtility_inc.asp"-->
  19. <!--#Include File="Include/Utility_inc.asp"-->
  20. <!--#Include File="Include/adovbs_inc.asp"-->
  21. <!--#Include File="Include/Constants_inc.asp"-->
  22. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  23. <!--#Include File="Include/CurrentUser_inc.asp"-->
  24.  
  25. <%
  26.     'If the user does not have "Create" or "Admin" permission, redirect to the access denied page.
  27.     If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
  28.         Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
  29.     End If
  30.  
  31.     Dim rsEmailAddress
  32.     Dim lngEmailAddressID
  33.     Dim lngEmailListID
  34.     Dim strEmailListName
  35.     Dim strSQL
  36.     Dim strPageTitle
  37.     Dim strEmailAddress
  38.     Dim strFirstName
  39.     Dim strLastName
  40.     Dim strCustomData1
  41.     Dim strCustomData2
  42.     Dim strCustomData3
  43.     Dim strActiveYN
  44.  
  45.     'Initialization
  46.     Set rsEmailAddress = Server.CreateObject("ADODB.Recordset")
  47.     
  48.     lngEmailAddressID = Request.QueryString("EmailAddressID")
  49.     strPageTitle = "Edit Email Address"
  50.  
  51.     'Load the existing data from the database
  52.     strSQL = "SELECT email_address_id, el.email_list_id, list_name, email_address, first_name, last_name, " & _
  53.                 "custom_data_1, custom_data_2, custom_data_3, ea.active_yn " & _
  54.                 "FROM sur_email_address ea, sur_email_list el " & _
  55.                 "WHERE ea.email_list_id = el.email_list_id " & _
  56.                 "AND email_address_id = " & lngEmailAddressID
  57.     rsEmailAddress.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenForwardOnly, adLockReadOnly, adCmdText
  58.     rsEmailAddress.MoveFirst
  59.     lngEmailListID = rsEmailAddress("email_list_id")
  60.     strEmailListName = rsEmailAddress("list_name")
  61.     strEmailAddress = rsEmailAddress("email_address")
  62.     strFirstName = rsEmailAddress("first_name")
  63.     strLastName = rsEmailAddress("last_name")
  64.     strCustomData1 = rsEmailAddress("custom_data_1")
  65.     strCustomData2 = rsEmailAddress("custom_data_2")
  66.     strCustomData3 = rsEmailAddress("custom_data_3")
  67.     strActiveYN = rsEmailAddress("active_yn")
  68.         
  69.     'Clean up
  70.     rsEmailAddress.Close
  71.     Set rsEmailAddress = Nothing
  72. %>
  73.  
  74. <html>
  75. <head>
  76.     <title><%=strPageTitle%></title>
  77.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  78. </head>
  79.  
  80. <script language ="JavaScript" src="ClientInclude/Utility.js"></script>
  81. <script language="JavaScript">
  82. function deleteEmailAddress()
  83. {
  84.     if (confirm("Are you sure you want to delete this email address?") == true) //OK
  85.     {
  86.         window.location.href = 'DeleteEmailAddress.asp?EmailAddressID=<%=lngEmailAddressID%>&EmailListID=<%=lngEmailListID%>&EmailListName=<%=Replace(Request.QueryString("EmailListName"), "'", "\'")%>';
  87.     }
  88. }
  89.  
  90. function submitCheck() 
  91. {
  92.     if (trim(document.forms['frmEmailAddress'].txtEmailAddress.value) == "")
  93.     {    
  94.         alert("Please enter a value for the email address.");
  95.         document.forms['frmEmailAddress'].txtEmailAddress.focus();
  96.     }
  97.     else if (isValidEmailAddress(trim(document.forms['frmEmailAddress'].txtEmailAddress.value)) == false)
  98.     {    
  99.         alert("The email address entered is not a valid format for an email address.");
  100.         document.forms['frmEmailAddress'].txtEmailAddress.focus();
  101.     }
  102.     else
  103.     {
  104.         document.forms['frmEmailAddress'].submit();
  105.     }
  106. }
  107. </script>
  108.  
  109. <body class="MainBodyStyle">
  110.  
  111. <!--#Include File="Include/FrameworkTop_inc.asp"-->
  112.  
  113. <table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
  114.     <tr>
  115.         <td height="36" valign="center">
  116.               <span class="H1HeadingStyle"><a name="skipnav" tabindex="1"><%=strPageTitle%></a></span> <img style="cursor:hand" alt="Help" onClick="javascript:window.open('Help/Help.htm#EmailLists', null, 'menubar=no,toolbar=no,titlebar=no,status=no,left=10,top=10,scrollbars=yes,resizable=yes,height=550,width=770');" border="0" src="Resources/Images/Help.gif">
  117.         </td>
  118.     </tr>
  119. </table>
  120.  
  121. <!--#Include File="Include/FrameworkTop2_inc.asp"-->
  122.  
  123. <table width="740" border="0" cellpadding="0" cellspacing="6" class="LightGrayBackgroundColor">
  124.     <form name="frmEmailAddress" method="post" action="EmailAddressAction.asp" onSubmit="return submitCheck();">
  125.         <input type="hidden" name="EmailAddressID" value="<%=lngEmailAddressID%>">
  126.         <input type="hidden" name="EmailListID" value="<%=lngEmailListID%>">
  127.         <input type="hidden" name="EmailListName" value="<%=Request.QueryString("EmailListName")%>">
  128.         <tr>
  129.             <td width="1" rowspan="15"></td>
  130.             <td width="730" valign="center" height="36">
  131.                 <span class="Normal">All fields marked with an asterisk (<span class="Required">*</span>) are required.</span>
  132.             </td>
  133.             <td width="1" rowspan="15"></td>
  134.         </tr>
  135.     </table>
  136.     <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  137.     <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  138.         <tr>
  139.             <td width="1" rowspan="15"></td>
  140.             <td width="150" valign="top" class="NormalBold">
  141.                 List Name:
  142.             </td>
  143.             <td width="572" valign="top" class="Normal">
  144.                 <%=strEmailListName%>
  145.             </td>
  146.             <td width="1" rowspan="15"></td>
  147.         </tr>
  148.         <tr>
  149.             <td valign="center" class="NormalBold">
  150.                 <label for="txtEmailAddress">Email Address:</label><span class="Required">*</span>
  151.             </td>
  152.             <td valign="top" class="Normal">
  153.                 <input value="<%=strEmailAddress%>" type="text" name="txtEmailAddress" id="txtEmailAddress" maxlength="75" style="width:400px" size="30">
  154.             </td>
  155.         </tr>
  156.         <tr>
  157.             <td valign="center" class="NormalBold">
  158.                 <label for="txtFirstName">First Name:</label>
  159.             </td>
  160.             <td valign="top" class="Normal">
  161.                 <input value="<%=strFirstName%>" type="text" name="txtFirstName" id="txtFirstName" maxlength="50" style="width:400px" size="30">
  162.             </td>
  163.         </tr>
  164.         <tr>
  165.             <td valign="center" class="NormalBold">
  166.                 <label for="txtLastName">Last Name:</label>
  167.             </td>
  168.             <td valign="top" class="Normal">
  169.                 <input value="<%=strLastName%>" type="text" name="txtLastName" id="txtLastName" maxlength="50" style="width:400px" size="30">
  170.             </td>
  171.         </tr>
  172.         <tr>
  173.             <td valign="center" class="NormalBold">
  174.                 <label for="txtCustomData1">Custom Data 1:</label>
  175.             </td>
  176.             <td valign="top" class="Normal">
  177.                 <input value="<%=strCustomData1%>" type="text" name="txtCustomData1" id="txtCustomData1" maxlength="255" style="width:400px" size="30">
  178.             </td>
  179.         </tr>
  180.         <tr>
  181.             <td valign="center" class="NormalBold">
  182.                 <label for="txtCustomData2">Custom Data 2:</label>
  183.             </td>
  184.             <td valign="top" class="Normal">
  185.                 <input value="<%=strCustomData2%>" type="text" name="txtCustomData2" id="txtCustomData2" maxlength="255" style="width:400px" size="30">
  186.             </td>
  187.         </tr>
  188.         <tr>
  189.             <td valign="center" class="NormalBold">
  190.                 <label for="txtCustomData3">Custom Data 3:</label>
  191.             </td>
  192.             <td valign="top" class="Normal">
  193.                 <input value="<%=strCustomData3%>" type="text" name="txtCustomData3" id="txtCustomData3" maxlength="255" style="width:400px" size="30">
  194.             </td>
  195.         </tr>
  196.         <tr>
  197.             <td valign="center" class="NormalBold">
  198.                 <label for="cboActive">Active:</label><span class="Required">*</span>
  199.             </td>
  200.             <td valign="top" class="Normal">
  201.                 <select name="cboActive" id="cboActive" style="width:100px">
  202.                     <option <% If strActiveYN = SUR_BOOLEAN_NEGATIVE Then Response.Write "selected" End If %> value="<%=SUR_BOOLEAN_NEGATIVE%>"><%=SUR_BOOLEAN_NEGATIVE_DISPLAY%></option>
  203.                     <option <% If strActiveYN = SUR_BOOLEAN_POSITIVE Then Response.Write "selected" End If %> value="<%=SUR_BOOLEAN_POSITIVE%>"><%=SUR_BOOLEAN_POSITIVE_DISPLAY%></option>
  204.                 </select>
  205.             </td>
  206.         </tr>
  207.         <tr>
  208.             <td align="right" valign="middle" colspan="2">
  209.                 <a href="EmailAddressList.asp?EmailListID=<%=Request.QueryString("EmailListID")%>&EmailListName=<%=Request.QueryString("EmailListName")%>"><img border="0" alt="Back" name="btnBack" src="Resources/Buttons/Back.gif"></a>
  210.                 <a href="javascript:deleteEmailAddress();"><img border="0" alt="Delete this email address" name="btnDelete" src="Resources/Buttons/Delete.gif"></a>
  211.                 <a href="javascript:submitCheck();"><img border="0" alt="Save" name="btnSave" src="Resources/Buttons/Save.gif"></a>
  212.             </td>
  213.         </tr>
  214.     </form>
  215. </table>
  216.  
  217. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  218.  
  219. </body>
  220. </html>
  221.  
  222. <%        
  223.     'Ensure that the web server returns the page
  224.     Response.Flush
  225. %>
  226.