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 >
Wrap
Text File
|
2006-10-25
|
9KB
|
260 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page is the first of two pages for inputting information to send out email
' messages. This page allows the user to input the recipient email addresses
' or to select an email list.
'
' COPYRIGHT NOTICE
'
' See attached Software License Agreement
'
' (c) Copyright 2002 - 2006 by ClassApps.com. All rights reserved.
'***********************************************************************
%>
<!--#Include File="Include/SurveyUtility_inc.asp"-->
<!--#Include File="Include/Utility_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<!--#Include File="Include/Config_inc.asp"-->
<!--#Include File="Include/ID_inc.asp"-->
<!--#Include File="Include/adovbs_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<%
'If the user does not have "Create" or "Admin" permission, redirect them to the access denied page.
If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_CREATE And lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
Response.Redirect "AccessDenied.asp?Reason=" & SUR_ACCESS_DENIED_NOT_ADMIN_SECURITY_LEVEL
End If
Dim rsEmailLists
Dim strSQL
Dim lngSurveyID
Dim lngEmailListID
Dim strDisplay
'Initialization
Set rsEmailLists = Server.CreateObject("ADODB.Recordset")
lngEmailListID = Request.QueryString("EmailListID")
%>
<html>
<head>
<title>Send Email Message</title>
<link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
</head>
<script language ="JavaScript" src="ClientInclude/Utility.js"></script>
<script language ="JavaScript">
function submitCheck()
{
// Make sure that the user either selected an email list or entered a list of email addresses
if (document.forms['frmSendEmailMessage'].cboEmailList.value == '<%=SUR_COMBO_PLEASE_SELECT%>')
{
alert("You must select an email list.");
document.forms['frmSendEmailMessage'].cboEmailList.focus();
return false;
}
return true;
}
</script>
<body class="MainBodyStyle">
<!--#Include File="Include/FrameworkTop_inc.asp"-->
<table border="0" cellspacing="0" cellpadding="0" width="754" class="MediumBlueBackgroundColor">
<tr>
<td height="36" valign="center">
<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">
</td>
</tr>
</table>
<!--#Include File="Include/FrameworkTop2_inc.asp"-->
<table width="740" border="0" cellpadding="0" cellspacing="6" class="LightGrayBackgroundColor">
<form action="SendEmailMessage2.asp" method="post" name="frmSendEmailMessage" onSubmit="return submitCheck();">
<%
If Len(Request.QueryString("SurveyID")) > 0 Then
%>
<input type="hidden" value="<%=Request.QueryString("SurveyID")%>" name="SurveyID" ID="Hidden1">
<%
End If
%>
<tr>
<td width="1" rowspan="2"></td>
<td height="34" valign="center">
<span class="H2HeadingStyle">Step 1 of 2 -- Email Recipients</span>
</td>
<td width="1" rowspan="2"> </td>
</tr>
<tr>
<td valign="top" width="710" height="34">
<span class="Normal">
Specify the email recipients by selecting an email list. You may optionally filter the email addresses
in the selected email list using the filter options below.<br>
</span>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td height="1" background="Resources/Images/ThinDivider.gif"></td></tr>
<table border="0" cellpadding="0" cellspacing="6" width="740" class="WhiteBackgroundColor">
<%
'Create the recordset with all of the available email lists. To be available, an email list must be owned
'by the current user or the user must be an administrator, and the email list must have at least one email
'address in it.
strSQL = "SELECT email_list_id, list_name, email_address_count " & _
"FROM sur_email_list el, sur_user u " & _
"WHERE el.user_id = u.user_id "
'Display only those email lists owned by the user to those with "Create" permission
If lngUserSecurityLevel <> SUR_SECURITY_LEVEL_ADMIN Then
strSQL = strSQL & "AND u.username = " & SQLEncode(GetUsername)
End If
strSQL = strSQL & " AND email_address_count > 0 " & _
" ORDER BY default_yn DESC, list_name"
rsEmailLists.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenDynamic, , adCmdText
%>
<tr>
<td width="1" rowspan="10"></td>
<td valign="bottom" class="Normal" height="26">
<span class="QuestionSectionHeadingSpanStyle">
Select Email List
</span>
</td>
<td width="1" rowspan="10"> </td>
</tr>
<tr>
<td>
<span class="Normal">
<label for="cboEmailList">Select the email list to which the email message shoud be sent.</label>
</span>
<select style="width:643px" name="cboEmailList" id="cboEmailList">
<%
If rsEmailLists.EOF Then
%>
<option value="<%=SUR_COMBO_NO_AVAILABLE_EMAIL_LISTS%>"><%=SUR_COMBO_NO_AVAILABLE_EMAIL_LISTS%></option>
<%
Else
%>
<option value="<%=SUR_COMBO_PLEASE_SELECT%>"><%=SUR_COMBO_PLEASE_SELECT%></option>
<%
rsEmailLists.MoveFirst
Do While Not rsEmailLists.EOF
strDisplay = rsEmailLists("list_name")
If CLng(rsEmailLists("email_address_count")) = 1 Then
strDisplay = strDisplay & " (" & rsEmailLists("email_address_count") & " email address)"
Else
strDisplay = strDisplay & " (" & rsEmailLists("email_address_count") & " email addresses)"
End If
%>
<option <% If CStr(lngEmailListID) = CStr(rsEmailLists("email_list_id")) Then Response.Write "SELECTED" End If %> value="<%=rsEmailLists("email_list_id")%>"><%=strDisplay%></option>
<%
rsEmailLists.MoveNext
Loop
'Clean up
rsEmailLists.Close
Set rsEmailLists = Nothing
End If
%>
</select>
</td>
</tr>
<tr>
<td valign="bottom" class="Normal" height="34">
<span class="QuestionSectionHeadingSpanStyle">
<label for="optFilterType">Apply Filter</label>
</span>
<br>
</td>
</tr>
<tr>
<td>
<table width="700" cellspacing="4" cellpadding="0" border="0">
<tr>
<td width="10">
<input checked type="radio" name="optFilterType" id="optFilterType" value="<%=SUR_EMAIL_LIST_ALL%>">
</td>
<td colspan="2">
<span class="Normal">Send to all email addresses</span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="optFilterType" id="optFilterType" value="<%=SUR_EMAIL_LIST_WITH_FILTER%>">
</td>
<td colspan="2">
<span class="Normal">Send to email addresses that match:</span>
</td>
</tr>
<tr>
<td rowspan="15" width="10"> </td>
<td width="150">
<span class="NormalBold"><label for="cboActive">Active:</label></span>
</td>
<td width="555">
<select name="cboActive" id="cboActive" style="width:150px">
<option value="<%=SUR_COMBO_ALL%>"><%=SUR_COMBO_ALL%></option>
<option value="<%=SUR_BOOLEAN_NEGATIVE%>"><%=SUR_BOOLEAN_NEGATIVE_DISPLAY%></option>
<option value="<%=SUR_BOOLEAN_POSITIVE%>"><%=SUR_BOOLEAN_POSITIVE_DISPLAY%></option>
</select>
</td>
</tr>
<tr>
<td>
<span class="NormalBold"><label for="txtEmailAddress">Email Address:</label></span>
</td>
<td>
<input type="text" name="txtEmailAddress" id="txtEmailAddress" style="width:150px">
</td>
</tr>
<tr>
<td>
<span class="NormalBold"><label for="txtCustomData1">Custom Data 1:</label></span>
</td>
<td>
<input type="text" name="txtCustomData1" id="txtCustomData1" style="width:150px">
</td>
</tr>
<tr>
<td>
<span class="NormalBold"><label for="txtCustomData2">Custom Data 2:</label></span>
</td>
<td>
<input type="text" name="txtCustomData2" id="txtCustomData2" style="width:150px">
</td>
</tr>
<tr>
<td>
<span class="NormalBold"><label for="txtCustomData3">Custom Data 3:</label></span>
</td>
<td>
<input type="text" name="txtCustomData3" id="txtCustomData3" style="width:150px">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="740" border="0" cellpadding="6" cellspacing="0" class="WhiteBackgroundColor">
<tr>
<td align="right">
<a href="EmailListList.asp"><img border="0" alt="Cancel" src="Resources/Buttons/Cancel.gif" name="btnCancel"></a>
<input type="image" border="0" alt="Continue" src="Resources/Buttons/Continue.gif" name="btnContinue">
</td>
</tr>
</form>
</table>
<!--#Include File="Include/FrameworkBottom_inc.asp"-->
</body>
</html>
<%
'Ensure that the web server returns the page
Response.Flush
%>