<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_AddAdmin, QianboCMS" EnableEventValidation="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="../Css/layout.css" type="text/css" rel="stylesheet" />
    <script src="../../Js/Common.js" type="text/javascript"></script>
    <script src="../../Js/XmlHttp.js" type="text/javascript"></script>
</head>

<body style="margin: 0px;">
    <form id="Form1" runat="server">
        <table cellspacing="1" cellpadding="0" class="wzdh" align="center">
            <tr>
                <td style="padding-left: 10px;">
                    <img src="../Images/Skin/Default/you.gif" align="absmiddle" />
                    您现在的位置：<a href="../SystemInfo.aspx">后台管理</a> &gt;&gt; 新增管理员
				</td>
            </tr>
        </table>
        <table cellspacing="1" cellpadding="2" class="border" align="center">
            <tr>
                <td class="wzlist"><a href="AdminGroupList.aspx">管理员组列表</a> | <a href="PowerColumn.aspx">新增管理员组</a> | <a href="AdminList.aspx">管理员列表</a> | <a href="SetAdmin.aspx">新增管理员</a></td>
            </tr>
        </table>
        <table cellpadding="0" cellspacing="1" class="border" align="center">
            <tr>
                <td class="bqleft">管理员登陆名：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtAdminLoginID" runat="server"></asp:TextBox>
                    <input id="btnChk" class="btn" type="button" value="重名检测" onclick="CheckName();" />
                    <span style="color: red;">*</span>
				</td>
            </tr>
            <tr>
                <td class="bqleft">管理员姓名：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtAdminName" runat="server"></asp:TextBox>
				</td>
            </tr>
            <tr>
                <td class="bqleft">管理员密码：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtAdminPWD" runat="server" MaxLength="18" TextMode="Password" Width="125px"></asp:TextBox>
                    <span style="color: red;">*</span>
                    <asp:Label ID="lbInfo" runat="server" CssClass="tips" Visible="False"></asp:Label>
				</td>
            </tr>
            <tr>
                <td class="bqleft">请重复输入密码：</td>
                <td class="bqright">
                    <asp:TextBox ID="txtAdminPWDAG" runat="server" MaxLength="18" TextMode="Password" Width="125px"></asp:TextBox>
				</td>
            </tr>
            <tr>
                <td class="bqleft">选择管理组：</td>
                <td class="bqright">
                    <asp:DropDownList ID="DDlistGroup" runat="server"></asp:DropDownList>
				</td>
            </tr>
            <tr>
                <td class="bqleft">是否允许多人登陆：</td>
                <td class="bqright">
                    <asp:RadioButtonList ID="AllowMultiLogin" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Selected="True" Value="True">是</asp:ListItem>
                        <asp:ListItem Value="False">否</asp:ListItem>
                    </asp:RadioButtonList>
				</td>
            </tr>
            <tr>
                <td class="bqleft"></td>
                <td class="bqright">
                    <asp:Button ID="btnSet" runat="server" Text="确定" OnClick="btnSet_Click" CssClass="btn" OnClientClick="return chkInput();" />
                    <input id="Button1" class="btn" type="button" value="返回" onclick="window.history.back()" />
				</td>
            </tr>
        </table>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
    function chkInput() {
        if ($("txtAdminLoginID").value == "") {
            alert("登陆名不能为空！");
            $("txtAdminLoginID").focus();
            return false;
        }
        if ($("txtAdminPWD").value == "") {
            alert("密码不能为空！");
            $("txtAdminPWD").focus();
            return false;
        }
        if ($("txtAdminPWD").value.trim().length < 6 || $("txtAdminPWDAG").value.trim().length > 18) {
            alert("密码长度请保持在6～18位之间。");
            $("txtAdminPWD").focus();
            return false;
        }
        if ($("txtAdminPWD").value.trim() != $("txtAdminPWDAG").value.trim()) {
            alert("两次输入的密码不一致！");
            $("txtAdminPWD").focus();
            return false;
        }
        return true;
    }
    function CheckName() {
        var loginName = $("txtAdminLoginID").value.trim();
        if (loginName.length == 0) {
            alert('登陆名不能为空！');
            return;
        }
        var flag = CheckHas("../Common/CheckHas.aspx", loginName, "LoginName", "Qianbo_Admin")
        if (!flag) {
            alert("该登录名可以使用！");
        }
        else {
            alert("该登录名已存在！");
        }
    }
</script>