<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Email, HoWaveVGO" title="邮件列表管理" validaterequest="false" enableEventValidation="false" %>
<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>

<div style="width:100%">
<script type="text/javascript">
function Show(id,action){
  var recdata=false;
  switch (action){     
      case "Show":
      recdata=showModalDialog('Admin_AddPassport.aspx?Action=Show&UserID='+id,'','dialogWidth:800px; dialogHeight:450px; help: yes; scroll: yes; status: no');      
      break;
  }   
}
</script>

  <table class="adminheading">
     <tr>
        <th valign="middle" class="massemail"  align="left">发送邮件管理</th>                  
        <td align="right">
           <div style="width:400px"><a href="Admin_Email.aspx">发送邮件列表</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="Admin_Email.aspx?Action=Export">导出邮件列表</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="Admin_Email.aspx?Action=SearchEmail">查找</a></div>
         </td>
         <td class="rtdw"></td> 
     </tr>
 </table> 
 
       <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
<asp:Panel id="Sendlist" runat="server" EnableViewState="false" Width="100%"><TABLE class="nick" cellSpacing=1 cellPadding=1 width="100%" border=0><TBODY><TR><TD class="tit" colSpan=2><STRONG>邮件列表</STRONG></TD></TR><TR><TD class="ltd"><DIV style="WIDTH: 90px">收件人选择：</DIV></TD><TD class="rtd"><asp:RadioButtonList id="SendtoSelect" runat="server" EnableViewState="true" RepeatDirection="Horizontal">
                    <asp:ListItem Text="所有会员" Value="all" />
                    <asp:ListItem Text="指定会员组" Value="group" />
                    <asp:ListItem Text="指定会员名" Value="username" />
                    <asp:ListItem Text="指定Email" Value="email" />
                  </asp:RadioButtonList><BR /><DIV style="DISPLAY: none" id="select_1"><asp:CheckBoxList id="SendGroup" runat="server" EnableViewState="true" RepeatDirection="Horizontal" RepeatColumns="3"><asp:ListItem Text="未验证用户" Value="0"></asp:ListItem>
<asp:ListItem Text="注册会员" Value="1"></asp:ListItem>
<asp:ListItem Text="VIP会员" Value="2"></asp:ListItem>
<asp:ListItem Text="商业客户" Value="3"></asp:ListItem>
<asp:ListItem Text="代理商" Value="4"></asp:ListItem>
</asp:CheckBoxList> </DIV><DIV style="DISPLAY: none" id="select_2"><asp:TextBox id="SendUserList" runat="server" Width="300px"></asp:TextBox>&lt;=【<A id="ShowUserList" href="javascript:void(0)" runat="server">用户列表</A>】</DIV><DIV style="DISPLAY: none" id="select_3"><asp:TextBox id="SendEmailList" runat="server" Width="300px"></asp:TextBox>多个Email间请用<SPAN style="COLOR: red">英文逗号隔开</SPAN></DIV></TD></TR><TR><TD class="ltd">邮件主题：</TD><TD class="rtd"><asp:TextBox id="EmailTitle" runat="server" Width="300px"></asp:TextBox> <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="请填写邮件主题" ControlToValidate="EmailTitle"></asp:RequiredFieldValidator></TD></TR><TR><TD class="ltd">邮件内容：</TD><TD class="rtd"><fckeditorv2:FCKeditor id="EmailContent" runat="server" Width="98%" Height="200px" AutoDetectLanguage="true" BasePath="../FCKEditor/"></fckeditorv2:FCKeditor> <%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请填写邮件内容" ControlToValidate="EmailContent" />--%></TD></TR><TR><TD class="ltd">发件人：</TD><TD class="rtd"><asp:TextBox id="EmailSender" runat="server" ReadOnly="True" Text="恒浪网络"></asp:TextBox> <asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ErrorMessage="请填写发件人" ControlToValidate="EmailSender"></asp:RequiredFieldValidator></TD></TR><TR><TD class="ltd">发件人Email：</TD><TD class="rtd"><asp:TextBox id="SenderEmailAddress" runat="server" ReadOnly="True" Text="info@howave.net"></asp:TextBox> <asp:RequiredFieldValidator id="RequiredFieldValidator4" runat="server" ErrorMessage="请填写发件人EMAIL" ControlToValidate="SenderEmailAddress"></asp:RequiredFieldValidator></TD></TR></TBODY></TABLE>
<div class="div _btm" style="padding-top:5px"><asp:Button id="SendEmailButton" onclick="SendEmailButton_Click" runat="server" Text="发送" /></div><BR />
<DIV style="WORD-SPACING: 2px; LINE-HEIGHT: 15px; TEXT-ALIGN: center">注意：发送邮件前请先确认已经设置了邮件发送的配置，否则不能发送成功-----&gt;<A href="admin_Config.aspx">现在去设置邮件发送配置</A> </DIV><BR /></asp:Panel> <asp:Panel id="SendResult" runat="server" Width="100%" Visible="false">
      <div class="Messagebox">
         <div class="MessageboxTitle">邮件发送结果</div>
         <div class="MessageboxContent">
            一共发送邮件<asp:literal runat="server"  ID="Emailtotalsend"/>封<br />
            <div style="text-align:left; overflow:scroll;">
               <asp:literal runat="server" ID="EmailSuccess" /><br />
               <asp:Literal runat="server" ID="EmailSuccessList" /><br />
               <asp:literal runat="server" ID="EmailFail" /><br />
               <asp:Literal runat="server" ID="EmailFailList" />
            </div>    
         </div>
        </div>  
   </asp:Panel> 
