<!--#include virtual="/show/adminhead.asp"-->
<!--#include file="adminleft.asp"-->


<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />


 
<title><%=webname%>-最高权限-邮件/短信群发</title>
<%
call lognamecode()
call logquanxian("f3",1)
%>

<DIV>

<SCRIPT LANGUAGE="JavaScript">
var checkflag1 = "false";
function check1(field) {
if (checkflag1 == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag1 = "true";
return "false"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag1 = "false";
return "true"; }
}

function unselectall1()
{
    if(document.myform.chkAll1.checked){
	document.myform.chkAll1.checked = document.myform.chkAll1.checked&0;
	checkflag1 = "false";
    } 	
}
</script>
<script language="javascript">
function show0(str){
		var aa=str+"bt";
		var bb=str+"bt2";
		var cc=str+"zt";
        var aaa=document.getElementById(aa).value;
		var bbb=document.getElementById(bb).value;
		var ccc=document.getElementById(cc).value;
		document.getElementById("biaoti").value=aaa;
		document.getElementById("biaoti2").value=bbb;
		document.getElementById("zhuti").value=ccc;
}

</script>

<SCRIPT LANGUAGE="JavaScript">
function tomail(){

if(confirm("确定要群发吗？")){
	document.getElementById("toact").value="tomail";
	document.getElementById(myform).submit();
        return true;
}else{
        return false;
}

}
</script>

<%
act=request.QueryString("act")
cact=request.QueryString("cact")
page=request.QueryString("page")

link="adminmailqf.asp?ct="


if request.QueryString("act")="qingkong" then
response.Cookies("mailtoid")=""
end if

%>
<DIV id=main1200> 
<%call webleft()%>

<DIV id=main_right>
<DIV id=main_right_content>
<STYLE>.apply_style {
	POSITION: absolute
}
.right_title A {
	LINE-HEIGHT: 27px; WIDTH: 126px; DISPLAY: inline-block; BACKGROUND: url(<%=ossurl%>images/bg22.gif) no-repeat; HEIGHT: 27px
}
.right_title A.current {
	BACKGROUND: url(<%=ossurl%>images/main_right_title_bg.gif) no-repeat; COLOR: #fff; FONT-WEIGHT: bold
}
.table_style_1 TD {
	HEIGHT: 38px
}
.table_style_home_info TD {
	PADDING-BOTTOM: 0px; PADDING-LEFT: 10px; PADDING-RIGHT: 0px; HEIGHT: 30px; PADDING-TOP: 0px
}
</STYLE>

<DIV class=right_titleadmin>&nbsp;&nbsp;邮件/短信群发 <a style="color:#F60" href="?act=qingkong">[清空列表]</a></DIV>
<DIV class=main><br>


<form action="adminmailqfdo2.asp" method="post" name="myform" id="myform" target="_blank"> 
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
  <tr>
    <td width="15%" align="center">邮件模版：</td>
    <td width="85%">
	
<%
sql="select * from aymailmb order by aymbid desc"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
do while not rs.eof
%>
	<input type="radio" name="mailmb" value="<%=trim(rs("aymbsuiji"))%>" onclick=show0(this.value)><%=trim(rs("aymbname"))%>
    <input name="<%=trim(rs("aymbsuiji"))%>bt" type="hidden" id="<%=trim(rs("aymbsuiji"))%>bt" value="<%=server.HTMLEncode(trim(rs("aymbbiaoti")))%>">
	<input name="<%=trim(rs("aymbsuiji"))%>bt2" type="hidden" id="<%=trim(rs("aymbsuiji"))%>bt2" value="<%=server.HTMLEncode(trim(rs("aymbdbiaoti")))%>">
	<input name="<%=trim(rs("aymbsuiji"))%>zt" type="hidden" id="<%=trim(rs("aymbsuiji"))%>zt" value="<%=server.HTMLEncode(trim(rs("aymbcon")))%>"><br>
