<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login_manager.aspx.cs" Inherits="Web.admin.login_manager" %>

<!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 id="Head1" runat="server">
    <title>OA标题页</title>
    <link href="/css/admincss/skin.css" rel="stylesheet" type="text/css" />
    <script type="text/ecmascript" src="/js/md5.js"></script>
</head>
<body>
    <form id="form1" runat="server" defaultfocus ="tbStaff">
 <div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class ="top_bg_left "></td>
    <td  class ="top_bg_center " >
    <table style ="width :100%; height :31px"  border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
      
<!--这里写页标题 -->
        <td style ="height :31px"><div class="titlebt">管 理 员</div></td>
      </tr>
    </table>
    </td> 
    <td class ="top_bg_right "></td>
  </tr>
  
  <tr>
    <td style ="background :url(/css/admincss/images/mail_leftbg.gif); vertical-align :middle " >&nbsp;</td>
    <td style ="background-color :#F7F8F9; vertical-align :top " >
 
        <asp:Panel ID="Panel3" runat="server">

<!--  一组内容模块开始   --> 
    <table class ="tablezong"  border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px" >
        <table  class="tablebiaoti" border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td><div class ="biaotileft ">  管理员查询</div>
            <div class ="biaotiright ">
                                            </div> 
                                        </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td>
           <div style ="margin-bottom :6px; margin-top :6px">
            <asp:GridView ID="GridView1" runat="server" BorderWidth="1px" onrowdatabound="GridView1_RowDataBound" 
                onrowdeleting="GridView1_RowDeleting" 
                Width="100%" CssClass="gv" cellspacing="1" AutoGenerateColumns="False" 
                   onrowcreated="GridView1_RowCreated" 
                   onselectedindexchanging="GridView1_SelectedIndexChanging">
                <RowStyle BorderWidth="1px" CssClass="gvrow" />
                <Columns>
                <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                <asp:BoundField DataField="managersloginname" HeaderText="登录名" ReadOnly="True" />
                <asp:BoundField DataField="managersname" HeaderText="姓名" ReadOnly="True" />
                <asp:BoundField DataField="shenfenzheng" HeaderText="人员编号" ReadOnly="True" />
                <asp:BoundField DataField="rank" HeaderText="管理员类别" ReadOnly="True" />
                <asp:BoundField DataField="zhuangtai" HeaderText="账号状态" ReadOnly="True" />
                    <asp:CommandField HeaderText="修改" SelectText="修改" ShowSelectButton="True" />
                    <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
                </Columns>
                <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
            </asp:GridView></div>        
        </td>
        
      </tr>
      <tr><td  >
          <table cellpadding="0" cellspacing="0" style ="width :100%">
              <tr>
                  <td style =" padding-left :5px; text-align :left  ">
                      
                  </td>
                  <td  id ="allowpage" runat ="server" style ="text-align :right ;  padding-right  :5px">
                      &nbsp;</td>
              </tr>
          </table>
          </td></tr>
    </table>
