{#include file="sys/admin_header.htm"#}
<script type="text/javascript">
$(document).ready(function()
{
	$("#ButSend").QSdialog({
	DialogTitle:"请选择",
	DialogContent:"#SendDiv",
	DialogContentType:"id",
	DialogAddObj:"#OpSend",	
	DialogAddType:"html",
	DialogWidth:500	
	});
	$("#ButDel").QSdialog({
	DialogTitle:"您要删除哪些信息?",
	DialogContent:"#DelDiv",
	DialogContentType:"id",
	DialogAddObj:"#OpDel",	
	DialogAddType:"html",
	DialogWidth:300	
	});
	//发送
	$(".submitsend").click(function(){
			$("form[name=form1]").attr("action","?act=totalsend");
			$("form[name=form1]").submit()
	});	
	//删除
	$(".submitdel").click(function(){
			$("form[name=form1]").attr("action","?act=del");
			$("form[name=form1]").submit()
	});
});
</script>
<div class="admin_main_nr_dbox">
<div class="pagetit">
	<div class="ptit"> {#$pageheader#}</div>
	{#include file="mailqueue/admin_mailqueue_nav.htm"#}
  <div class="clear"></div>
</div>
<div class="toptip">
	<h2>提示：</h2>
	<p>
发送邮件请确认您的邮件配置正确，具体请在 “系统 > 邮件设置”中设置。<br />
</p>
</div>
<div class="seltpye_x">
		<div class="left">筛选类型</div>	
		<div class="right">
		<a href="{#"m_type:"|qishi_parse_url#}" {#if $smarty.get.m_type==""#}class="select"{#/if#}>不限</a>
		<a href="{#"m_type:0"|qishi_parse_url#}" {#if $smarty.get.m_type=="0"#}class="select"{#/if#}>等待发送</a>
		<a href="{#"m_type:1"|qishi_parse_url#}" {#if $smarty.get.m_type=="1"#}class="select"{#/if#}>发送成功</a>
		<a href="{#"m_type:2"|qishi_parse_url#}" {#if $smarty.get.m_type=="2"#}class="select"{#/if#}>发送失败</a>
		<div class="clear"></div>
		</div>
		<div class="clear"></div>
</div>
   <form id="form1" name="form1" method="post" action="?act=promotion_del">
  {#$inputtoken#}
    <table width="100%" border="0" cellpadding="0" cellspacing="0"  id="list" class="link_lan">
    <tr>
      <td  width="120" class="admin_list_tit admin_list_first">
     <label id="chkAll"><input type="checkbox" name="" title="全选/反选" id="chk"/>类型</label>	 </td>
	  <td class="admin_list_tit" width="13%">收件地址</td>
	  <td  class="admin_list_tit">邮件主题</td>
      <td  class="admin_list_tit">邮件内容</td>
      <td width="110"  align="center"  class="admin_list_tit">添加时间</td>	  
      <td width="110"  align="center"  class="admin_list_tit">发送时间</td>
      <td width="10%" align="center"  class="admin_list_tit">操作</td>
    </tr>
	{#foreach from=$list item=list#}
	 <tr>
      <td   class="admin_list admin_list_first">
     <input type="checkbox" name="id[]"  value="{#$list.m_id#}"/>
	 {#if $list.m_type=="0"#}<span style="color:#FF6600">等待发送</span>{#/if#}
	 {#if $list.m_type=="1"#}<span style="color: #009900">发送成功</span>{#/if#}
	 {#if $list.m_type=="2"#}<span style="color: #666666">发送失败</span>{#/if#}
	  </td>
	  <td  class="admin_list">
	  {#$list.m_mail#}
	  </td>
	  <td   class="admin_list vtip" title="{#$list.m_subject|nl2br#}" >
	  {#$list.m_subject_#}
	  </td>
      <td   class="admin_list vtip" title="{#$list.m_body|nl2br#}" >
	   {#$list.m_body_#}
	  </td>
      <td align="center"  class="admin_list">
	  {#$list.m_addtime|date_format:"%Y-%m-%d"#}
	  
		
		</td>	  
      <td align="center"  class="admin_list">
	  
	  {#if $list.m_sendtime=="0"#}
		----
		{#else#}
	{#$list.m_sendtime|date_format:"%Y-%m-%d"#}
		{#/if#}
	  </td>
      <td align="center"  class="admin_list">
	  <a href="?act=mailqueue_edit&id={#$list.m_id#}">修改</a>
	 
	</td>
	</tr>
	{#/foreach#}
  </table>
  
	{#if !$list#}
	<div class="admin_list_no_info">没有任何信息！</div>
	{#/if#}
	
	<span id="OpDel">
	</span>
	<span id="OpSend">
	</span>
	
	
	
	
  </form>	
   <table width="100%" border="0" cellspacing="10"  class="admin_list_btm">
	<tr>
      <td>
	  <input type="button" name="Submit22" value="发送" class="admin_submit" id="ButSend"/>
       <input type="button" name="Submit22" value="添加任务" class="admin_submit"    onclick="window.location='?act=mailqueue_add'"/>
	   <input type="button" name="Submit22" value="批量添加" class="admin_submit"    onclick="window.location='?act=mailqueue_batchadd'"/>
		<input type="button" name="ButDel" id="ButDel" value="删除" class="admin_submit" />
	  </td>
      <td width="305">
	  
	   
	   
	      
	   	<form id="formseh" name="formseh" method="get" action="?">	
			<div class="seh">
			    <div class="keybox"><input name="key" type="text"   value="{#$smarty.get.key#}" /></div>
			    <div class="selbox">
					<input name="key_type_cn"  id="key_type_cn" type="text" value="{#$smarty.get.key_type_cn|default:"邮件主题"#}" readonly="true"/>
						<div>
								<input name="key_type" id="key_type" type="hidden" value="{#$smarty.get.key_type|default:"1"#}" />
												<div id="sehmenu" class="seh_menu">
														<ul>
														<li id="1" title="邮件主题">邮件主题</li>
														<li id="2" title="收件地址">收件地址</li>
														</ul>
												</div>
						</div>				
				</div>
				<div class="sbtbox">
				<input type="submit" name="" class="sbt" id="sbt" value="搜索"/>
				</div>
				<div class="clear"></div>
		  </div>
		  </form>
		  <script type="text/javascript">$(document).ready(function(){showmenu("#key_type_cn","#sehmenu","#key_type");});	</script>
	   
	   
	
	   
	   
	   
	   
	   
	   
	  
	  </td>
     </tr>
  </table>
<div class="page link_bk">{#$page#}</div>
	
	
	



<div style="display:none" id="SendDiv">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="6">
 <tr>
      <td  width="100"  align="right">发送选择：</td>
      <td>
      
	  <label><input name="sendtype" type="radio" value="1" checked="checked"  />      
	   已选项目
	   </label>
	   &nbsp;
	   &nbsp;
	   <label><input name="sendtype" type="radio" value="2"  />      
	   所有等待发送的
	   </label>
	   &nbsp;
	   &nbsp;
	   <label><input name="sendtype" type="radio" value="3"   />      
	   所有发送失败的
	   </label>
					  
	    </td>
    </tr>
	<tr>
      <td align="right">发送间隔时间：</td>
      <td>
	  <input name="intervaltime" type="text" class="input_text_150"  value="3" maxlength="3" /> 
	  秒
	  </td>
    </tr>
    <tr>
      <td align="right">最大发送数量：</td>
      <td>
	  <input name="sendmax" type="text" class="input_text_150"  value="500" maxlength="3" /> 
	  
	  0为不限制  
	  </td>
    </tr>
	 <tr>
      <td align="right">发送失败时：</td>
      <td>
                      <label><input type="radio" name="senderr" value="1"  checked="checked" />
                       跳过继续</label>
					   <label><input type="radio" name="senderr" value="2"  />
                       停止发送</label>
					   </td>
    </tr>
    <tr>
      <td height="70">&nbsp;</td>
      <td>
	  <input type="submit" name="submitdel"  value="确定" class="admin_submit submitsend"/>
 </td>
    </tr>
  </table>
</div>









	
	
<div style="display:none" id="DelDiv">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="6">
 <tr>
      <td  width="30">&nbsp;</td>
      <td>
                      <label><input name="deltype" type="radio" value="1" checked="checked"  />
                      已选项目</label></td>
    </tr>
    <tr>
      <td >&nbsp;</td>
      <td>
                      <label><input type="radio" name="deltype" value="2"  />
                       所有等待发送项目</label></td>
    </tr>
	 <tr>
      <td >&nbsp;</td>
      <td>
                      <label><input type="radio" name="deltype" value="3"  />
                       所有发送成功项目</label></td>
    </tr>
	<tr>
      <td >&nbsp;</td>
      <td>
                      <label><input type="radio" name="deltype" value="4"  />
                       所有发布失败项目</label></td>
    </tr>
	
	<tr>
      <td  >&nbsp;</td>
      <td>
                      <label><input type="radio" name="deltype" value="5"  />
                       清空所有列队</label></td>
    </tr>
    <tr>
      <td height="70">&nbsp;</td>
      <td>
	  <input type="submit" name="submitdel"  value="确定" class="admin_submit submitdel"/>
 </td>
    </tr>
  </table>
</div>
    
	
	
	
	
	
	
	
	
	
	   
</div>
{#include file="sys/admin_footer.htm"#}
</body>
</html>