<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_AdminEdit, LebiMall" %>
<!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>添加管理员</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/checked.js"></script>
     <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script src="js/topHead.js" type="text/javascript"></script>
    <script type="text/javascript">
        function validate(){
            var flag = true;
            if(!checkPwd()){
                 flag = false;
            } if(!checkrepeatpwd()){
                flag = false;
            }
            return flag;
        }
        function checkPwd(){
            if(document.getElementById("txt_adminPwd").value.length>6){
                document.getElementById("msg_cm").innerHTML="<span class='msg_submit'>密码长度不能大于6！</span>";
                return false;
            }else{ 
                  document.getElementById("msg_cm").innerHTML="<em>长度必须小于6</em>";
                   return true;
            }
        }
        
        function checkrepeatpwd(){
            if(document.getElementById("txt_repeatpwd").value!=document.getElementById("txt_adminPwd").value){
                 document.getElementById("msg_rpwd").innerHTML="<span class='msg_submit'>两次密码输入不一致</span>";
                 document.getElementById("msg_cm").innerHTML= "<span class='msg_submit'>两次密码输入不一致</span>";
                return false;
            }else{
                document.getElementById("msg_rpwd").innerHTML="";
                document.getElementById("msg_cm").innerHTML="<em>长度必须小于6</em>";
                return true;
            }
        }
        function btn_sub(){
            document.getElementById("Image1").click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server" onsubmit="return validate()">
   <script>header(6,1,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    
    <!--功能区-->
    <div class="tabmenus mainwidth">
            <ul>
                <li class="current"><a href="AdminList.aspx"><span>管理员管理</span></a></li>
                <li><a href="Admin_Add.aspx"><span>管理员添加</span></a></li>
            </ul>
        </div>
    <div class="tab-mainbody">
        <div class="tab-mainbody2">
        <div class="functionHandleArea clearfix">  
                <input type="image" border="0" title=" 保存 " runat="server" src="images/bt_app.gif"  id="Image1" onserverclick="Button1_ServerClick" align="absmiddle" >
                <input type="image" name="Submit" title=" 重填 " onClick="reset();return false;" src="images/bt_res.gif" align="absmiddle" />
                <input type="image" border="0" title=" 返回 " onclick="history.back();return false;" src="images/bt_bak.gif" align="absmiddle" />&nbsp;<em>不填密码表示不更改密码</em></td>
        </div>
        <div id="datalist">
            <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list">
                <tr>
                    <th colspan="2">编辑管理员信息</th><th><div class="title_r" id="msg_sub"></div></th>
                     <script type="text/javascript">
                        var $=jQuery;
                        var f="<%=Session["returnValue"]  %>";
                        var i =2;
                        if(f=="true"){
                            tipsWindown('操作结果','text:操作成功！','250','60','true','2000','true','text');
                            <% Session["returnValue"]= null; %>
                            setInterval("fun()", 1000);
                        }
                        if(f=="false"){
                            tipsWindown('操作结果','text:操作失败！','250','60','true','2000','true','text');
                            <% Session["returnValue"]= null; %>
                        }
                        function fun() {
                            if (i == 1) {
                                window.location.href="AdminPower.aspx?uid=<%=id %>';
                            }
                            i--;
                        }
                    </script>
                </tr>
                <tr class="row">
                    <td width="15%" class="row">
                        管理员账号：
                    </td>
                    <td class="row">
                        <span><%=name %></span>
                    </td>
                </tr>
                <tr class="row">
                    <td class="row">
                        管理员密码：
                    </td>
                    <td class="row">
                        <input type="password" runat="server" id="txt_adminPwd" class="input" onblur="checkPwd()" style="width:150px;"/>&nbsp;<span id="msg_cm"><em>长度必须小于6</em></span>
                    </td>
                </tr>
                <tr class="row">
                    <td class="row">
                        请确认密码：
                    </td>
                    <td class="row">
                        <input type="password" runat="server" id="txt_repeatpwd" class="input" onblur="checkrepeatpwd()" style="width:150px;"/><span id="msg_rpwd"></span>
                    </td>
                </tr>
                <tr class="row">
                    <td class="row">
                        管理员状态：
                    </td>
                    <td class="row">
                        <input type="radio" id="rdo0" name="states" value="1" runat="server" />开启<input type="radio" id="rdo1" name="states" value="0" runat="server" />关闭
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="list-foot">
                        <input id="Button1" type="button"  runat="server" class="btn-app" onserverclick="Button1_ServerClick"/> 
                    </td>
                </tr>
            </table>
            <script type="text/javascript">tdshowm("list");</script>
            </div>
            </div>
        </div>
    </form>
</body>
</html>
