<%@ Page language="c#" Codebehind="MsgSend.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.MsgSend" ValidateRequest="false" %>
<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>MsgSend</title> 
		<!--#include file="inc/head.inc"-->
		<script type="text/javascript">
		    $(document).ready(function(){
		        $('#ddlSendType').change(function(){setVisible();});
		        function setVisible(){
		            switch($('#ddlSendType').val()){
	                    case '0':
	                        $('#TrMemberGroup').hide();$('#TrMemberName').hide();
	                        break;
	                    case '1':
	                        $('#TrMemberGroup').show();$('#TrMemberName').hide();
	                        break;
	                    case '2':
	                        $('#TrMemberGroup').hide();$('#TrMemberName').show();
	                        break;
	                }
		        };
		        setVisible();
		        $('#txtMemberName').change(function(){
		            $('#nametip').html('正在检测用户名');
		            $.ajax({
		                url:'MsgSend.aspx?type=ajax&Action=MemberNameExist&membername='+escape($.trim($('#txtMemberName').val())),
		                async:false,
		                success:function(data){if(data == '0'){$('#nametip').html('<font color=red>用户名不存在!</font>');}else{$('#nametip').html('');}}
		            });
		        });
		    });
		</script>
	</head>
	<body>
	    <div class="container">
		    <div class="sub_container">
		    <div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />发送消息</div>
		    <div class="sub_container_content">
	        <form id="Form1" method="post" runat="server">
		        <div class="frame">
	                <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" CssClass="tableHeaderText">发送消息</asp:Label></div>
	                <div class="frame_content">
		                <table class="ptable" cellspacing="0" cellpadding="0">
			                <tr>
				                <th class="tl">发送对象：</th>
				                <td class="tr">
					                <asp:DropDownList id="ddlSendType" runat="server">
						                <asp:ListItem Value="0">所有会员</asp:ListItem>
						                <asp:ListItem Value="1">会员组</asp:ListItem>
						                <asp:ListItem Value="2">单个会员</asp:ListItem>
					                </asp:DropDownList>
				                </td>
			                </tr>
			                <tr id="TrMemberGroup" style="display:none;">
				                <th class="tl">会员组：</th>
				                <td class="tr">
					                <asp:CheckBoxList id="cblMemberGroup" runat="server" RepeatDirection="horizontal" RepeatLayout="flow"></asp:CheckBoxList></td>
			                </tr>
			                <tr id="TrMemberName" style="display:none;">
				                <th class="tl">会员帐号：</th>
				                <td class="tr">
					                <asp:TextBox id="txtMemberName" runat="server"></asp:TextBox><span id="nametip">请输入会员帐号</span></td>
			                </tr>
			                <tr>
				                <th class="tl">标题：</th>
				                <td class="tr">
					                <asp:TextBox id="txtTitle" runat="server" Columns="50"></asp:TextBox></td>
			                </tr>
			                <tr>
				                <th class="tl">内容：</th>
				                <td class="tr">
					                <FTB:FREETEXTBOX id="ftbContent" runat="Server" ImageGalleryPath="Upload/" ToolbarType="OfficeXP"
									                ButtonPath="images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True" Width="520" Height="200" RemoveServerNameFromUrls="False"></FTB:FREETEXTBOX>
				                </td>
			                </tr>
			                <tr>
				                <th class="tl"></th>
				                <td class="tr">
					                <asp:Button id="btnSubmit" OnClick="btnSubmit_Click" runat="server" Text="发送" CssClass="inputbtn"></asp:Button>
					                <asp:CheckBox id="cbToSendBox" runat="server" Text="保存到发件箱" Checked="true"></asp:CheckBox></td>
			                </tr>
		                </table>
		            </div>
		        </div>
	        </form>
		    </div>
		    
		    </div>
		</div>
	</body>
</html>