<!-- 一组内容模块结束 -->

    <!--  一组内容模块开始   --> 
   <table class ="tablezong"  border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px" >
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td ><div class ="biaotileft ">添加管理员</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td style ="text-align :left " >
        <table border="1" style=" width :100%" class="table"  cellpadding ="0" cellspacing ="0" >
            <tr>
                <td class ="tabletd_right " style ="width :100px" >
                    登录名</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbAddLoginName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                    <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ForeColor="Red"
                        ControlToValidate="tbAddLoginName" Display="Dynamic" ErrorMessage="登录名不能为空。" 
                        ValidationGroup="Add"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ForeColor="Red"
                        ControlToValidate="tbAddLoginName" Display="Dynamic" 
                        ErrorMessage="请输入3-20个合法字符。" 
                        ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{3,20}" 
                        ValidationGroup="Add"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    密码</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbAddPassword" runat="server" Width="130px" onblur="calAdd()" onfocus="cAdd()" TextMode="Password"></asp:TextBox>
                    <span style="color :red ;">（必填）</span></td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    姓名</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbAddManagerName" runat="server" MaxLength="25" Width="130px"></asp:TextBox>
                    <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" 
                        ControlToValidate="tbAddManagerName" Display="Dynamic" ErrorMessage="姓名不能为空。" ForeColor="Red"
                        ValidationGroup="Add"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ForeColor="Red"
                        ControlToValidate="tbAddManagerName" Display="Dynamic" 
                        ErrorMessage="请输入2-25个合法字符。" 
                        ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{2,25}" 
                        ValidationGroup="Add"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    人员编号</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbAddManagerId" runat="server" MaxLength="32" Width="130px"></asp:TextBox>
                    <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                        ControlToValidate="tbAddManagerId" Display="Dynamic" ErrorMessage="人员编号不能为空。" ForeColor="Red"
                        ValidationGroup="Add"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" ForeColor="Red"
                        ControlToValidate="tbAddManagerId" Display="Dynamic" 
                        ErrorMessage="请输入3-32个合法字符。" 
                        ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{3,32}" 
                        ValidationGroup="Add"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right">
                    管理等级</td>
                <td class ="tabletd_left ">
                    <asp:CheckBoxList ID="cblAddRank" runat="server" RepeatDirection="Horizontal">
                    </asp:CheckBoxList>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right ">
                    账号状态</td>
                <td class ="tabletd_left ">
                    <asp:DropDownList ID="ddlAddZhuangtai" runat="server">
                        <asp:ListItem Selected="True">正常</asp:ListItem>
                        <asp:ListItem>禁用</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class ="tabletd_right">
                    &nbsp;</td>
                <td class ="tabletd_left">
                    <asp:Button ID="btAdd" runat="server" onclick="btAdd_Click" Text="添加" 
                        ValidationGroup="Add" />
                </td>
            </tr>
            </table>
                    </td>
      </tr>
    </table>
<!-- 一组内容模块结束 -->
        </asp:Panel>   
        