<%
rs.movenext
loop
else
response.Write "还未创建模版"
end if
rs.close%>
	
	
		</td>
  </tr>
  <tr>
    <td align="center">群发标题：</td>
    <td width="85%"><input name="biaoti" type="text" id="biaoti" value="<%if request.Cookies("biaoti")<>"" then response.Write request.Cookies("biaoti")%>" size="40">
      手机短信(简短)：
        <input name="biaoti2" type="text" id="biaoti2" value="<%if request.Cookies("biaoti2")<>"" then response.Write request.Cookies("biaoti2")%>" size="40"></td>
  </tr>
  <tr>
    <td align="center">群发主题：</td>
    <td><textarea name="zhuti" cols="100" rows="12" id="zhuti"><%if request.Cookies("zhuti")<>"" then response.Write request.Cookies("zhuti")%></textarea></td>
  </tr>
  <tr>
    <td align="center">发送格式：</td>
    <td><input name="geshi" type="radio" value="1" <%if request.Cookies("geshi")<>"" then 
	if request.Cookies("geshi")="1" then response.Write"checked"
	else
	response.Write"checked"
	end if
	%> >
      普通格式
      <input type="radio" name="geshi" value="0" <%if request.Cookies("geshi")<>"" then 
	if request.Cookies("geshi")="0" then response.Write"checked"
	end if
	%>>
      HTML格式</td>
  </tr>
  <tr>
    <td align="center">发送方式：</td>
    <td><input name="fangshi1" type="checkbox" id="fangshi1" value="1" <%if request.Cookies("fangshi1")<>"" then 
	if request.Cookies("fangshi1")="1" then response.Write"checked"
	else
	response.Write"checked"
	end if
	%>>
      邮件群发
        <input name="fangshi2" type="checkbox" id="fangshi2" value="1" <%if request.Cookies("fangshi2")<>"" then 
	if request.Cookies("fangshi2")="1" then response.Write"checked"
	end if
	%>>
        手机短信群发</td>
  </tr>
</table>
<br>

  <table width="99%" border="0" cellpadding="0" cellspacing="0" class="table_style_a1">
     
       <tr>
        <th align="center" class="border_right border_bottom" >
		<th align="center" class="border_right border_bottom" >ID
		<th align="center" class="border_right border_bottom">会员号
		<th align="center" class="border_right border_bottom">姓名        
		<th align="center" class="border_right border_bottom">级别        
		<th align="center" class="border_right border_bottom">余额
		<th align="center" class="border_right border_bottom">周额        
		<th align="center" class="border_right border_bottom">结算      
		<th align="center" class="border_right border_bottom">消保      
		<th align="center" class="border_right border_bottom">成交       
		<th align="center" class="border_right border_bottom">登录        
        <th align="center" class="border_right border_bottom">手机
        <th align="center" class="border_right border_bottom">邮箱
        <th align="center" class="border_right border_bottom">QQ                
        <th align="center" class="border_right border_bottom">最后登录      
        <th align="center" class="border_right border_bottom">VIP        
        <th align="center" class="border_right border_bottom">标注        
        <th align="center" class="border_right border_bottom">Ali接口        
        <th align="center" class="border_right border_bottom">收款        
        <th align="center" class="border_right border_bottom">好友       
        <th align="center" class="border_right border_bottom">锁定 
        <th align="center" class="border_bottom border_right">审核               
        <th align="center" class="border_bottom">认证       </tr>
<%
if request.QueryString("sname")<>"" then


		if request.Cookies("mailtoid")<>"" then
		
			if instr(1,request.Cookies("mailtoid"),request.QueryString("sname")&",")=0 then
			response.Cookies("mailtoid")=request.Cookies("mailtoid")&trim(request.QueryString("sname"))&","
			end if
		
		else
		response.Cookies("mailtoid")=trim(request.QueryString("sname"))&","
		end if


end if



