home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / survey_unconfigured / SendReportShareMessage.asp < prev    next >
Text File  |  2006-10-25  |  8KB  |  214 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 input information for sending 
  7. '                      out email messages for report shares.
  8. '
  9. '   COPYRIGHT NOTICE                                
  10. '
  11. '   See attached Software License Agreement
  12. '
  13. '   (c) Copyright 2002 - 2006 by ClassApps.com.  All rights reserved.
  14. '***********************************************************************
  15. %>
  16. <!--#Include File="Include/SurveyUtility_inc.asp"-->
  17. <!--#Include File="Include/Utility_inc.asp"-->
  18. <!--#Include File="Include/Constants_inc.asp"-->
  19. <!--#Include File="Include/Config_inc.asp"-->
  20. <!--#Include File="Include/ID_inc.asp"-->
  21. <!--#Include File="Include/adovbs_inc.asp"-->
  22. <!--#Include File="Include/CurrentUser_inc.asp"-->
  23. <!--#Include File="Include/SurveySecurity_inc.asp"-->
  24. <%
  25.     Dim lngSurveyID
  26.     Dim strSurveyName
  27.     Dim lngReportShareID
  28.     
  29.     'Initialization
  30.     lngSurveyID = Request.QueryString("SurveyID")
  31.     strSurveyName = Request.QueryString("SurveyName")
  32.     lngReportShareID = Request.QueryString("ReportShareID")
  33.     
  34.     'If the user does not either own this survey or have admin permission, deny them access to this functionality.
  35.     If IsUserOwnerOrAdmin(lngSurveyID) = False Then
  36.         Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_OWNER_FOR_RESULTS_SHARING
  37.     End If
  38. %>    
  39. <html>
  40. <head>
  41.     <title>Send Report Share Message</title>
  42.     <link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
  43. </head>
  44.  
  45. <script language ="JavaScript" src="ClientInclude/Utility.js"></script>
  46. <script language ="JavaScript">
  47. function submitCheck() 
  48. {
  49.     if (trim(document.forms['frmSendReportShare'].txtSubject.value) == "")
  50.     {    
  51.         alert("Please enter a value for the Subject.");
  52.         document.forms['frmSendReportShare'].txtSubject.focus();
  53.         return false;
  54.     }
  55.  
  56.     // Make sure a From email address was entered
  57.     if (trim(document.forms['frmSendReportShare'].txtFromAddress.value) == "")
  58.     {    
  59.         alert("Please enter a value for the 'From' email address.");
  60.         document.forms['frmSendReportShare'].txtFromAddress.focus();
  61.         return false;
  62.     }
  63.  
  64.     // Make sure the From email address is in a valid format
  65.     if (isValidEmailAddress(trim(document.forms['frmSendReportShare'].txtFromAddress.value)) == false)
  66.     {    
  67.         alert("The 'From' email address entered is not a valid format for an email address.");
  68.         document.forms['frmSendReportShare'].txtFromAddress.focus();
  69.         return false;
  70.     }
  71.     
  72.     // Make sure text was entered for the body of the email
  73.     if (trim(document.forms['frmSendReportShare'].txtEmailText.value) == "")
  74.     {    
  75.         alert("Please enter a value for the text of the email.");
  76.         document.forms['frmSendReportShare'].txtEmailText.focus();
  77.         return false;
  78.     }
  79.  
  80.     // Make sure the #SurveyLink# token is in the email text
  81.     var strEmailText = document.forms['frmSendReportShare'].txtEmailText.value;
  82.     if (strEmailText.indexOf('#SurveyLink#') == -1)
  83.     {
  84.         alert("The #SurveyLink# token must be included in the text of the email.");
  85.         document.forms['frmSendReportShare'].txtEmailText.focus();
  86.         return false;
  87.     }
  88.  
  89.     return true;
  90. }
  91. </script>
  92.  
  93. <body class="MainBodyStyle">
  94.  
  95. <!--#Include File="Include/FrameworkTop_inc.asp"-->
  96.  
  97. <table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
  98.     <tr>
  99.         <td height="36" valign="center">
  100.               <span class="H1HeadingStyle"><a name="skipnav" tabindex="1">Send Report Share Message</a></span> <img style="cursor:hand" alt="Help" onClick="javascript:window.open('Help/Help.htm#ResultsSharing', 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">
  101.         </td>
  102.     </tr>
  103. </table>
  104.  
  105. <!--#Include File="Include/FrameworkTop2_inc.asp"-->
  106.  
  107. <table width="740" border="0" cellpadding="0" cellspacing="6" class="LightGrayBackgroundColor">
  108.     <form action="SendReportShareMessageAction.asp" method="post" name="frmSendReportShare" onSubmit="return submitCheck();">
  109.         <input type="hidden" name="ReportShareID" value="<%=lngReportShareID%>">
  110.         <input type="hidden" name="SurveyID" value="<%=lngSurveyID%>">
  111.         <input type="hidden" name="SurveyName" value="<%=strSurveyName%>">
  112.         <tr>
  113.             <td width="1" rowspan="2"></td>
  114.             <td height="30">
  115.                 <span class="H2HeadingStyle">Message Details for Survey '<%=strSurveyName%>'</span>
  116.             </td>
  117.             <td width="1" rowspan="2"></td>
  118.         </tr>
  119.         <tr>
  120.             <td valign="top" class="Normal" height="36">
  121.                 All fields marked with a red asterisk (<span class="Required">*</span>) are required.  
  122.                 Make sure to include the token for linking to the survey, as described below.
  123.             </td>
  124.         </tr>
  125.     </table>
  126.     <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
  127.     <table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
  128.         <tr>
  129.             <td height="8"></td>
  130.         </tr>
  131.         <tr>
  132.             <td width="1" rowspan="25"></td>
  133.             <td valign="top" class="NormalBold" width="170">
  134.                 <label for="txtSubject">Email Subject:</label><span class="Required">*</span>
  135.             </td>
  136.             <td valign="top" class="Normal">
  137.                 <input type="text" value="View Results for Survey '<%=strSurveyName%>'" name="txtSubject" id="txtSubject" maxlength="125" style="width:560">
  138.             </td>
  139.             <td width="1" rowspan="25"> </td>
  140.         </tr>
  141.         <tr>
  142.             <td valign="top" class="NormalBold">
  143.                 <label for="txtFromAddress">'From' Address:</label><span class="Required">*</span>
  144.             </td>
  145.             <td valign="top" class="Normal">
  146.                 <span class="InlineHelpSpanStyle">Enter the email address that the email should appear to come from.</span>
  147.                 <input type="text" name="txtFromAddress" id="txtFromAddress" maxlength="50" style="width:560">
  148.             </td>
  149.         </tr>
  150.         <tr>
  151.             <td valign="top" class="NormalBold">
  152.                 <label for="txtCCAddress">'CC' Address(es):</label>
  153.             </td>
  154.             <td valign="top" class="Normal">
  155.                 <span class="InlineHelpSpanStyle">If desired, you may enter any email address(es) that should be CC'ed for each email.  Multiple email 
  156.                 addresses should be separated by a semi-colon.<span>
  157.                 <input type="text" name="txtCCAddress" id="txtCCAddress" maxlength="50" style="width:560">
  158.             </td>
  159.         </tr>
  160.         <tr>
  161.             <td valign="top" class="NormalBold">
  162.                 <label for="txtBCCAddress">'BCC' Address(es):</label>
  163.             </td>
  164.             <td valign="top" class="Normal">
  165.                 <span class="InlineHelpSpanStyle">If desired, you may enter any email address(es) that should be BCC'ed for each email.  Multiple email 
  166.                 addresses should be separated by a semi-colon.<span>
  167.                 <input type="text" name="txtBCCAddress" id="txtBCCAddress" maxlength="50" style="width:560">
  168.             </td>
  169.         </tr>
  170.         <tr>
  171.             <td valign="top" class="NormalBold">
  172.                 <label for="txtEmailText">Email Text:</label><span class="Required">*</span>
  173.             </td>
  174.             <td valign="top" class="Normal">
  175.                 <span class="InlineHelpSpanStyle">
  176.                     Enter the text of your email below.  You must include the following token, 
  177.                     which will be replaced, as noted, in the actual email:<br>
  178.                     #SurveyLink# - The location of the link to the survey (required)<br>
  179.                 <span>
  180.                 <textarea class="TextareaStyle" rows="8" name="txtEmailText" id="txtEmailText" style="width:560">Dear ,
  181.  
  182. We just finished conducting a survey, the results of which I think you'll find very interesting.
  183.  
  184. You can access the results at the following URL:
  185.  
  186. #SurveyLink#
  187.  
  188. Please let me know your thoughts regarding the survey results.
  189.  
  190. Thanks,
  191. <%=GetUserFirstName()%>
  192. </textarea><br>
  193.                 <input type="checkbox" name="chkHTMLFormat" id="chkHTMLFormat"> <label for="chkHTMLFormat">Send email in HTML format</label>
  194.             </td>
  195.         </tr>
  196.         <tr>
  197.             <td colspan="2" align="right">
  198.                 <a href="ReportShareList.asp?SurveyID=<%=lngSurveyID%>&SurveyName=<%=strSurveyName%>"><img border="0" alt="Cancel" src="Resources/Buttons/Cancel.gif" name="btnCancel"></a>
  199.                 <input type="image" border="0" alt="Send" src="Resources/Buttons/Send.gif" name="btnSend">
  200.             </td>
  201.         </tr>
  202.     </form>
  203. </table>
  204.  
  205. <!--#Include File="Include/FrameworkBottom_inc.asp"-->
  206.  
  207. </body>
  208. </html>
  209.  
  210. <%        
  211.     'Ensure that the web server returns the page
  212.     Response.Flush
  213. %>
  214.