home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / SendEmailMessage1.asp < prev    next >
Text File  |  2006-10-25  |  9KB  |  260 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 is the first of two pages for inputting information to send out email
  7. '                      messages.  This page allows the user to input the recipient email addresses
  8. '                      or to select 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/SurveyUtility_inc.asp"-->
  18. <!--#Include File="Include/Utility_inc.asp"-->
  19. <!--#Include File="Include/Constants_inc.asp"-->
  20. <!--#Include File="Include/Config_inc.asp"-->
  21. <!--#Include File="Include/ID_inc.asp"-->
  22. <!--#Include File="Include/adovbs_inc.asp"-->
  23. <!--#Include File="Include/CurrentUser_inc.asp"-->
  24. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  25. <%
  26.     'If the user does not have "Create" or "Admin" permission, redirect them 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 rsEmailLists
  32.     Dim strSQL
  33.     Dim lngSurveyID
  34.     Dim lngEmailListID
  35.     Dim strDisplay
  36.                 
  37.     'Initialization
  38.     Set rsEmailLists = Server.CreateObject("ADODB.Recordset")
  39.     lngEmailListID = Request.QueryString("EmailListID")
  40. %>    
  41. <html>
  42. <head>
  43.     <title>Send Email Message</title>
  44.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  45. </head>
  46.  
  47. <script language ="JavaScript" src="ClientInclude/Utility.js"></script>
  48. <script language ="JavaScript">
  49. function submitCheck() 
  50. {
  51.     // Make sure that the user either selected an email list or entered a list of email addresses
  52.     if (document.forms['frmSendEmailMessage'].cboEmailList.value == '<%=SUR_COMBO_PLEASE_SELECT%>')
  53.     {
  54.         alert("You must select an email list.");
  55.         document.forms['frmSendEmailMessage'].cboEmailList.focus();
  56.         return false;
  57.     }
  58.  
  59.     return true;
  60. }
  61. </script>
  62.  
  63. <body class="MainBodyStyle">
  64.  
  65. <!--#Include File="Include/FrameworkTop_inc.asp"-->
  66.  
  67. <table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
  68.     <tr>
  69.         <td height="36" valign="center">
  70.               <span class="H1HeadingStyle"><a name="skipnav" tabindex="1">Send Email Messages</a></span> <img style="cursor:hand" alt="Help" onClick="javascript:window.open('Help/Help.htm#EmailMessages', 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">
  71.         </td>
  72.     </tr>
  73. </table>
  74.  
  75. <!--#Include File="Include/FrameworkTop2_inc.asp"-->
  76.  
  77.     <table width="740" border="0" cellpadding="0" cellspacing="6" class="LightGrayBackgroundColor">
  78.         <form action="SendEmailMessage2.asp" method="post" name="frmSendEmailMessage" onSubmit="return submitCheck();">
  79. <%    
  80.             If Len(Request.QueryString("SurveyID")) > 0 Then
  81. %>
  82.             <input type="hidden" value="<%=Request.QueryString("SurveyID")%>" name="SurveyID" ID="Hidden1">
  83. <%
  84.             End If
  85. %>
  86.         <tr>
  87.             <td width="1" rowspan="2"></td>
  88.             <td height="34" valign="center">
  89.                 <span class="H2HeadingStyle">Step 1 of 2 -- Email Recipients</span>
  90.             </td>
  91.             <td width="1" rowspan="2"> </td>
  92.         </tr>
  93.         <tr>
  94.             <td valign="top" width="710" height="34">
  95.                 <span class="Normal">
  96.                     Specify the email recipients by selecting an email list.  You may optionally filter the email addresses 
  97.                     in the selected email list using the filter options below.<br>
  98.                 </span>
  99.             </td>
  100.         </tr>
  101.     </table>
  102.     <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  103.     <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  104. <%
  105.         'Create the recordset with all of the available email lists.  To be available, an email list must be owned
  106.         'by the current user or the user must be an administrator, and the email list must have at least one email
  107.         'address in it.
  108.         strSQL = "SELECT email_list_id, list_name, email_address_count " & _
  109.                     "FROM sur_email_list el, sur_user u " & _
  110.                     "WHERE el.user_id = u.user_id "
  111.         'Display only those email lists owned by the user to those with "Create" permission
  112.         If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
  113.             strSQL = strSQL & "AND u.username = " & SQLEncode(GetUsername)
  114.         End If                 
  115.         strSQL = strSQL & " AND email_address_count > 0 " & _
  116.                           " ORDER BY default_yn DESC, list_name"
  117.         rsEmailLists.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenDynamic, , adCmdText
  118. %>
  119.         <tr>
  120.             <td width="1" rowspan="10"></td>
  121.             <td valign="bottom" class="Normal" height="26">
  122.                 <span class="QuestionSectionHeadingSpanStyle">
  123.                     Select Email List
  124.                 </span>
  125.             </td>
  126.             <td width="1" rowspan="10"> </td>
  127.         </tr>
  128.         <tr>
  129.             <td>
  130.                 <span class="Normal">
  131.                     <label for="cboEmailList">Select the email list to which the email message shoud be sent.</label>
  132.                 </span>
  133.                 <select style="width:643px" name="cboEmailList" id="cboEmailList">
  134. <%
  135.                 If rsEmailLists.EOF Then
  136. %>
  137.                     <option value="<%=SUR_COMBO_NO_AVAILABLE_EMAIL_LISTS%>"><%=SUR_COMBO_NO_AVAILABLE_EMAIL_LISTS%></option>
  138. <%                    
  139.                 Else
  140. %>                
  141.                     <option value="<%=SUR_COMBO_PLEASE_SELECT%>"><%=SUR_COMBO_PLEASE_SELECT%></option>
  142. <%        
  143.                     rsEmailLists.MoveFirst
  144.                     Do While Not rsEmailLists.EOF
  145.                         strDisplay = rsEmailLists("list_name")
  146.                         If CLng(rsEmailLists("email_address_count")) = 1 Then
  147.                             strDisplay = strDisplay & " (" & rsEmailLists("email_address_count") & " email address)"
  148.                         Else
  149.                             strDisplay = strDisplay & " (" & rsEmailLists("email_address_count") & " email addresses)"
  150.                         End If
  151. %>
  152.                         <option <% If CStr(lngEmailListID) = CStr(rsEmailLists("email_list_id")) Then Response.Write "SELECTED" End If %> value="<%=rsEmailLists("email_list_id")%>"><%=strDisplay%></option>
  153. <%                    
  154.                         rsEmailLists.MoveNext
  155.                     Loop
  156.  
  157.                     'Clean up
  158.                     rsEmailLists.Close
  159.                     Set rsEmailLists = Nothing
  160.                 End If
  161. %>
  162.                 </select>
  163.             </td>
  164.         </tr>
  165.         <tr>
  166.             <td valign="bottom" class="Normal" height="34">
  167.                 <span class="QuestionSectionHeadingSpanStyle">
  168.                     <label for="optFilterType">Apply Filter</label>
  169.                 </span>
  170.                 <br>
  171.             </td>
  172.         </tr>
  173.         <tr>
  174.             <td>
  175.                 <table width="700" cellspacing="4" cellpadding="0" border="0">
  176.                     <tr>
  177.                         <td width="10">
  178.                             <input checked type="radio" name="optFilterType" id="optFilterType" value="<%=SUR_EMAIL_LIST_ALL%>">
  179.                         </td>
  180.                         <td colspan="2">
  181.                             <span class="Normal">Send to all email addresses</span>
  182.                         </td>
  183.                     </tr>
  184.                     <tr>
  185.                         <td>
  186.                             <input type="radio" name="optFilterType" id="optFilterType" value="<%=SUR_EMAIL_LIST_WITH_FILTER%>">
  187.                         </td>
  188.                         <td colspan="2">
  189.                             <span class="Normal">Send to email addresses that match:</span>
  190.                         </td>
  191.                     </tr>
  192.                     <tr>
  193.                         <td rowspan="15" width="10"> </td>
  194.                         <td width="150">
  195.                             <span class="NormalBold"><label for="cboActive">Active:</label></span>
  196.                         </td>
  197.                         <td width="555">
  198.                             <select name="cboActive" id="cboActive" style="width:150px">
  199.                                 <option value="<%=SUR_COMBO_ALL%>"><%=SUR_COMBO_ALL%></option>
  200.                                 <option value="<%=SUR_BOOLEAN_NEGATIVE%>"><%=SUR_BOOLEAN_NEGATIVE_DISPLAY%></option>
  201.                                 <option value="<%=SUR_BOOLEAN_POSITIVE%>"><%=SUR_BOOLEAN_POSITIVE_DISPLAY%></option>
  202.                             </select>
  203.                         </td>
  204.                     </tr>
  205.                     <tr>
  206.                         <td>
  207.                             <span class="NormalBold"><label for="txtEmailAddress">Email Address:</label></span>
  208.                         </td>
  209.                         <td>
  210.                             <input type="text" name="txtEmailAddress" id="txtEmailAddress" style="width:150px">
  211.                         </td>
  212.                     </tr>
  213.                     <tr>
  214.                         <td>
  215.                             <span class="NormalBold"><label for="txtCustomData1">Custom Data 1:</label></span>
  216.                         </td>
  217.                         <td>
  218.                             <input type="text" name="txtCustomData1" id="txtCustomData1" style="width:150px">
  219.                         </td>
  220.                     </tr>
  221.                     <tr>
  222.                         <td>
  223.                             <span class="NormalBold"><label for="txtCustomData2">Custom Data 2:</label></span>
  224.                         </td>
  225.                         <td>
  226.                             <input type="text" name="txtCustomData2" id="txtCustomData2" style="width:150px">
  227.                         </td>
  228.                     </tr>
  229.                     <tr>
  230.                         <td>
  231.                             <span class="NormalBold"><label for="txtCustomData3">Custom Data 3:</label></span>
  232.                         </td>
  233.                         <td>
  234.                             <input type="text" name="txtCustomData3" id="txtCustomData3" style="width:150px">
  235.                         </td>
  236.                     </tr>
  237.                 </table>
  238.             </td>
  239.         </tr>
  240.     </table>
  241.     <table width="740" border="0" cellpadding="6" cellspacing="0" class="WhiteBackgroundColor">
  242.         <tr>
  243.             <td align="right">
  244.                 <a href="EmailListList.asp"><img border="0" alt="Cancel" src="Resources/Buttons/Cancel.gif" name="btnCancel"></a>
  245.                 <input type="image" border="0" alt="Continue" src="Resources/Buttons/Continue.gif" name="btnContinue"> 
  246.             </td>
  247.         </tr>
  248.     </form>
  249.     </table>
  250.  
  251. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  252.  
  253. </body>
  254. </html>
  255.  
  256. <%        
  257.     'Ensure that the web server returns the page
  258.     Response.Flush
  259. %>
  260.