home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / EmailList.asp < prev    next >
Text File  |  2006-10-25  |  7KB  |  199 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 list
  7. '                      or creating a new one.  
  8. '   COPYRIGHT NOTICE                                
  9. '
  10. '   See attached Software License Agreement
  11. '
  12. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  13. '***********************************************************************
  14. %>
  15. <!--#Include File="Include/Config_inc.asp"-->
  16. <!--#Include File="Include/SurveyUtility_inc.asp"-->
  17. <!--#Include File="Include/Utility_inc.asp"-->
  18. <!--#Include File="Include/adovbs_inc.asp"-->
  19. <!--#Include File="Include/Constants_inc.asp"-->
  20. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  21. <!--#Include File="Include/CurrentUser_inc.asp"-->
  22.  
  23. <%
  24.     'If the user does not have "Create" or "Admin" permission, redirect to the access denied page.
  25.     If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
  26.         Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
  27.     End If
  28.  
  29.     Dim rsEmailList
  30.     Dim lngEmailListID
  31.     Dim lngEmailAddressID
  32.     Dim strSQL
  33.     Dim strPageTitle
  34.     Dim strListName
  35.     Dim strDescription
  36.     Dim strDefaultYN
  37.     Dim strCreatedDate
  38.     Dim lngEmailAddressCount
  39.     Dim rsEmailAddresses
  40.  
  41.     'Initialization
  42.     Set rsEmailAddresses = Server.CreateObject("ADODB.Recordset")
  43.     Set rsEmailList = Server.CreateObject("ADODB.Recordset")
  44.     
  45.     lngEmailListID = Request.QueryString("EmailListID")
  46.     strPageTitle = "Edit Email List"
  47.  
  48.     'Load all the data from the database
  49.     strSQL = "SELECT email_list_id, list_name, default_yn, created_date, email_address_count, list_description " & _
  50.              "FROM sur_email_list " & _
  51.              "WHERE email_list_id = " & lngEmailListID
  52.     rsEmailList.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenForwardOnly, adLockReadOnly, adCmdText
  53.     rsEmailList.MoveFirst
  54.     strListName = rsEmailList("list_name")
  55.     strDescription = rsEmailList("list_description")
  56.     strDefaultYN = rsEmailList("default_yn")
  57.     strCreatedDate = CustomDateFormatDisplay(rsEmailList("created_date"))
  58.     lngEmailAddressCount = CLng(rsEmailList("email_address_count"))
  59.  
  60.     'Clean up
  61.     rsEmailList.Close
  62.     Set rsEmailList = Nothing
  63. %>
  64.  
  65. <html>
  66. <head>
  67.     <title><%=strPageTitle%></title>
  68.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  69. </head>
  70.  
  71. <script language ="JavaScript" src="ClientInclude/Utility.js"></script>
  72. <script language="JavaScript">
  73. function deleteEmailList()
  74. {
  75.     if (confirm("Are you sure you want to delete this email list?") == true) //OK
  76.     {
  77.         window.location.href = 'DeleteEmailList.asp?EmailListID=<%=lngEmailListID%>';
  78.     }
  79. }
  80.  
  81. function submitCheck() 
  82. {
  83.     if (trim(document.forms['frmEmailList'].txtListName.value) == "")
  84.     {    
  85.         alert("Please enter a value for the list name.");
  86.         document.forms['frmEmailList'].txtListName.focus();
  87.     }
  88. <%    
  89.     'If this email list is not the default, add code that displays a message should the user make it the default.
  90.     If strDefaultYN = SUR_BOOLEAN_NEGATIVE Then
  91. %>
  92.         else if (document.forms['frmEmailList'].cboDefault.value == '<%=SUR_BOOLEAN_POSITIVE%>')
  93.         {
  94.             if (confirm("Making this email list the default removes the default setting from all other email lists.  Are you sure you want to make this email list the default?") == true) //OK
  95.             {
  96.                 document.forms['frmEmailList'].submit();
  97.             }
  98.         }
  99. <%
  100.     End If
  101. %>
  102.     else
  103.     {
  104.         document.forms['frmEmailList'].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="frmEmailList" method="post" action="EmailListAction.asp" onSubmit="return submitCheck();">
  125.     <input type="hidden" name="EmailListID" value="<%=lngEmailListID%>">
  126.     <tr>
  127.         <td width="1"></td>
  128.         <td width="730" valign="center" height="36">
  129.             <span class="Normal">All fields marked with an asterisk (<span class="Required">*</span>) are required.</span>
  130.         </td>
  131.         <td width="1"> </td>
  132.     </tr>
  133. </table>
  134. <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  135. <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  136.     <tr>
  137.         <td width="1" rowspan="25"></td>
  138.         <td width="170" valign="bottom" class="NormalBold">
  139.             <label for="txtListName">List Name:</label><span class="Required">*</span>
  140.         </td>
  141.         <td width="560" valign="bottom" class="Normal">
  142.             <input value="<%=strListName%>" type="text" name="txtListName" id="txtListName" maxlength="100" style="width:570px" size="30">
  143.         </td>
  144.         <td width="1" rowspan="25"> </td>
  145.     </tr>
  146.     <tr>
  147.         <td valign="top" class="NormalBold">
  148.             <label for="txtDescription">Description:</label>
  149.         </td>
  150.         <td valign="top" class="Normal">
  151.             <textarea class="TextareaStyle" name="txtDescription" id="txtDescription" rows="4" style="width:570px"><%=strDescription%></textarea>
  152.         </td>
  153.     </tr>
  154.     <tr>
  155.         <td valign="top" class="NormalBold">
  156.             <label for="cboDefault">Default:</label><span class="Required">*</span>
  157.         </td>
  158.         <td valign="top" class="Normal">
  159.             <select name="cboDefault" id="cboDefault" style="width:100px">
  160.                 <option <% If strDefaultYN = SUR_BOOLEAN_NEGATIVE Then Response.Write "selected" End If %> value="<%=SUR_BOOLEAN_NEGATIVE%>"><%=SUR_BOOLEAN_NEGATIVE_DISPLAY%></option>
  161.                 <option <% If strDefaultYN = SUR_BOOLEAN_POSITIVE Then Response.Write "selected" End If %> value="<%=SUR_BOOLEAN_POSITIVE%>"><%=SUR_BOOLEAN_POSITIVE_DISPLAY%></option>
  162.             </select>
  163.         </td>
  164.     </tr>
  165.     <tr>
  166.         <td valign="top" class="NormalBold">
  167.             Date Created:
  168.         </td>
  169.         <td valign="top" class="Normal">
  170.             <%=CustomDateFormatDisplay(strCreatedDate)%>
  171.         </td>
  172.     </tr>
  173.     <tr>
  174.         <td valign="top" class="NormalBold">
  175.             Email Addresses:
  176.         </td>
  177.         <td valign="top" class="Normal">
  178.             <%=lngEmailAddressCount%>
  179.         </td>
  180.     </tr>
  181.     <tr>
  182.         <td align="right" valign="middle" colspan="2">
  183.             <a href="EmailListList.asp"><img border="0" alt="Cancel" name="btnCancel" src="Resources/Buttons/Cancel.gif"></a>
  184.             <a href="javascript:submitCheck();"><img border="0" alt="Save" name="btnSave" src="Resources/Buttons/Save.gif"></a>
  185.         </td>
  186.     </tr>
  187.     </form>
  188. </table>
  189.  
  190. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  191.  
  192. </body>
  193. </html>
  194.  
  195. <%        
  196.     'Ensure that the web server returns the page
  197.     Response.Flush
  198. %>
  199.