<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Msg_Add.aspx.cs" Inherits="TotCms.Web.Office.Msg.Msg_Add" ValidateRequest="false" %>
<!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>发送即时信息</title>
    <link href="../style/global.css" rel="stylesheet" type="text/css" />
    <link href="../../swfupload/swfupload.css" rel="stylesheet" type="text/css" />
    <script src="../../swfupload/swfupload.js" type="text/javascript"></script>
    <script src="../js/common.js" type="text/javascript"></script>
    <script src="../../js/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../../js/jquery-ui-1.8.10/js/jquery-ui-1.8.10.custom.min.js" type="text/javascript"></script>
    <link href="../../js/jquery-ui-1.8.10/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" type="text/css" />
    <script src="../../ckeditor/ckeditor.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/handlers.js"></script>
    <script type="text/javascript">
      var swfu;
      window.onload = function () {
        //swf upload
        swfu = new SWFUpload({
          // Backend Settings
          upload_url: "../Upload/UploadFiles.aspx",
          post_params: {
            "ASPSESSID": "<%=Session.SessionID %>"
          },

          // File Upload Settings
          file_size_limit: "200 MB",
          file_types: "*.*",
          file_types_description: "files",
          file_upload_limit: "0",    // Zero means unlimited

          // Event Handler Settings - these functions as defined in Handlers.js
          //  The handlers are not part of SWFUpload but are part of my website and control how
          //  my website reacts to the SWFUpload events.
          file_queue_error_handler: fileQueueError,
          file_dialog_complete_handler: fileDialogComplete,
          upload_progress_handler: uploadProgress,
          upload_error_handler: uploadError,
          upload_success_handler: uploadSuccess,
          upload_complete_handler: uploadComplete,

          // Button settings
          button_image_url: "../Upload/Images/XPButtonUploadText_61x22.png",
          button_placeholder_id: "spanButtonPlaceholder",
          button_width: 61,
          button_height: 22,
          button_text: '<span class="button"></span>',
          button_text_style: '.button { font-family: 宋体; font-size: 14px; } .buttonSmall { font-size: 12px; }',
          button_text_top_padding: 1,
          button_text_left_padding: 5,

          // Flash Settings
          flash_url: "../../swfupload/swfupload.swf", // Relative to this file

          custom_settings: {
            upload_target: "divFileProgressContainer",
            upload_returnobjid: "tbAttachment"
          },

          // Debug Settings
          debug: false
        });
      }

      $(function () {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-win").dialog({
          autoOpen: false,
          height: 350,
          width: 450,
          modal: true,
          buttons: {
            "关闭窗口": function () {
              $(this).dialog("close");
            }
          },
          close: function () {

          }
        });

        $("#selclass").click(function () {
          $("#dialog-win").dialog("open");
        });
      });

function CloseFrame() {
    $("#dialog-win").dialog("close");
}
function ReturnValue(v, t) {
    $('#tbStaffs').val(t);
    $('#tbStaffId').val(v);
    CloseFrame();
}
	</script>
</head>
<body>
<form id="form1" runat="server">
<div class="br"></div>
    <div id="dialog-win" title="选择员工">
        <iframe src="../Staff/Staff_Select.aspx" width="370" height="350" frameborder="0"
            scrolling="auto"></iframe>
    </div>
    <div>
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border">
             <tr class="suphead">
                <td colspan="2">
                    <h3>发送即时消息</h3>
                </td>
            </tr>
            <tr>
                <td width="11%" class="fields_text">
                    发送至：</td>
                <td width="89%" class="fields_input">
                    <asp:TextBox ID="tbStaffs" runat="server" CssClass="input_middle" ></asp:TextBox>
                    <asp:TextBox ID="tbStaffId" runat="server" CssClass="hidden"></asp:TextBox>
                    <input id="selclass" name="selclass" type="button" value="选择" class="selclass" /><asp:RequiredFieldValidator 
                      ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbStaffs" 
                      ErrorMessage="请选择接收人员" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
      <td class="fields_text">
          标题：</td>
      <td class="fields_input">
        <asp:TextBox ID="tbTitle" runat="server" CssClass="input_middle"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
          ControlToValidate="tbTitle" ErrorMessage="请填写标题" SetFocusOnError="True"></asp:RequiredFieldValidator>
      </td>
    </tr>
            
            <tr>
      <td class="fields_text">
          内容：</td>
      <td class="fields_input">
      <asp:TextBox ID="Content" runat="server" TextMode="MultiLine"></asp:TextBox>
          <script type="text/javascript">
		      //<![CDATA[
            // Replace the <textarea id="Content"> with an CKEditor instance.
            var editor = CKEDITOR.replace('Content',
			      {
			        toolbar:
					    [
						    ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],
						    ['UIColor']
					    ],
			        filebrowserBrowseUrl: '../../ckfinder/ckfinder.html', //启用浏览功能
			        filebrowserImageBrowseUrl: '../../ckfinder/ckfinder.html?Type=Images',
			        filebrowserFlashBrowseUrl: '../../ckfinder/ckfinder.html?Type=Flash',
			        filebrowserUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files',
			        filebrowserImageUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
			        filebrowserFlashUploadUrl: '../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
			      }
            );
		      //]]>
		      </script>
      </td>
    </tr>
            
            <tr>
      <td class="fields_text" height="45">
          附件：</td>
      <td class="fields_input">     
      <div id="swfu_container" style="margin: 0px 0px;">
        <asp:TextBox ID="tbAttachment" runat="server" CssClass="input_middle"></asp:TextBox>
        <span id="spanButtonPlaceholder"></span>
        <div id="divFileProgressContainer"></div>
      </div>      
      </td>
    </tr>
            <tr>
              <td align="center" bgcolor="#F5F5F5">&nbsp;</td>
              <td height="32" align="left" bgcolor="#F5F5F5"><asp:Button ID="btnSubmit" runat="server" Text="发送信息" CssClass="button_blue" OnClick="btnSubmit_Click" />              
              </td>
            </tr>
        </table>
</div>
    </form>
</body>
</html>