<%@ Page CodeBehind="admin_edituser.aspx.cs" Language="c#" AutoEventWireup="True"
    Inherits="Webdisk.admin_edituser" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title></title>
    <link href="images/Site_Css.css" type="text/css" rel="stylesheet">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="images/Css.css" type="text/css" rel="stylesheet">
    <meta content="MSHTML 6.00.6000.16544" name="GENERATOR">
    <style type="text/css">
        .style3
        {
            color: #ff0000;
        }
    </style>
    <script src="../js/calendar.js" type="text/javascript"></script>
    <link href="img/main.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        .style3
        {
            color: #ff0000;
        }
    </style>
    <script language="javascript">
        function Result() {
            Webdisk.admin_adduser.GetBmAll(document.all.company.value, get_Result_CallBack);
        }

        function get_Result_CallBack(response) {
            if (response.value != null) {
                document.all("dept").length = 0; document.all("dept2").length = 0; document.all("dept3").length = 0; document.all("dept4").length = 0; document.all("dept5").length = 0;
                document.all("dept").options.add(new Option("不指定", "0")); document.all("dept2").options.add(new Option("不指定", "0")); document.all("dept3").options.add(new Option("不指定", "0")); document.all("dept4").options.add(new Option("不指定", "0")); document.all("dept5").options.add(new Option("不指定", "0"));
                var ds = response.value;
                if (ds != null && typeof (ds) == "object") {
                    for (var i = 0; i < ds.Rows.length; i++) {
                        var name = ds.Rows[i].knamem;
                        var id = ds.Rows[i].id;
                        document.all("dept").options.add(new Option(name, id)); document.all("dept2").options.add(new Option(name, id)); document.all("dept3").options.add(new Option(name, id)); document.all("dept4").options.add(new Option(name, id)); document.all("dept5").options.add(new Option(name, id));
                    }
                    document.all.hiddept.value = document.all.dept.value; document.all.hiddept2.value = document.all.dept2.value; document.all.hiddept3.value = document.all.dept3.value; document.all.hiddept4.value = document.all.dept4.value; document.all.hiddept5.value = document.all.dept5.value;
                }
            }
            return
        }
        function show(id) {
            document.getElementById("adddept" + id).style.display = 'none';
            document.getElementById("tdshow" + id).style.display = '';
        }
        function EditUserName() {
            document.getElementById("edit1").style.display = 'none';
            document.getElementById("edit2").style.display = 'none';
            document.getElementById("edit3").style.display = '';
        }
        function EditUserName1() {
            document.getElementById("edit1").style.display = '';
            document.getElementById("edit2").style.display = '';
            document.getElementById("edit3").style.display = 'none';
        }
        function EditUserName2() {
            Webdisk.admin_adduser.EditUserName(document.getElementById("edit1").innerHTML, document.getElementById("newname").value);
            document.getElementById("edit1").innerHTML = document.getElementById("newname").value;
            document.getElementById("edit1").style.display = '';
            document.getElementById("edit2").style.display = '';
            document.getElementById("edit3").style.display = 'none';
        }
    </script>
