<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Staff_Add.aspx.cs" Inherits="TotCms.Web.Office.Staff.Staff_Add" %>

<!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 runat="server">
  <title></title>
  <link href="../style/global.css" rel="stylesheet" type="text/css" />
  <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="../../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>
  <script src="../../swfupload/swfupload.js" type="text/javascript"></script>
  <script src="js/handlers.js" type="text/javascript"></script>
  <script type="text/javascript">
    var swfu;
    window.onload = function () {
      //swf upload
      swfu = new SWFUpload({
        // Backend Settings
        upload_url: "../Upload/UploadImg.aspx",
        post_params: {
          "ASPSESSID": "<%=Session.SessionID %>"
        },

        // File Upload Settings
        file_size_limit: "2 MB",
        file_types: "*.jpg",
        file_types_description: "JPG Images",
        file_upload_limit: "1",    // 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: "tbPhoto"
        },

        // Debug Settings
        debug: false
      });
    }
    $(function () {
      $("#tabs").tabs();
      $("#dialog:ui-dialog").dialog("destroy");
      //dept window
      $("#dialog-dept").dialog({
        autoOpen: false,
        height: 350,
        width: 400,
        modal: true,
        buttons: {
          "确定": function () {
            $(this).dialog("close");
          },
          "取消": function () {
            $(this).dialog("close");
          }
        },
        close: function () {

        }
      });

      $("#selclass").click(function () {
        $("#dialog-dept").dialog("open");
      });
    });
    function GetDept(pid, cid, did) {
      var retValue, i, sele;
      var childs = document.getElementById(did);
      childs.length = 0;
      //ajax
      $.ajax({
        url: '../Dept/GetDeptByOrg.aspx?classid=' + pid,      //异步方法
        type: 'get',
        dataType: 'xml',
        timeout: 5000,                            //延迟1秒执行
        error: function () {                        //返回失败后
          alert('Error loading XML document');
        },
        success: function (xml) {              //返回成功
          $(xml).find("category").each(function () {         //找到根节点
            var id = $(this).children("id").text();
            var tt = $(this).children("title").text();
            var ofs = childs.length;
            childs.options[ofs] = new Option(tt,id);
            if (parseInt(id) == parseInt(cid)) {
              childs.options[ofs].selected = true;
            }
          });
        }
      });
    }

    function CloseFrame() {
      $("#dialog-dept").dialog("close");
    }
	</script>

  <style type="text/css">
    .style1
    {
      width: 100%;
    }
    #thumbnails{ margin:5px 0px;}
  </style>

