<%@ Page Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="Dingyuemanage.aspx.cs" Inherits="Mvcb2b.admin.Dingyuemanage" Title="订阅管理" %>
<%@ MasterType VirtualPath="Admin.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" src="../Comja/val_num.js"></script>  
<script type="text/javascript">
function Win_open(link) {
        window.open(link, '', 'top=120,left=200,width=650,height=450,scrollbars=no');
    }
/*取得checkbox或radio(单)的值*/
function getchk(chkname)
{
	var chks = document.getElementsByName(chkname);
    var chksval="";
    var len=chks.length;
    for(var i=0;i<len;i++) {      
        if(chks[i].checked)
		{
		  if (chksval=="")
              chksval=chks[i].value;
		   else
		      chksval=chksval + ","+ chks[i].value;
		}
    }
	return chksval;
}

 $(function () {
	  $("#selall").click(function(){
		 if (this.checked)
			 selectall("selid",1);
	     else
		     selectall("selid",0);		  
	 });
	 
 });
 
 function selectall(chkname,type)
 {
	var chks = document.getElementsByName(chkname);
    var chksval="";
    var len=chks.length;
    for(var i=0;i<len;i++) {      
	    if (type==1)
		{
           if(!chks[i].checked)
		    chks[i].checked=true;
		}
		if (type==0)
		{
           if(chks[i].checked)
		    chks[i].checked=false;
		}
    }
 }
</script>
<div class="path">当前位置： 系统管理 >>  订阅管理</div>
<h3 class="nob">订阅管理</h3>
<div class="menusearch">
    <div style="float:left;padding-left:20px;"><input type="button" value="重置搜索" onclick="javascript:window.location.href='Dingyuemanage.aspx';" class="submit"  /> &nbsp; 关键字：</div>
    <div style="float:left;padding-left:0px;"><input type="text" class="key" name="key" id="key" value="<%=keyword %>" /> </div>
    <div style="float:left;padding-left:0px;">    &nbsp;<asp:Button ID="Search1" runat="server" Text="搜索"  CssClass="submit"   onclick="Search1_Click" /> </div>
</div>

<div class="menu2"><a href="Dingyueemail.aspx">写邮件</a> <a href="Dingyueemailmanage.aspx">发送邮件管理</a> <a href="Dingyuesetup.aspx">SMTP发送设置</a></div>
<table width="96%" border="0" align="center" cellpadding="2" style="background-color:#f5f5f5;" cellspacing="1">
          <tr style="background-color:#ffffff;font-weight:bold;">
            <td><input name="selall" id="selall" type="checkbox" value="1" /></td>
            <td>编号</td>
            <td>邮箱</td>     
            <td>是否订阅</td>
            <td>是否有效</td>
            <td>发送状态</td>
            <td>是否发送任务中</td>
            <td>订阅日期</td>            
            <td>编辑</td>
            <td>删除</td>
          </tr>
        <asp:Repeater ID="Repeater1" runat="server">
          <ItemTemplate>
          <tr style="background-color:#ffffff">
            <td><input name="selid" type="checkbox" value="<%#Eval("id")%>" /></td>
            <td><%#Eval("id")%></td>
            <td><a href="Dingyueedit.aspx?id=<%#Eval("id")%>"><%#leftmore(Eval("email").ToString(),50)%></a></td>       
            <td><%#State(Eval("isding"))%></td>
            <td><%#ValidState(Eval("isvalid"))%></td>
            <td><%#SendState(Eval("issend"))%></td>
            <td><%#DuiState(Eval("isdui"))%></td>
            <td><%#Eval("addtime")%></td>
            <td><a href="Dingyueedit.aspx?id=<%#Eval("id")%>">修改</a></td>
            <td><a href="Dingyueedit.aspx?id=<%#Eval("id")%>&action=del"><span onclick="return confirm('确实要删除吗?');">删除</span></a></td>
          </tr>
         
          </ItemTemplate>
         </asp:Repeater>
         <asp:Literal runat="server"  ID="noms"  />
          <tr >
            <td colspan="9" class="tdfoot">选择：<a href="javascript:selectall('selid',1);selectall('selall',1);" >全部</a> - <a href="javascript:selectall('selid',0);selectall('selall',0);">无</a></td>
            </tr>
            <tr >
            <td colspan="9" class="tdfoot2">
            <asp:Button ID="addsend" runat="server" Text="加入队列"   Width="79px"
                    onclick="addsend_Click" />&nbsp;
            <asp:Button ID="delsend" runat="server" Text="取消队列"  Width="79px"
                 onclick="delsend_Click"  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Sendtoemail" runat="server"  Width="131px" Text="立即发送队列邮件"   />
            &nbsp;<asp:Button ID="Allemail" runat="server"  Width="103px" Text="发送全部邮件"   />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="reset" runat="server"  Width="79px" Text="重置" 
                    onclick="reset_Click"   />
             </td>
            </tr>
        </table> 
        
        
        
<div class="pagemsg" >
<table  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr><td><asp:Literal id="Message" runat="server" ></asp:Literal></td>
          </tr><tr>
          <td style="text-align:right;">&nbsp; 直接进入 <asp:textbox  id="gopage" Width="30px"   runat="server"  CssClass="gopage" > </asp:textbox> 页   <asp:button id ="Submithao"  Text="Go" runat="server" OnClick="Submithao_Click" CssClass="gopage" ></asp:button> </td>
          </tr></table>
</div>       


<div class="help">
    <h4>? 帮助</h4>
        <ul>    
        <li>1.本订阅系统只充许同时一个用户批量发送邮件. </li>    
        <li>2.本系统"发送状态"和"队列任务"为临时用状态，不能作为保存之用. </li>
        <li>3.加入队列之前请先把邮件更新<span style="color:red">未发送</span>状态. </li>
        <li>4."已发送"状态的邮件不能加入队列. </li>
        <li>5."重置"操作将使所有邮件更新为"未发送"状态. </li>
        </ul>
   </div>    
</asp:Content>
