<!--<?php
include_once PrintEot('left');
if(empty($action)){
if($resume){
$j_url = EncodeUrl("$basename&action=erase");
print <<<EOT
-->
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3"><td>
	存在未完成的邮件群发任务，最后发送时间为<span class="s2">$pwSendmail[lasttime]</span>
	[<a href="$basename&action=confirm">查看</a>]　[<a href="$j_url">删除</a>]
</td></tr>
</table>
<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript" src="js/wind_editor.js"></script>
<form name='FORM' action="$basename" method="post">
<h2>邮件群发</h2>
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr3"><td></td><td>
<span class="w">
	<input type='radio' name='by' value='0' onclick="sendtype(0)" checked>按用户组
	<input type='radio' name='by' value='1' onclick="sendtype(1)">在线用户
	<input type='radio' name='by' value='2' onclick="sendtype(2)">按注册时间
</span></td></tr>
<tbody id="group_0">
<tr class="tr3">
<td width="15%" valign="top">接收用户</td>
<td>

<table width="100%"><tr>
<!--
EOT;
$num=0;
foreach($ltitle as $key=>$value){
if($key=='1' || $key=='2' || isset($lneed[$key]))continue;
$num++;
print <<<EOT
-->
<td><input type='checkbox' name='sendto[]' value='$key'>&nbsp;$value</td>
<!--
EOT;
if($num==4){
$num=0;
print <<<EOT
-->
</tr><tr>
<!--
EOT;
}}print <<<EOT
-->
<td><input type='checkbox' name='sendto[]' value='-1'>普通会员</td></tr></table>
<input type="button" name="chkall" class="btn" value="全 选" onclick="CheckAll(this.form)"><br/><br/>
</td></tr></tbody>
<tbody id="group_2" style="display:none"><tr class="tr3">
<td width="15%" valign="top">接收用户</td>
<td><input class="input" size="19" name="starttime" id="starttime" value="" onclick="ShowCalendar(this.id);" type="text"> - <input class="input" size="20" name="endtime" id="endtime" value="" onclick="ShowCalendar(this.id);" type="text"> 格式：yyyy-mm-dd，会员注册时间范围</td>
</tr></tbody>
<tr class="tr3">
	<td width="15%">每批发送个数</td>
	<td><input class="input" type="text" name="percount" value="100" /></td>
</tr>
<tr class="tr3">
<td>主题</td>
<td><input type="text" class="input" name="subject" size="60" /></td></tr>
<tr class="tr3" valign="top">
	<td>内容<br /><span class="gray"><br />\$email:表示用户的邮件地址<br /><br />\$windid:表示用户名<br /><br />\$winduid:表示用户UID</span></td>
	<td><textarea name="atc_content" cols="80" rows="15"></textarea></td>
</tr>
</table>
<br /><input type="hidden" name="action" value="send">
<center>
<input type="submit" value="提 交" class="btn"> <input type="reset" class="btn" value="重 置">
</center><br /></form>

<script type="text/javascript" src="js/date.js"></script>
<SCRIPT LANGUAGE="JavaScript">
function sendtype(ID){
	for(var i=0;i<3;i++){
		try{
		if(i==ID)document.getElementById("group_"+ID).style.display = "";
		else document.getElementById("group_"+i).style.display = "none";
		}catch(e){}
	}
}
</SCRIPT>
<!--
EOT;
} elseif ($action == 'send' || $action == 'confirm') {print <<<EOT
-->
<h2>邮件群发确认</h2>
<table width="100%" cellspacing="0" cellpadding="0">

	<tr class="tr3">
		<td width="15%">接收用户总数</td>
		<td><span class="s3">$pwSendmail[count]</span>　人</td>
	</tr>
	<tr class="tr3">
		<td width="15%">每批发送</td>
		<td>$pwSendmail[num]　封</td>
	</tr>
<!--
EOT;
if ($action != 'send') {print <<<EOT
-->
	<tr class="tr3">
		<td width="15%">已完成发送</td>
		<td>$pwSendmail[sent]　封</td>
	</tr>
	<tr class="tr3">
		<td width="15%">最后发送时间</td>
		<td>$pwSendmail[lasttime]</td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
	<tr class="tr3">
		<td width="15%">邮件接收用户</td>
		<td>
<!--
EOT;
if($pwSendmail[by]==0){
foreach($pwSendmail[info] as $value){
print <<<EOT
-->
&nbsp;$ltitle[$value]
<!--
EOT;
}}elseif($pwSendmail[by]==1){print <<<EOT
-->
当前在线的会员
<!--
EOT;
}elseif($pwSendmail[by]==2){
$stime=get_date($pwSendmail[info][stime],'Y-m-d');
$etime=get_date($pwSendmail[info][etime],'Y-m-d');
print <<<EOT
-->
注册时间在 {$stime}　至　{$etime} 之间的会员
<!--
EOT;
}print <<<EOT
-->
		</td>
	</tr>
	<tr class="tr3">
		<td>邮件标题</td>
		<td>$pwSendmail[subject]</td></tr>
	<tr class="tr3">
		<td>邮件内容</td>
		<td><textarea cols="80" rows="15" disabled>$pwSendmail[content]</textarea></td>
	</tr>

</table>
<br />
<center>
<!--
EOT;
$j_url = EncodeUrl("$basename&action=erase");
if ($action == 'send') {print <<<EOT
-->
	<input type="button" value="开始发送" class="btn" onClick="javascript:window.location='$basename&action=groupsend'" />　[<a href="$j_url">取消</a>]　[<a href="javascript:history.go(-1)">返回</a>]
<!--
EOT;
}else{print <<<EOT
-->
	<input type="button" value="继续发送" class="btn" onClick="javascript:window.location='$basename&action=groupsend'" />　[<a href="$j_url"></a>]　[<a href="javascript:history.go(-1)">返回</a>]
<!--
EOT;
}print <<<EOT
-->
</center>
<br />
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->