</head>
<body>
    <form id="form1" runat="server">
    <div id="dialog-dept" title="选择部门" style="display:none;">
	    <iframe src="../Dept/GetTree.aspx" width="370" height="350" frameborder="0" scrolling="auto"></iframe>	
    </div>
    <div id="right_dqwz">员工管理</div>
    <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border">            
      <tr class="suphead">
        <td>添加员工</td>
      </tr>
      <tr>
        <td>
        <div id="tabs">
	        <ul>
		        <li><a href="#tabs-1">基本信息</a></li>
		        <li><a href="#tabs-2">个人信息</a></li>
	        </ul>
	        <div id="tabs-1">		        
	          <table cellpadding="0" cellspacing="0" class="style1">
              <tr>
                <td>
                  登录帐号：</td>
                <td>
                  <asp:TextBox ID="tbUserId" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="tbUserId" ErrorMessage="不能为空" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
                <td align="center" colspan="2" rowspan="6">
                <asp:TextBox ID="tbPhoto" runat="server" CssClass="hidden" Text="/images/nophoto.gif"></asp:TextBox>
                  <div id="thumbnails"><img alt="" src="../images/nophoto.gif" 
                      style="height: 81px; width: 91px" />
                  </div>
                  <span id="spanButtonPlaceholder"></span>
                  <div id="swfu_container" style="margin: 0px 10px;"></div>
                  </td>
              </tr>
              <tr>
                <td>
                  登录密码：</td>
                <td>
                  <asp:TextBox ID="tbPassWord" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="tbPassWord" ErrorMessage="不能为空" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td>
                  所属部门：</td>
                <td>
                  <asp:TextBox ID="CategoryId" runat="server" CssClass="hidden"></asp:TextBox>
          <asp:TextBox ID="CategoryTitle" runat="server" ReadOnly="True"></asp:TextBox>
          <input id="selclass" name="selclass" type="button" value="请选择" class="selclass" />
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="CategoryTitle" ErrorMessage="请选择部门"></asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td>
                  姓名：</td>
                <td>
                  <asp:TextBox ID="tbUserName" runat="server"></asp:TextBox>
                  <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="tbUserName" ErrorMessage="不能为空" SetFocusOnError="True"></asp:RequiredFieldValidator>
                </td>
              </tr>
              <tr>
                <td>
                  性别：</td>
                <td>
                  <asp:RadioButtonList ID="rbSex" runat="server" RepeatDirection="Horizontal" 
                    RepeatLayout="Flow">
                    <asp:ListItem Selected="True">男</asp:ListItem>
                    <asp:ListItem>女</asp:ListItem>
                  </asp:RadioButtonList>
                </td>
              </tr>
              <tr>
                <td>
                  邮箱：</td>
                <td>
                  <asp:TextBox ID="tbEmail" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  电话：</td>
                <td>
                  <asp:TextBox ID="tbTel" runat="server"></asp:TextBox>
                </td>
                <td>
                  职位：</td>
                <td>
                  <asp:DropDownList ID="ddPositionId" runat="server">
                  </asp:DropDownList>
                </td>
              </tr>
              <tr>
                <td>
                  传真：</td>
                <td>
                  <asp:TextBox ID="tbFax" runat="server"></asp:TextBox>
                </td>
                <td>
                  职称：</td>
                <td>
                  <asp:DropDownList ID="ddQualificationID" runat="server">
                  </asp:DropDownList>
                </td>
              </tr>
              <tr>
                <td>
                  手机：</td>
                <td>
                  <asp:TextBox ID="tbMobile" runat="server"></asp:TextBox>
                </td>
                <td>
                  状态：</td>
                <td>
                  <asp:DropDownList ID="ddWorkStatusId" runat="server">
                  </asp:DropDownList>
                </td>
              </tr>
              <tr>
                <td>
                  编制：</td>
                <td>
                  <asp:TextBox ID="tbOrganization" runat="server"></asp:TextBox>
                </td>
                <td>
                  允许登录：</td>
                <td>
                  <asp:CheckBox ID="ckIsLock" runat="server" Checked="True" />
                </td>
              </tr>
              </table>
		        
	        </div>
	        <div id="tabs-2">
		        <table class="style1">
              <tr>
                <td>
                  国家：</td>
                <td>
                  <asp:TextBox ID="tbCountry" runat="server"></asp:TextBox>
                </td>
                <td>
                  政治面貌：</td>
                <td>
                  <asp:DropDownList ID="ddPolicitalStatus" runat="server">
                    <asp:ListItem>团员</asp:ListItem>
                    <asp:ListItem>党员</asp:ListItem>
                    <asp:ListItem>无</asp:ListItem>
                  </asp:DropDownList>
                </td>
              </tr>
              <tr>
                <td>
                  地址：</td>
                <td colspan="3">
                  <asp:TextBox ID="tbProvince" runat="server"></asp:TextBox>
                  省<asp:TextBox ID="tbCity" runat="server"></asp:TextBox>
                  市<asp:TextBox ID="tbDistrict" runat="server"></asp:TextBox>
                  区<asp:TextBox ID="tbAddress" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  邮编：</td>
                <td>
                  <asp:TextBox ID="tbPostCode" runat="server"></asp:TextBox>
                </td>
                <td>
                  身份证：</td>
                <td>
                  <asp:TextBox ID="tbIDNo" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  籍贯：</td>
                <td>
                  <asp:TextBox ID="tbHomeTown" runat="server"></asp:TextBox>
                </td>
                <td>
                  出生地：</td>
                <td>
                  <asp:TextBox ID="tbBornPlace" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  户口所在地：</td>
                <td>
                  <asp:TextBox ID="tbResidencePlace" runat="server"></asp:TextBox>
                </td>
                <td>
                  出生日期：</td>
                <td>
                  <asp:TextBox ID="tbBornDate" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  参加工作时间：</td>
                <td>
                  <asp:TextBox ID="tbTimeToWork" runat="server"></asp:TextBox>
                </td>
                <td>
                  参加工作地点：</td>
                <td>
                  <asp:TextBox ID="tbWorkPlace" runat="server"></asp:TextBox>
                </td>
              </tr>
              <tr>
                <td>
                  民族：</td>
                <td>
                  <asp:TextBox ID="tbNationality" runat="server"></asp:TextBox>
                </td>
                <td>
                  婚姻状况：</td>
                <td>
                  <asp:DropDownList ID="ddMaritalStatus" runat="server">
                    <asp:ListItem>未婚</asp:ListItem>
                    <asp:ListItem>已婚</asp:ListItem>
                    <asp:ListItem>离异</asp:ListItem>
                  </asp:DropDownList>
                </td>
              </tr>
            </table>
	        </div>
        </div>
        </td>
      </tr>
      <tr>
        <td align="center" height="35">
          <asp:Button ID="Button1" runat="server" Text="填好了，现在提交-&gt;" 
            onclick="Button1_Click" />
          <input id="Button2" type="button" value="取消" onclick="javascript:history.back();" />
        </td>
      </tr>
    </table>
    

    </form>
</body>
</html>
