home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / ImportEmailAddresses.asp < prev    next >
Text File  |  2006-10-25  |  6KB  |  158 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 the user to import email addresses for an email list.
  7. '
  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/SurveyUtility_inc.asp"-->
  16. <!--#Include File="Include/Utility_inc.asp"-->
  17. <!--#Include File="Include/Constants_inc.asp"-->
  18. <!--#Include File="Include/Config_inc.asp"-->
  19. <!--#Include File="Include/adovbs_inc.asp"-->
  20. <!--#Include File="Include/CurrentUser_inc.asp"-->
  21. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  22.  
  23. <%
  24.     'If the user does not have "Create" or "Admin" permission, redirect them 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.  
  30. <html>
  31. <head>
  32.     <title>Import Email Addresses</title>
  33.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  34. </head>
  35.  
  36. <script language ="JavaScript" src="ClientInclude/Utility.js"></script>
  37. <script language ="JavaScript">
  38. function submitCheck() 
  39. {
  40.     var strEmailText;
  41.     var arrEmailAddresses;
  42.     var arrEmailFirstName;
  43.     var i;
  44.     var strTemp;
  45.     
  46.     // Check the list of email addresses.  Split on the line feed, creating an array of 
  47.     // email address/first name/last name/custom data 1/custom data 2/custom data 3 records
  48.     var strEmailAddresses = document.forms['frmImportEmailAddresses'].txtEmailAddresses.value;
  49.     arrEmailAddresses = strEmailAddresses.split('\n');
  50.         
  51.     // Loop through each of the email address/first name/last name/custom data records
  52.     for (i = 0; i < arrEmailAddresses.length; i++)
  53.     {
  54.         // If the line has nothing but an Enter key on it, ignore it
  55.         if (arrEmailAddresses[i] != '\r')
  56.         {
  57.             // Split on the comma to create an array containing 1-4 items.  The first item is the email address.  Check 
  58.             // to make sure the email address is valid.
  59.             arrEmailFirstName = arrEmailAddresses[i].split(",");
  60.             if (arrEmailFirstName[0].length > 0)
  61.             {
  62.                 if (isValidEmailAddress(trim(arrEmailFirstName[0])) == false)
  63.                 {
  64.                     alert("The email addresses are not entered correctly.  The following email address is not valid: " + trim(arrEmailFirstName[0]));
  65.                     document.forms['frmImportEmailAddresses'].txtEmailAddresses.focus();
  66.                     return false;
  67.                 }
  68.             }
  69.         }
  70.     }
  71.  
  72.     return true;
  73. }
  74. </script>
  75.  
  76. <body class="MainBodyStyle">
  77.  
  78. <!--#Include File="Include/FrameworkTop_inc.asp"-->
  79.  
  80. <table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
  81.     <tr>
  82.         <td height="36" valign="center">
  83.               <span class="H1HeadingStyle"><a name="skipnav" tabindex="1">Import Email Addresses</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">
  84.         </td>
  85.     </tr>
  86. </table>
  87.  
  88. <%
  89.     Dim lngEmailListID
  90.     Dim strEmailListName
  91.         
  92.     'Initialization
  93.     lngEmailListID = Request.QueryString("EmailListID")
  94.     strEmailListName = Request.QueryString("EmailListName")
  95. %>
  96. <!--#Include File="Include/FrameworkTop2_inc.asp"-->
  97.  
  98. <table width="740" border="0" cellpadding="6" cellspacing="0" class="LightGrayBackgroundColor">
  99. <form action="ImportEmailAddressesAction.asp" method="post" name="frmImportEmailAddresses" onSubmit="return submitCheck();">
  100.     <input type="hidden" value="<%=lngEmailListID%>" name="EmailListID">
  101.         <tr>
  102.             <td colspan="3" height="40" valign="center">
  103.                 <table border="0" cellpadding="6" cellspacing="0" width="100%">
  104.                     <tr>
  105.                         <td>
  106.                             <span class="H2HeadingStyle"> Email Address Import for '<%=strEmailListName%>' Email List</span>
  107.                         </td>
  108.                     </tr>
  109.                 </table>
  110.             </td>
  111.         </tr>
  112.     </table>
  113.     <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  114.     <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  115.         <tr>
  116.             <td width="1" rowspan="10"></td>
  117.             <td align="left" width="730">
  118.                 <span class="Normal">
  119.                     <label for="txtEmailAddresses">Import your email list by simply pasting your email addresses on each line.</label>
  120.                     The acceptable format 
  121.                     for each line is: Email Address, First Name, Last Name, Custom Data 1, Custom Data 2, Custom Data 3.  
  122.                     Each field must be separated by a comma, and each entry must be on its own line.  If you wish to omit 
  123.                     any intermediate fields, you must insert a comma as a placeholder.  The examples below, which demostrate 
  124.                     correct syntax, should be removed when actually submitting email addresses.
  125.                 </span>
  126.                 <br>
  127.             </td>
  128.             <td width="1" rowspan="10"></td>
  129.         </tr>
  130.         <tr>
  131.             <td valign="top" class="Normal" align="left">
  132.                 <textarea class="TextareaStyle" rows="12" wrap="off" name="txtEmailAddresses" id="txtEmailAddresses" style="width:715">joe@mycompany.com,Joe
  133. fred@yourcompany.com
  134. alice@hercompany.com,,Johnson
  135. sam@hiscompany.com,Sam,Johnson,President
  136. eric@ourcompany.com,,,CEO,$250K,3 years</textarea>
  137.                 <span class="InlineHelpSpanStyle">Field Order:  Email Address, First Name, Last Name, Custom Data 1, Custom Data 2, Custom Data 3</span>
  138.             </td>
  139.         </tr>
  140.         <tr>
  141.             <td align="right">
  142.                 <a href="EmailListList.asp"><img border="0" alt="Cancel" src="Resources/Buttons/Cancel.gif" name="btnCancel"></a>
  143.                 <input type="image" border="0" alt="Import" src="Resources/Buttons/Import.gif" name="btnImport">
  144.             </td>
  145.         </tr>
  146.     </form>
  147. </table>
  148.  
  149. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  150.  
  151. </body>
  152. </html>
  153.  
  154. <%        
  155.     'Ensure that the web server returns the page
  156.     Response.Flush
  157. %>
  158.