<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true" CodeBehind="administrator_modify.aspx.cs" Inherits="PPFOR.Admin.Sys.administrator_modify" Title="修改管理员" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">
<script src="../JS/gridview.js" type="text/javascript"></script>  
<script language="javascript" type="text/javascript">    
    function displayRoleSectionArea()
    {
        var obj=document.getElementById("<%=PPFOR_dataRole.ClientID %>");
        var objRow=document.getElementById("roleSectionArea");
        if(objRow!=null)
        { 
            objRow.style.display=(obj.checked==true)?'':'none';      
        }
    }
    function changeMenuSection(checked,menuId)
    {
        if(checked==true)
        {
            document.getElementById("menuSee_" + menuId).checked=true;
        }
        else
        {
            document.getElementById("menuSee_" + menuId).checked=false;
            document.getElementById("menuUpdate_" + menuId).checked=false;
            document.getElementById("menuAdd_" + menuId).checked=false;
            document.getElementById("menuDelete_" + menuId).checked=false;
        }
    }
    function checkMenuSection()
    {
        var boxes=document.getElementsByTagName('input');
        if(boxes!=null && boxes.length>0)
        {
            for(var i=0; i<boxes.length; i++)
            {
                if(boxes[i].type=='checkbox' && boxes[i].getAttribute('boxdefaultvalue')!=null)
                {
                    if(boxes[i].getAttribute('boxdefaultvalue').toLowerCase()=='true'){
                        boxes[i].checked=true;
                        onRowCheckChange(boxes[i]);
                    }
                }
            }
        }
    }
    function selectAll(checked,name)
    {
        var boxes=document.getElementsByName(name);
        if(boxes!=null && boxes.length>0)
        {
            var evt=null;
            if(!document.all)
            {
                evt = document.createEvent('HTMLEvents');   
                evt.initEvent('change',true,true);   
            }
            for(var i=0; i<boxes.length; i++)
            {
                boxes[i].checked=checked;
                if(document.all)
                {
                    boxes[i].fireEvent("onchange");
                }
                else
                {
                     if(evt==null){
                        evt = document.createEvent('HTMLEvents');   
                        evt.initEvent('change',true,true);   
                     }
                     boxes[i].dispatchEvent(evt);   
                }   
                onRowCheckChange(boxes[i]);
            }
        }
    }
    function checkInputIsNumber()
    {
        if (window.event.keyCode <48 || window.event.keyCode > 57)
        {
            window.event.keyCode=0;
        }
    }
</script>
<form action="administrator_modify.aspx" method="post" id="form1" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="fortable">
    <thead>        
        <tr>
          <td colspan="2" align="center">修改管理员</td>
        </tr>
    </thead>        
        <tr>
          <td style="width:15%" align="right">管理员名：</td>
          <td><asp:Label ID="PPFOR_adminName" runat="server"></asp:Label></td>
        </tr>
        <tr>
          <td align="right">前台会员名：</td>
          <td><asp:Label ID="PPFOR_userName" runat="server"></asp:Label></td>
        </tr>
        <tr>
          <td align="right">填写密码：</td>
          <td><asp:TextBox ID="PPFOR_adminPassword" runat="server" TextMode="Password" Maxlength="20" Width="150px"></asp:TextBox> 不修改密码请保持为空！<br />
          <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" SetFocusOnError="true" ValidationExpression="^[^\u4e00-\u9fa5]{6,20}$" Display="Dynamic" ControlToValidate="PPFOR_adminPassword">管理员密码长度必须在6-20个字符之间，密码不能使用中文字符</asp:RegularExpressionValidator>
          </td>
        </tr>
        <tr>
          <td align="right">确认密码：</td>
          <td><asp:TextBox ID="PPFOR_confirmAdminPassword" runat="server" TextMode="Password" Maxlength="20" Width="150px"></asp:TextBox><br />
              <asp:CompareValidator ID="CompareValidator1" ControlToCompare="PPFOR_confirmAdminPassword" ControlToValidate="PPFOR_adminPassword" runat="server" SetFocusOnError="true" Display="Dynamic">两次密码输入不一致</asp:CompareValidator>
          </td>
        </tr>
        <tr>
          <td align="right">角色设置：</td>
          <td> <input name="rolesType" id="PPFOR_superRole" type="radio" value="0" onclick="displayRoleSectionArea();" runat="server"/>
            超级管理员：拥有所有权限。<br />
            <input name="rolesType" id="PPFOR_designRole" type="radio" value="1" onclick="displayRoleSectionArea();" runat="server"/>
            网站设计师：拥有网站设计和资料管理的权限。<br />
            <input name="rolesType" id="PPFOR_dataRole" type="radio" value="2" onclick="displayRoleSectionArea();" runat="server"/>
            资料管理员：拥有资料管理的权限。</td>
        </tr>
        <tr id="roleSectionArea">
            <td align="right">权限设置：</td>
            <td style="width:99%">
                <%=PPFOR_dataRoleMenus %>
            </td>
        </tr>
        <tr>
          <td align="right">选项设置：</td>
          <td><input name="isAllowModifyPwd" id="PPFOR_isAllowModifyPwd" type="checkbox" runat="server"/>
            允许管理员修改密码<br />
            <input type="checkbox" name="isLocked" id="PPFOR_isLocked" runat="server"/>
          是否锁定</td>
        </tr>
        <tr>
          <td align="right">登录过期时间：</td>
          <td><asp:TextBox ID="PPFOR_expiresTime" runat="server" Width="150px" MaxLength="9"></asp:TextBox> 分钟（为0则不过期，必须手动注销管理员才能退出登录）
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" ValidationExpression="^[0-9]{1,9}$" Display="Dynamic" ControlToValidate="PPFOR_expiresTime"><br />登录过期时间必须是非负整数</asp:RegularExpressionValidator>
          </td>
        </tr>
        <tr>
            <td colspan="2" align="center" valign="middle" style="height:50px; display:none">
                <asp:Button ID="PPFOR_updateAdministrator" CssClass="inputbutton" runat="server" Text="提交" OnClick="PPFOR_updateAdministratorClick"/>
                <input name="reset" id="reset1" type="reset" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
                <script type="text/javascript">
                    addButtonArray("<%= PPFOR_updateAdministrator.ClientID %>","reset1");
                </script>
            </td>
        </tr>
      </table>
      <br />
</form>
</asp:Content>