mailteltoik=request.Cookies("mailtoid")
if mailteltoik<>"" then mailteltoik=mid(mailteltoik,1,len(mailteltoik)-1)


	mailid=split(mailteltoik,",")
	For sum=0 To Ubound(mailid) 
	
	
		sql="select * from ayname where aynameid="&trim(mailid(sum))&" and mailbj=0"
		rs.open sql,conn,1,1
		if not(rs.eof) then
		
		%>
		
			  <tr onmouseover=this.bgColor='#D2FFFF' onmouseout=this.bgColor='#ffffff'>
				<td align="center" class="border_right border_bottom"><input name="list1" type="checkbox" id="list1" onClick="unselectall1()" value="<%=rs("aynameid")%>" <%if request.QueryString("sname")<>"" then response.Write "checked"%> ></td>
				<td align="center" class="border_right border_bottom"><%=rs("aynameid")%></td>
				<td align="center" class="border_right border_bottom"><%=rs("ayusername")%></td>
				<td align="center" class="border_right border_bottom"><%=rs("aytrueuser")%></td>
				<td align="center" class="border_right border_bottom">
				<%
				response.Write getjbname(rs("ayjibie"))
				%></td>
				<td align="center" class="border_right border_bottom"><%if ccur(rs("ayyue"))>0 then response.Write("<strong>"&Formatnumber(rs("ayyue"),2,true,-1,0)&"</strong>"):else:response.Write Formatnumber(rs("ayyue"),2,true,-1,0):end if%></td>
				<td align="center" class="border_right border_bottom">
		<%
		'minje=0
		'if ccur(rs("aychengjiao"))>0 then
		'set rsj=server.CreateObject("adodb.recordset")
		'rsj.open "select aycaiwuuser,aycaiwuzt,aycaiwudate,aycaiwuleibie,aycaiwujine from aycaiwu where aycaiwuuser="&clng(rs("aynameid"))&" and aycaiwuzt=1 and datediff(day,aycaiwudate,'"&now()&"')<=7 and aycaiwuleibie=0",conn,1,1
		'if not(rsj.bof and rsj.eof) then
		'do while not rsj.eof
		'minje=ccur(minje)+ccur(rsj("aycaiwujine"))
		'rsj.movenext  
		'loop
		'end if
		'rsj.close
		'end if
		'response.Write Formatnumber(minje,2,true,-1,0)
		response.Write "-"
		%></td>
				<td align="center" class="border_right border_bottom"><%=Formatnumber(rs("ayljjs"),0,true,-1,0)%></td>
				<td align="center" class="border_right border_bottom"><%=rs("ayisxiaojin")%></td>
				<td align="center" class="border_right border_bottom"><%=rs("aychengjiao")%></td>
				<td align="center" class="border_right border_bottom"><%=rs("aylogcishu")%></td>
				<td align="center" class="border_right border_bottom">
				<%if rs("aytel")<>"" then 
				response.Write rs("aytel")
				else
				response.Write"-"
				end if
				%></td>
				<td align="center" class="border_right border_bottom">
				<%if rs("aymail")<>"" then 
				response.Write rs("aymail")
				else
				response.Write"-"
				end if
				%></td>
				<td align="center" class="border_right border_bottom"><%=rs("ayqq")%></td>
				<td align="center" class="border_right border_bottom"><% if rs("aylastdata")<>"" then 
				response.Write DateValue(rs("aylastdata"))
				else
				response.Write"-"
				end if
				%></td>
				<td align="center" class="border_right border_bottom"><%if cint(rs("isvipid"))=0 then%>
				-
				<%elseif cint(rs("isvipid"))=1 then%>
				<span style="color:#339900">VIP</span>
				<%end if%></td>
				<%
				if cint(rs("aybiaozhu"))=0 then bcon="未标注"
				if cint(rs("aybiaozhu"))=1 then bcon="忠实商户"
				if cint(rs("aybiaozhu"))=2 then bcon="重要商户"
				if cint(rs("aybiaozhu"))=3 then bcon="跟进商户"
				if cint(rs("aybiaozhu"))=4 then bcon="新商户"
				if cint(rs("aybiaozhu"))=5 then bcon="挽回商户"
				if cint(rs("aybiaozhu"))=6 then bcon="加入未激活队列"
				if cint(rs("aybiaozhu"))=7 then bcon="加入待删除队列"
				%>
				<td align="center" class="border_right border_bottom"><img src="<%=ossurl%>images/biaozhu/<%=cint(rs("aybiaozhu"))%>.png" title="<%=bcon%>" border="0"></td>
				<td align="center" class="border_right border_bottom"></td>
				<td align="center" class="border_right border_bottom">
				</td>
				<td align="center" class="border_right border_bottom"></td>
				<td align="center" class="border_right border_bottom"><%if cint(rs("ayusersuo"))=0 then%>
				正常
				<%elseif cint(rs("ayusersuo"))=1 then%>
				<span style="color:#FF0000">锁定</span>
				<%end if%></td>
				<td align="center" class="border_bottom border_right"><%if cint(rs("ayshenhe"))=0 then%>
				<span style="color:#FF0000">未审核</span>
				<%elseif cint(rs("ayshenhe"))=1 then%>
				正常
				<%end if%>	</td>
				<td align="center" class="border_bottom">
				<%if trim(rs("aymail"))<>"" then%>
				<a href="adminmailqf.asp?sname=<%=trim(rs("ayusername"))%>" target="_blank">
				<%if rs("ismailrz")=1 then%>
				<img src="<%=ossurl%>Template/Template4/img/mail.jpg" alt="<%=trim(rs("aymail"))%>" title="<%=trim(rs("aymail"))%>" border="0" >
				<%else%>
				<img src="<%=ossurl%>Template/Template4/img/mailh.jpg" alt="<%=trim(rs("aymail"))%>" title="<%=trim(rs("aymail"))%>" border="0" >
				<%end if%>
				</a>
				<%else
				response.Write("-")
				end if
				%>
				<%if trim(rs("aytel"))<>"" then%>
					<%if rs("istelrz")=1 then%>
					<img src="<%=ossurl%>Template/Template4/img/tel.jpg" alt="<%=trim(rs("aytel"))%>" title="<%=trim(rs("aytel"))%>" border="0" >
					<%else%>
					<img src="<%=ossurl%>Template/Template4/img/telh.jpg" alt="<%=trim(rs("aytel"))%>" title="<%=trim(rs("aytel"))%>" border="0" >
					<%end if%>
				<%else
				response.Write("-")
				end if
				%>		</td>
			  </tr>
		<%
		end if
		rs.close
	
	next