</ContentTemplate>
                                           </asp:UpdatePanel>
                                           <asp:UpdateProgress   ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
              <ProgressTemplate>
<DIV class="wait" style=" color:Red ; float:right;"><IMG src="../IMS_IMG/wait.gif"   /> &nbsp;&nbsp;&nbsp;&nbsp;请稍等 </DIV>
</ProgressTemplate>
            </asp:UpdateProgress>

   <asp:Panel ID="MailList" runat="server" Width="100%" EnableViewState="false">
            <table width="100%" class="nick" cellpadding="1" cellspacing="1" border="0">
                <tr>
                    <td class="tit" colspan="2">
                        <strong>邮件列表批量导出文本</strong>
                    </td>
                </tr>
                <tr>
                    <td class="ltd"><div style="width:120px; padding-top:5px;">邮件列表导出到文本：</div></td>
                    <td class="rtd">
                      导出
                      <asp:DropDownList ID="Group" runat="server" AppendDataBoundItems="True" DataSourceID="ObjectDataSource1" DataTextField="GroupName" DataValueField="GroupType"  EnableViewState="true">
                         <asp:ListItem Text="全部会员" Value="all" />
                      </asp:DropDownList>
                      到
                      <asp:TextBox ID="MailTxtName" runat="server" Text="maillist.txt"  Width="200px"/>
                      <asp:Button ID="Button1" runat="server" Text="开始" OnClick="Button1_Click" />
                    </td>
               </tr>
            </table>
   </asp:Panel>  
   <asp:Panel ID="ShowResult" runat="server" Width="100%" Visible="false" EnableViewState="false">
      <div class="Messagebox">
         <div class="MessageboxTitle">邮件列表导出结果</div>
         <div class="MessageboxContent">
           <asp:literal runat="server" ID="result" />
           <asp:HyperLink ID="txtUrl" runat="server" />
         </div>
        </div>  
   </asp:Panel>
   
    <asp:Panel ID="SearchEmail" runat="server" Width="100%" Visible="false">
      <table class="nick" cellpadding="1" cellspacing="1" border="0">
         <tr><td colspan="2" class="tit">查找用户资料</td></tr>
         <tr><td class="ltd">
             查找:</td><td class="rtd"><asp:TextBox ID="SearchKey" runat="server" />
             <asp:DropDownList ID="SearchType" runat="server">
                <asp:ListItem Text="请选择查找的类型" Value="-1" />
                <asp:ListItem Text="按用户名查找" Value="UserName" />
                <asp:ListItem Text="按邮箱地址查找" Value="Email" />                
             </asp:DropDownList>
             <asp:Button ID="SearchEmailButton" runat="server" Text="开始查找" OnClick="SearchEmailButton_Click" />
             </td></tr>
             <tr><td colspan="2">
             <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="adminlist">
                 <Columns>
                     <asp:BoundField DataField="UserId" HeaderText="ID" />
                     <asp:BoundField DataField="UserName" HeaderText="用户名" />
                     <asp:BoundField DataField="Email" HeaderText="Email" />
                     <asp:TemplateField HeaderText="详细资料">
                        <ItemTemplate>
                          <a href="javascript:void(0)" onclick=<%# "Show("+Eval("UserID")+",'Show')" %>  runat="server">详细资料</a>
                        </ItemTemplate>
                       
                     </asp:TemplateField>
                 </Columns>
             </asp:GridView>
            </td></tr>
            </table>  
   </asp:Panel>
  
</div>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetGroups"  TypeName="GroupBLL"/>
<script type="text/javascript" language="javascript">
function SelectSendType(ctlname){
  for(var i=1;i<4;i++){
    if((document.getElementById(ctlname+"_"+i)).checked){
     document.getElementById("select_"+i).style.display="";
    }
    else{
     document.getElementById("select_"+i).style.display="none";
    }
  }
}
function SelectUser(ctlName){
    var arr=showModalDialog('Admin_SourceList.aspx?TypeSelect=UserList&DefaultValue='+document.getElementById(ctlName).value,'','dialogWidth:600px; dialogHeight:450px; help: no; scroll: yes; status: no');
    if (arr != null){
       document.getElementById(ctlName).value=arr;
    }
}
</script>
</asp:Content>