<!--  一组内容模块开始   --> 
<asp:Panel ID="Panel2" runat="server" Visible="False">
            <table border="0"  class ="tablezong"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px">
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td > <div class ="biaotileft ">修改管理员</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td  ><div style ="text-align :left ">
            <table  style =" width :100%" border = "1" class ="table " cellpadding ="0" cellspacing ="0" >
                <tr>
                    <td class ="tabletd_right" style ="width :100px">
                        登录名</td>
                    <td class ="auto-style1">
                        <asp:TextBox ID="tbEditLoginName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                        <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator8" runat="server" 
                            ControlToValidate="tbEditLoginName" Display="Dynamic" ErrorMessage="登录名不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                            ControlToValidate="tbEditLoginName" Display="Dynamic" 
                            ErrorMessage="请输入3-20个合法字符。" 
                            ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{3,20}" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right">
                        密码</td>
                    <td class ="tabletd_left">
                        <asp:Button ID="btEditPassword" runat="server" Text="重置密码" 
                            onclick="btEditPassword_Click" />
                        <asp:Panel ID="pnPassword" runat="server" Visible="False">
                                                输入密码：<asp:TextBox ID="tbEditPassword1" runat="server" onblur="cal()" onfocus="c()"
                            Width="130px" TextMode="Password"></asp:TextBox>
                        再输入一次：<asp:TextBox ID="tbEditPassword2" runat="server" onblur="cal2()" onfocus="c2()" 
                            Width="130px" TextMode="Password"></asp:TextBox>
                        <asp:Button ID="btEditPasswordOK" runat="server" Text="提交修改" onclick="btEditPasswordOK_Click" 
                                                    ValidationGroup="EditPassword" />
                        </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        姓名</td>
                    <td class ="tabletd_left ">
                        <asp:TextBox ID="tbEditManagerName" runat="server" MaxLength="25" Width="130px"></asp:TextBox>
                        <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator10" runat="server" 
                            ControlToValidate="tbEditManagerName" Display="Dynamic" ErrorMessage="姓名不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator10" 
                            runat="server" ControlToValidate="tbEditManagerName" Display="Dynamic" 
                            ErrorMessage="请输入2-25个合法字符。" 
                            ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{2,25}" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right">
                        人员编号</td>
                    <td class ="tabletd_left ">
                        <asp:TextBox ID="tbEditManagerId" runat="server" MaxLength="32" Width="130px"></asp:TextBox>
                        <span style="color :red ;">（必填）</span><asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="tbEditManagerId" Display="Dynamic" ErrorMessage="人员编号不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator11" 
                            runat="server" ControlToValidate="tbEditManagerId" Display="Dynamic" 
                            ErrorMessage="请输入3-32个合法字符。" 
                            ValidationExpression="^[a-zA-Z0-9\u4e00-\u9fa5]{3,20}" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        管理等级</td>
                    <td class ="tabletd_left ">
                        <asp:CheckBoxList ID="cblEditRank" runat="server">
                        </asp:CheckBoxList>
                        <asp:Label ID="lbEditRank" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right" >
                        账号状态</td>
                    <td class ="tabletd_left">
                        <asp:DropDownList ID="ddlEditZhuangtai" runat="server">
                            <asp:ListItem Selected="True">正常</asp:ListItem>
                            <asp:ListItem>禁用</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Label ID="lbEditZhuangtai" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class ="tabletd_right ">
                        <asp:Label ID="lbEditId" runat="server" Visible="False"></asp:Label>
                    </td>
                    <td class ="tabletd_left">
        <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="提交修改" 
                            ValidationGroup="Edit" />
                    </td>
                </tr>
            </table>
            
 </div></td>
      </tr>
    </table>
            </asp:Panel>
<!-- 一组内容模块结束 --> 
   
    </td>
    <td  style =" background-image:url(/css/admincss/images/mail_rightbg.gif )" >
    </td>
  </tr>
  <tr>
    <td  class ="buttom_bg_left "></td>
    <td class ="buttom_bg_center " ></td>
    <td  class ="buttom_bg_right " ></td>
  </tr>
</table>
    </div>
    </form>
</body>
</html>


<script type="text/javascript">  
    function cal() {
        var t1 = document.getElementById("<%=tbEditPassword1.ClientID%>").value;
        if (t1.trim().length > 5) {
            var hash = hex_md5(t1);
             document.getElementById("<%=tbEditPassword1.ClientID%>").value = hash;
         }
         else {
             alert("请输入正确的密码");
         }
     }
</script>  
<script type="text/javascript">  
    function c() {
        document.getElementById("<%=tbEditPassword1.ClientID%>").value ="";
    }
</script>  


<script type="text/javascript">  
    function cal2() {
        var t1 = document.getElementById("<%=tbEditPassword2.ClientID%>").value;
        if (t1.trim().length > 5) {
            var hash = hex_md5(t1);
                document.getElementById("<%=tbEditPassword2.ClientID%>").value = hash;
            }
            else {
                alert("请输入正确的密码");
            }
        }
</script>  
<script type="text/javascript">  
    function c2() {
        document.getElementById("<%=tbEditPassword2.ClientID%>").value ="";
    }
</script>  


<script type="text/javascript">  
    function calAdd() {
        var t1 = document.getElementById("<%=tbAddPassword.ClientID%>").value;
        if (t1.trim().length > 5) {
            var hash = hex_md5(t1);
            document.getElementById("<%=tbAddPassword.ClientID%>").value = hash;
            }
            else {
                alert("请输入正确的密码");
            }
        }
</script>  
<script type="text/javascript">  
    function cAdd() {
        document.getElementById("<%=tbAddPassword.ClientID%>").value ="";
    }
</script>  