%>
	  

      <tr>
        <td colspan="23">&nbsp;<input name="chkAll1" type="checkbox" id="chkAll1" onClick="this.value=check1(this.form.list1)" value="checkbox"> 
        <input type="hidden" name="toact" id="toact">
        全选
          <input name="act" type="hidden" id="act" value="qunfa">
          <input type="submit" name="Submit" value="批量群发邮件" onClick="return tomail();"></td>
      </tr>
    </table>
</form>
</DIV>


</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>
<SCRIPT>
$(function(){
$('.left_title').each(function(){
   $(this).click(function(){
	   var index=$('.left_title').index(this);
	   if($(this).next().hasClass('hide_m')){
		   $(this).next().removeClass('hide_m');
           $(this).next().show();		 
		   $(this).find('img').attr('src','<%=ossurl%>images/expansion.gif');
		   $.cookie('m_index_'+index,'',{expires:0});
	   } else {
	       $(this).next().hide();
		   $(this).next().addClass('hide_m');
		   $(this).find('img').attr('src','<%=ossurl%>images/shrank.gif');		   
		   $.cookie('m_index_'+index,'none',{expires:365});
	   }
   })
})

$('.left_title').each(function(){
	var index=$('.left_title').index(this);
    $(this).next().css('display',$.cookie('m_index_'+index) ? $.cookie('m_index_'+index) : '');
	if($.cookie('m_index_'+index)){
	    $(this).next().addClass('hide_m');
	}
	$(this).find('img').attr('src',$.cookie('m_index_'+index) ? '<%=ossurl%>images/shrank.gif' : '<%=ossurl%>images/expansion.gif');
})
})

</SCRIPT>


<!--#include virtual="/show/footadmin.asp"-->
