<!--<?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');
?>-->