<!--<?php
include_once PrintEot('left');
if(empty($action)){print <<<EOT
-->
<form name='FORM' action="$basename" method="post" onreset="mreset()" onsubmit="return checkpost(document.FORM);">
<h2 class="h1">消息群發</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">&nbsp;</td>
		<td class="td2">
			<ul class="list_A">
				<li><input type="radio" name="by" value="1" onclick="sendtype(0)" checked="checked" />用戶組</li>
				<li><input type="radio" name="by" id="online" value="2" onclick="sendtype(1)" />在線用戶</li>
                <li><input type="radio" name="by" value="3" onclick="sendtype(2)" />按用戶名</li>
			</ul>
		</td>
	</tr>
	<tr class="tr1 vt" id="group">
		<td class="td1">接收用戶 <span class="s1">*</span></td>
		<td class="td2">
			<ul class="list_A list_120 cc mb10" style="width:480px;">
<!--
EOT;
$num=0;
foreach($ltitle as $key=>$value){
if($key=='1' || $key=='2' || isset($lneed[$key]))continue;
$num++;
print <<<EOT
-->
				<li><input type='checkbox'  name='sendto[]' value='$key'>$value</li>
<!--
EOT;
}print <<<EOT
-->
				<li><input type='checkbox' name='sendto[]' value='-1'>普通會員</li>
			</ul>
			<span class="bt2"><span><button onclick="ChecksAll(this.form)" value="全 選" name="chkall" onfocus="blur();" type="button">全 選</button></span></span>
		</td>
	</tr>
    <tr class="tr1 vt" id="users" style="display:none" >
				<td class="td1">用戶名 <span class="s1">*</span></td>
				<td class="td2"><input type="text" name="touser" class="input input_wb fl mr10" /><span class="help_a">多個用戶名用,分開</span></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">主題 <span class="s1">*</span></td>
		<td class="td2"><input type="text" class="input input_wb" name="subject" /></td></tr>
	<tr class="tr1 vt">
		<td class="td1">內容 <span class="s1">*</span></td>
		<td class="td2">
<!--
EOT;
require_once PrintEot('wysiwyg_editor_common');
print <<<EOT
-->
		</td>
	</tr>
</table>
</div>

<script type="text/javascript" src="js/pw_ajax.js"></script>
<script type="text/javascript" src="js/global.js"></script>

<div id="menu_face" class="menu" style="display:none;"></div>
<div id="menu_generalface" class="menu" style="display:none;"></div>

<input type="hidden" name="action" value="send" />
<div class="tac mb10">
	<span class="btn"><span><button type="submit" >提 交</button></span></span>
	<span class="bt"><span><button type="reset">重 置</button></span></span>
</div>
</form>
<script type="text/javascript">
function ChecksAll(form,match) {
	for (var i = 0,j = form.elements.length; i < j; i++) {
		var e = form.elements[i];
		if (e.type == 'checkbox' && (typeof match == 'undefined' || e.name.match(match))) {
			e.checked = ifcheck;
		}
	}
	ifcheck = ifcheck == true ? false : true;
}
function sendtype(ID){
	var group = document.getElementById("group");
	var users = document.getElementById("users");
	if (ID==0){
		group.style.display = "";
		users.style.display = "none";
	}else if (ID==1){
		users.style.display = "none";
		group.style.display = "none";
	}else if (ID==2){
		group.style.display = "none";
		users.style.display = "";
	}
}
function checkpost(obj) {
	var online = document.getElementById("online"); 
	var userobj = document.getElementsByName("sendto[]"); 
	var check=0; 
	for(var i=0;i <userobj.length;i++){ 
		  if(userobj[i].checked){ 
			  check=1; 
		  } 
	} 
	if (check == 0 && obj.touser.value == "" && online.checked == false) {
			obj.touser.setAttribute("hasError", 1);
			showDialog("error","接收用戶不能為空",2);
			obj.subject.focus();
			return false;
	} 
	if (obj.subject.value == "") {
			obj.subject.setAttribute("hasError", 1);
			showDialog("error","主題不能為空",2);
			obj.subject.focus();
			return false;
	} 
	if (obj.atc_content.value == "") {
			obj.atc_content.setAttribute("hasError", 1);
			showDialog("error","內容不能為空",2);
			obj.subject.focus();
			return false;
	} 
}
function mreset(){
	editor.textarea.value='';
	editor.doc.body.innerHTML='';
	return true;
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->