<%@ Page CodeBehind="sendcode.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.sendcode" %>
<!DOCTYPE HTML  >
<HTML>
	<HEAD>
        <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
		<% @ Import Namespace="Webdisk" %>
		<link href="<%=xml.GetStyle()%>" type=text/css rel=stylesheet>
		<link href="css/webdialog.css" type=text/css rel=stylesheet>
    <link rel="stylesheet" href="js/artDialog/css/ui-dialog.css" />
		<script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="js/artDialog/dist/dialog-plus.js" type="text/javascript"></script>
			<script language="javascript">
			    function shareuser(url) {
			        window.open(url + '?send=1', '', 'scrollbars=yes,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=700,height=500');
			    }
			    function shareuser2(url) {
			        window.open(url + '?send=2', '', 'scrollbars=yes,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=700,height=500');
			    }
			    function closeWindow() {
			        this.top.closeWindow();
			    }
			    function autoClose(d) {
			        setTimeout(function () {
			            d.close().remove();
			        }, 2000);
			        closeWindow();
			    }
			    $(window).load(function () {
			        $("#btnSend").bind("click", function () {
			            var d = dialog();
			            var memo = escape($.trim($("#memo").val())), title = escape($.trim($("#title").val()));
			            $.ajax({
			                type: "post",
			                url: "CodeListHandler.ashx?cmd=SendCode",
			                data: { user: '<%=Session["username"]==null?"":Session["username"].ToString() %>', memo:memo , title: title, smsurl: $("#smsurl").val(), mailurl: $("#mailurl").val(), id: '<%=Request["id"]==null?"":Request["id"].ToString() %>', type: '<%=Request["type"]==null?"":Request["type"].ToString() %>' },
			                cache: false,
			                dataType: "json",
			                success: function (data) {
			                    d.content(data.msg).showModal();
			                    autoClose(d);
			                }
			            });
			        });
			    });
			</script>
	</HEAD>
	<body>
		<form id="Form1" name="Form1" runat="server">
			<TABLE class="wfrom-table " style="margin: 0;" >
				<TR>
					<TD class="label" style="width:120px;">
						要发送到的电子邮件：
					</TD>
					<TD >
							<input class="input-text" id="mailurl" type="text" size="69" name="mailurl" runat="server" style="width: 400px;">
							(多个用,分隔)
							<br>
							<a class="wbtn-4" onClick="javascript:shareuser('sel_dept.aspx');" style="margin-top:5px;">选择部门</a>
							&nbsp;&nbsp;<a class="wbtn-4" onClick="javascript:shareuser('searchAdd_user.aspx');">选择用户</a>
					</TD>
				</TR>
				<TR>
					<TD  class="label">要发送到的短消息：</TD>
					<TD>
						<input class="input-text" id="smsurl" type="text" size="69" name="smsurl" runat="server" style="width: 400px;">
							(多个用,分隔)
							<br>
							<a class="wbtn-4" onClick="javascript:shareuser2('sel_dept.aspx');" style="margin-top:5px;">选择部门</a>
							&nbsp;&nbsp;<a class="wbtn-4" onClick="javascript:shareuser2('searchAdd_user.aspx');">选择用户</a>
					</TD>
				</TR>
				<TR >
					<TD  class="label">发送标题：</TD>
					<TD >
						<input class="input-text" id="title" type="text" size="69" name="pickcode2" runat="server" style="width: 400px;">
							<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ErrorMessage="请输入标题" ControlToValidate="title"></asp:requiredfieldvalidator>
					</TD>
				</TR>
				<TR>
					<TD class="label">附加内容：</TD>
					<TD><textarea class="input-textarea" id="memo" name="memo" rows="10" cols="70" runat="server" style="width: 405px;height:120px;"></textarea>
								<BR>
								<span class="">（注：在要显示<%=type%>链接的地方请插入宏：{$code}）</span>
					</TD>
				</TR>
				<TR>
					<TD colspan="2"><INPUT class="wbtn-1" id="btnSend" type="button" value=" 发  送 " name="Button1">
						&nbsp;&nbsp;&nbsp;&nbsp;
						<input class="wbtn-2" type="button" value="取消" onclick="closeWindow()">
					</TD>
				</TR>
			</TABLE>
								
		</form>
	</body>
</HTML>