</head>
<body bgcolor="#ffffff" topmargin="5" marginwidth="0" marginheight="0">
    <form name="Form1" method="post" id="Form1" runat="server">
    <div>
    </div>
    <div>
        <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
            <tbody>
                <tr>
                    <td class="menubar_title">
                        <img hspace="3" src="images/default.gif" align="absMiddle" vspace="3" border="0">&nbsp;修改用户
                    </td>
                    <td class="menubar_readme_text" valign="bottom">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="menubar_function_text" height="1">
                        &nbsp;
                    </td>
                    <td class="menubar_menu_td" align="right">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2" height="5">
                    </td>
                </tr>
            </tbody>
        </table>
        <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
            <tbody>
                <tr>
                    <td background="images/tab_top_bg.gif" height="22">
                        <table cellspacing="0" cellpadding="0" border="0">
                            <tbody>
                                <tr>
                                    <!--按钮　Start-->
                                    <td>
                                        <table height="22" cellspacing="0" cellpadding="0" border="0">
                                            <tbody>
                                                <tr>
                                                    <td width="3">
                                                        <img id="tabImgLeft__0" height="22" src="images/tab_unactive_left.gif" width="3">
                                                    </td>
                                                    <td class="tab" id="tabLabel__0" onclick="javascript:tabClick(0,1)" background="images/tab_active_bg.gif"
                                                        unselectable="on">
                                                        修改用户
                                                    </td>
                                                    <td width="3">
                                                        <img id="tabImgRight__0" height="22" src="images/Menu/tab_active_right.gif" width="3">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff">
                        <table cellspacing="0" cellpadding="0" width="100%" border="0">
                            <tbody>
                                <tr>
                                    <td width="1" background="images/tab_bg.gif">
                                        <img height="1" src="images/tab_bg.gif" width="1">
                                    </td>
                                    <td class="borderstyle" valign="top">
                                        <div id="tabContent__0">
                                            <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
                                                <tbody>
                                                    <tr>
                                                        <td width="27%" class="table_body">
                                                            用户名
                                                        </td>
                                                        <td width="73%" class="table_none">
                                                            <span id="edit1">
                                                                <%=Request["username"].ToString()%></span> <span id="edit2" runat="server"><a href="#"
                                                                    onclick="EditUserName();">更改用户名</a></span> <span id="edit3" style="display: none">
                                                                        <input name="newname" type="text" id="newname" size="10" value="<%=Request["username"].ToString()%>">
                                                                        <input type="button" name="button" id="button" value="确定" onclick="EditUserName2();"><input
                                                                            type="button" name="button2" id="button2" value="取消" onclick="EditUserName1();"></span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            注册时间
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:Label ID="regtime" runat="server">未知</asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            IP
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:Label ID="ip" runat="server">未知</asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            最后登录
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:Label ID="uplogin" runat="server">未知</asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            登录次数
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:Label ID="logincount" runat="server">未知</asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            <span class="a3-green">密码</span>
                                                        </td>
                                                        <td class="table_none">
                                                            <span class="a3-green">
                                                                <asp:TextBox ID="Password1" runat="server" TextMode="Password" Columns="40" CssClass="tableTdtext"></asp:TextBox>
                                                                （不改密码不用输） </span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            <span class="a3-green">电子邮箱</span>
                                                        </td>
                                                        <td class="table_none">
                                                            <span class="a3-green">
                                                                <asp:TextBox ID="email" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                                <span class="style3"></span></span>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            性别
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:RadioButtonList ID="sex" runat="server" RepeatDirection="Horizontal" Height="10px"
                                                                RepeatLayout="Flow">
                                                                <asp:ListItem Value="男" Selected="True">男</asp:ListItem>
                                                                <asp:ListItem Value="女">女</asp:ListItem>
                                                            </asp:RadioButtonList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            主页
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="url" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            QQ
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="QQ" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            MSN
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="MSN" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            真实姓名
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="realname" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            联系电话
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="phone" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            联系地址
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="address" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            学校名称
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="company" id="company" onchange="Result();" runat="server">
                                                                <option selected></option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            所在部门
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="dept" id="dept" onchange="javascript:document.all.hiddept.value=this.value;"
                                                                runat="server">
                                                                <option selected></option>
                                                            </select>
                                                            &nbsp;<span id="adddept2" runat="server"><a href="javascript:void(0)" onclick="show(2)">指定另外部门</a></span>
                                                        </td>
                                                    </tr>
                                                    <tr style="display: none" id="tdshow2" runat="server">
                                                        <td class="table_body">
                                                            所在部门2
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="dept2" id="dept2" runat="server" onchange="javascript:document.all.hiddept2.value=this.value;">
                                                                <option selected></option>
                                                            </select>
                                                            &nbsp;<span id="adddept3" runat="server"><a href="javascript:void(0)" onclick="show(3)">指定另外部门</a></span>
                                                        </td>
                                                    </tr>
                                                    <tr style="display: none" id="tdshow3" runat="server">
                                                        <td class="table_body">
                                                            所在部门3
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="dept3" id="dept3" runat="server" onchange="javascript:document.all.hiddept3.value=this.value;">
                                                                <option selected></option>
                                                            </select>
                                                            &nbsp;<span id="adddept4" runat="server"><a href="javascript:void(0)" onclick="show(4)">指定另外部门</a></span>
                                                        </td>
                                                    </tr>
                                                    <tr style="display: none" id="tdshow4" runat="server">
                                                        <td class="table_body">
                                                            所在部门4
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="dept4" id="dept4" runat="server" onchange="javascript:document.all.hiddept4.value=this.value;">
                                                                <option selected></option>
                                                            </select>
                                                            &nbsp;<span id="adddept5" runat="server"><a href="javascript:void(0)" onclick="show(5)">指定另外部门</a></span>
                                                        </td>
                                                    </tr>
                                                    <tr style="display: none" id="tdshow5" runat="server">
                                                        <td class="table_body">
                                                            所在部门5
                                                        </td>
                                                        <td class="table_none">
                                                            <select name="dept5" id="dept5" runat="server" onchange="javascript:document.all.hiddept5.value=this.value;">
                                                                <option selected></option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            <font face="宋体">所属角色</font>
                                                        </td>
                                                        <td class="table_none">
                                                            <font face="宋体">
                                                                <select id="role" name="role" runat="server">
                                                                    <option selected></option>
                                                                </select>
                                                            </font>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            <font face="宋体">所属存储区</font>
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:DropDownList ID="team" runat="server">
                                                            </asp:DropDownList>
                                                            <asp:Label ID="sy" runat="server" ForeColor="Red" Visible="False">商业版功能</asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            有效期至
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="enddate" runat="server" CssClass="tableTdtext" Columns="40"></asp:TextBox>
                                                            （不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            空间大小
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:TextBox ID="spacesize" runat="server" CssClass="tableTdtext" Columns="40" Width="63px">-1</asp:TextBox>
                                                            M（-1为不限制）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            是否审核
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:RadioButtonList ID="umark" runat="server" RepeatDirection="Horizontal">
                                                                <asp:ListItem Value="1" Selected="True">已审</asp:ListItem>
                                                                <asp:ListItem Value="0">未审</asp:ListItem>
                                                            </asp:RadioButtonList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            是否锁定
                                                        </td>
                                                        <td class="table_none">
                                                            <asp:RadioButtonList ID="ulock" runat="server" RepeatDirection="Horizontal">
                                                                <asp:ListItem Value="1">锁定</asp:ListItem>
                                                                <asp:ListItem Value="0" Selected="True">未锁</asp:ListItem>
                                                            </asp:RadioButtonList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            <font face="宋体">允许登录的IP</font>
                                                        </td>
                                                        <td class="table_none">
                                                            <font face="宋体">
                                                                <asp:TextBox ID="allowip" runat="server" Columns="40" CssClass="tableTdtext"></asp:TextBox>
                                                                （支持IP段，多个IP以半角,分隔，不填为不限）</font>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <!--内容框End-->
                                    </td>
                                    <td width="1" background="images/tab_bg.gif">
                                        <img height="1" src="images/tab_bg.gif" width="1">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td background="images/tab_bg.gif" bgcolor="#ffffff">
                        <img height="1" src="images/tab_bg.gif" width="1">
                    </td>
                </tr>
            </tbody>
        </table>
        <!--选项卡 End-->
    </div>
    <div>
        <div align="center">
            <span class="px14">
                <br>
                <asp:Button ID="Button1" runat="server" Width="100px" class="formbutton" Text="保存信息"
                    OnClick="Button1_Click"></asp:Button>
                <input type="hidden" name="hiddept" id="hiddept" runat="server">
                <input type="hidden" name="hiddept2" id="hiddept2" runat="server">
                <input type="hidden" name="hiddept3" id="hiddept3" runat="server">
                <input type="hidden" name="hiddept4" id="hiddept4" runat="server">
                <input type="hidden" name="hiddept5" id="hiddept5" runat="server">
                <input id="hidteam" type="hidden" name="hidteam" runat="server">
                <input id="username" type="hidden" name="username" runat="server">
            </span>
            <br>
        </div>
    </div>
    </form>
    <script language="javascript">
        function tabClick(idx, count) {
            for (i_tr = 0; i_tr < count; i_tr++) {
                var tabImgLeft = eval('document.all.tabImgLeft__' + idx);
                var tabImgRight = eval('document.all.tabImgRight__' + idx);
                var tabLabel = eval('document.all.tabLabel__' + idx);
                var tabContent = eval('document.all.tabContent__' + idx);

                tabImgLeft.src = 'images/tab_active_left.gif';
                tabImgRight.src = 'images/tab_active_right.gif';
                tabLabel.background = 'images/tab_active_bg.gif';
                tabContent.style.visibility = 'visible';
                tabContent.style.display = 'block';
            }
        }
        tabClick(0, 1);
    </script>
    <br>
</body>
</html>
