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

<!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/css.css" rel="stylesheet" type="text/css" />
    <script type="text/ecmascript" src="/js/md5.js"></script>

    <style type="text/css">
        .default {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;background: grey;}
        .weak {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;background: red;}
        .medium {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;background: orange;}
        .strong {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;background: blue;}
        .stronger {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;background: green;}
        .spana {display: inline-block;width: 70px;height: 30px;line-height: 30px;background: #ddd;text-align: center;margin: 4px 2px;}




    </style>
    <script type="text/javascript">
        window.onload = function(){

            var oInput = document.getElementById('tbEditPassword1');
            oInput.value = '';
            oInput.onkeyup = function(){
                //强度状态设为默认
                span0.className = span1.className = span2.className = span3.className = "default";
                var pwd = this.value;
                var result = 0;
                for(var i = 0, len = pwd.length; i < len; ++i){
                    result |= charType(pwd.charCodeAt(i));
                }

                var level = 0;
                //对result进行四次循环，计算其level
                for(var i = 0; i <= 4; i++){
                    if(result & 1){
                        level ++;
                    }
                    //右移一位
                    result = result >>> 1;
                }

                if(pwd.length >= 6){
                    switch (level) {
                        case 1:
                            span0.className = "weak";
                            break;
                        case 2:
                            span0.className = "medium";
                            span1.className = "medium";
                            break;
                        case 3:
                            span0.className = "strong";
                            span1.className = "strong";
                            span2.className = "strong";
                            break;
                        case 4:
                            span0.className = "stronger";
                            span1.className = "stronger";
                            span2.className = "stronger";
                            span3.className = "stronger";
                            break;
                    }
                }
            }
        }
        /*
            定义一个函数，对给定的数分为四类(判断密码类型)，返回十进制1，2，4，8
            数字 0001 -->1  48~57
            小写字母 0010 -->2  97~122
            大写字母 0100 -->4  65~90
            特殊 1000 --> 8 其它
        */
        function charType(num){
            if(num >= 48 && num <= 57){
                return 1;
            }
            if (num >= 97 && num <= 122) {
                return 2;
            }
            if (num >= 65 && num <= 90) {
                return 4;
            }
            return 8;
        }
    </script>
</head>
<body>
    <form id="fom" runat="server">
        <div id ="main-c-03-right" >
            <table cellpadding="0"; cellspacing ="0"; style =" width :100%;background-image: url('/css/images/right_top.png'); background-repeat :repeat-x" >
                <tr>
      <td class  ="main-c-03-right02-top">
                	   <!--这里添加页面标题 -->
                      	个人信息
                </td>
                </tr>
            </table>
            <div id="main-c-03-right02-main">
            
<!--栏目开始 -->
            <!--这里添加内容 -->

                     <table  style =" width :100%" border = "0"  cellpadding ="0" cellspacing ="0" >
                    <tr>
                    <td class =" td_rightnoborder " style ="width:100px">人员编号：</td>
                    <td class =" td_leftnoborder  ">
                               <asp:Label ID="lbEditLoginId" runat="server"></asp:Label>
                                                        </td>
                </tr>
                <tr>
                    <td class =" td_rightnoborder ">姓名：</td>
                    <td class ="td_leftnoborder ">
                        <asp:Label ID="lbEditName" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class =" td_rightnoborder">所属机构：</td>
                    <td class ="td_leftnoborder ">
                        <asp:Label ID="lbDepartment" runat="server"></asp:Label>
                    </td>
                </tr>

                         </table> 
<table  style =" width :100% ; margin-bottom :10px; margin-top :10px;" border = "0" cellpadding ="0" cellspacing ="0" >
      <tr>
                    <td class =" td_rightnoborder " style ="width:100px">登录名：</td>
                    <td class =" td_leftnoborder  ">
                                 <asp:TextBox ID="tbEditLoginName" runat="server" MaxLength="20" Width="130px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                            ControlToValidate="tbEditLoginName" Display="Dynamic" ErrorMessage="登录名不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                        ControlToValidate="tbEditLoginName" Display="Dynamic" 
                        ErrorMessage="请输入2-20个合法字符。" 
                        ValidationExpression="^[^%&gt;&lt;'&amp;*=!&quot;?]{2,20}$" 
                        ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                                                        </td>
                </tr>
    <tr>
                    <td class =" td_rightnoborder ">电话：</td>
                    <td class ="td_leftnoborder ">
                        <asp:TextBox ID="tbTel" runat="server" MaxLength="16"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" 
                            ControlToValidate="tbTel" Display="Dynamic" ErrorMessage="电话不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator15" 
                        runat="server" ControlToValidate="tbTel" Display="Dynamic" 
                        ErrorMessage="请输入正确的电话号码。" 
                        ValidationExpression="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" 
                        ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
    <tr>
                    <td class =" td_rightnoborder ">邮箱：</td>
                    <td class ="td_leftnoborder ">
<asp:TextBox ID="tbEditEmail" runat="server" 
                            MaxLength="100" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server" 
                            ControlToValidate="tbEditEmail" Display="Dynamic" ErrorMessage="邮箱不能为空。" 
                            ValidationGroup="Edit" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator14" 
                        runat="server" ControlToValidate="tbEditEmail" Display="Dynamic" 
                        ErrorMessage="请输入正确的邮箱。" 
                        ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*.[a-zA-Z0-9]{2,7}" 
                        ValidationGroup="Edit" ForeColor="Red"></asp:RegularExpressionValidator>
                    </td>
                </tr>
    <tr>
                    <td class =" td_rightnoborder ">&nbsp;</td>
                    <td class ="td_leftnoborder ">
                      <asp:Button ID="btEdit" runat="server" onclick="btEdit_Click" Text="提交修改" 
                            ValidationGroup="Edit" />   <asp:Label ID="lbEditId" runat="server" Visible="False"></asp:Label>
                      
                    </td>
                </tr>
    </table> 

   <table  style =" width :100%; margin-bottom :10px; margin-top :10px;" border = "0" cellpadding ="0" cellspacing ="0" >
                    <tr>
                    <td class =" td_rightnoborder " style ="width:100px">重置密码：</td>
                    <td class =" td_leftnoborder  ">
                            
                
                      </td>
                </tr>
                <tr>
                    <td class =" td_rightnoborder "> 原密码：</td>
                    <td class ="td_leftnoborder ">
                       <asp:TextBox ID="tbOldPassword" runat="server" onblur="cal0()" onfocus="c0()"
                           TextMode="Password"  Width="240px"></asp:TextBox>  
                    </td>
                </tr>

                <tr>
                    <td class =" td_rightnoborder">新密码：</td>
                    <td class ="td_leftnoborder ">
                  <asp:TextBox ID ='tbEditPassword1' runat="server" onblur="cal()" onfocus="c()"
                 TextMode="Password" name="tbEditPassword1" Width="240px"></asp:TextBox>  
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="tbEditPassword1" Display="Dynamic" ErrorMessage="请填写密码" ForeColor="Red" ValidationGroup="EditPassword"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="tbEditPassword1" Display="Dynamic" ErrorMessage="密码不合规范" ForeColor="Red" ValidationExpression="\w{6,50}" ValidationGroup="EditPassword"></asp:RegularExpressionValidator>
                             </td>
                </tr>
                       <tr>
                    <td class =" td_rightnoborder "> &nbsp;</td>
                    <td class ="td_leftnoborder ">
                 密码不少于6位，密码中小写字母、大写字母、数字和符号4类字符中至少有<asp:Label ID="lbPsdL" runat="server">1</asp:Label>类。   </td>
                </tr>
                <tr>
                    <td class =" td_rightnoborder">&nbsp;</td>
                    <td class ="td_leftnoborder ">
                          <div>  <span id="span0" class ="spana">弱</span><span id="span1"  class ="spana">中</span><span id="span2"  class ="spana">强</span><span id="span3"  class ="spana">极强</span>
</div>  </td>
                </tr>
           <tr>
                    <td class =" td_rightnoborder ">重复密码：</td>
                    <td class ="td_leftnoborder ">
             <asp:TextBox ID="tbEditPassword2" runat="server" onblur="cal2()" onfocus="c2()" 
                             Width="240px" TextMode="Password"></asp:TextBox> 
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="tbEditPassword2" Display="Dynamic" ErrorMessage="请再填一次密码" ForeColor="Red" ValidationGroup="EditPassword"></asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="tbEditPassword1" ControlToValidate="tbEditPassword2" Display="Dynamic" ErrorMessage="两次输入不一致" ForeColor="Red" ValidationGroup="EditPassword"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td class =" td_rightnoborder"></td>
                    <td class ="td_leftnoborder ">
                    <asp:Button ID="btEditPasswordOK" runat="server" Text="提交修改" onclick="btEditPasswordOK_Click" 
                              ValidationGroup="EditPassword" />
                 <asp:Label ID="lbPsdErr" runat="server" ForeColor ="Red" ></asp:Label>     
                    </td>
                </tr>
                         </table> 

<table  style =" width :100%; margin-bottom :10px; margin-top :10px;" border = "0" cellpadding ="0" cellspacing ="0"  runat ="server" id="tableWechatbind" visible ="false" >
                    <tr>
                    <td class =" td_rightnoborder " style ="width:100px">微信绑定：</td>
                    <td class =" td_leftnoborder  ">
                                    <div>  <asp:Label ID="lbWechatNote" runat="server"></asp:Label>       </div>
                          <table  style =" width :536px; height :256px" border = "0" class ="table " cellpadding ="0" cellspacing ="0"  runat ="server" id="tableWechat" visible ="false" >
                              <tr>
                                  <td style ="text-align :center ;vertical-align :middle ; width :268px;" class ="td_centernoborder "> 
                                      <asp:Image ID="Image2" runat="server" ImageUrl="~/share/wechat/weixin.jpg" />
                                      </td>
                                  <td style ="text-align :center ;vertical-align :middle; width :268px;" class ="td_centernoborder "> 
                                      <asp:Image ID="Image1" runat="server"/></td>
                              </tr>
                              <tr>
                                  <td style ="text-align :center ;vertical-align :middle ;" class ="td_centernoborder "> 
                                      扫码关注公众号</td>
                                  <td style ="text-align :center ;vertical-align :middle ;" class ="td_centernoborder "> 
                                      扫码绑定</td>
                              </tr>
                              <tr>
                                  <td style ="text-align :center ;vertical-align :middle ;" colspan="2" class ="td_centernoborder "> 

 <asp:Button ID="btWechat" runat="server" Text="刷新状态" OnClick="btWechat_Click" />
                                                        </td>
                              </tr></table> 

                                                        </td>
                </tr>
                             </table>

                
<table  style =" width :100%; margin-bottom :10px; margin-top :10px;" border = "0" cellpadding ="0" cellspacing ="0"  runat ="server" id="tableWechatLogin" visible ="false" >
                    <tr>
                    <td class =" td_rightnoborder " style ="width:100px">微信登录：</td>
                    <td class =" td_leftnoborder  ">
   <asp:Label ID="lbWechatLogin" runat="server">无</asp:Label>
                                                        </td>
                </tr>
                             </table>
<!--栏目结束 -->
              
                </div>
            </div>
        </form>
    </body>
</html>

<script type="text/javascript">  
    function cal() {
        document.getElementById("<%=lbPsdErr.ClientID%>").innerText = "";
        document.getElementById("btEditPasswordOK").removeAttribute("disabled");

        var t1 = document.getElementById("<%=tbEditPassword1.ClientID%>").value;
        if (t1.trim().length > 5) {
            var PsdL = document.getElementById("<%=lbPsdL.ClientID%>").innerText;
            switch (PsdL) {
                case 2:
                    if (span0.className == "weak") {
                        document.getElementById("<%=lbPsdErr.ClientID%>").innerText = "密码强度不够。";
                        document.getElementById("btEditPasswordOK").setAttribute("disabled", true);
                    }
                    break;
                case 3:
                    if (span0.className == "weak" || span0.className == "medium") {
                        document.getElementById("<%=lbPsdErr.ClientID%>").innerText = "密码强度不够。";
                        document.getElementById("btEditPasswordOK").setAttribute("disabled", true);
                    }
                    break;
                case 4:
                    if (span0.className == "weak" || span0.className == "medium" || span0.className == "stronger") {
                        document.getElementById("<%=lbPsdErr.ClientID%>").innerText = "密码强度不够。";
                        document.getElementById("btEditPasswordOK").setAttribute("disabled", true);
                    }
                    break;
            }
            document.getElementById("<%=tbEditPassword1.ClientID%>").value = hex_md5(t1);
        }
        else {
            document.getElementById("<%=lbPsdErr.ClientID%>").innerText = "密码不足6位。";
            document.getElementById("btEditPasswordOK").setAttribute("disabled", true);
        }
    }

</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;
        document.getElementById("<%=tbEditPassword2.ClientID%>").value = hex_md5(t1);
    }
</script>  
<script type="text/javascript">  
    function c2() {
        document.getElementById("<%=tbEditPassword2.ClientID%>").value ="";
    }
</script>  


<script type="text/javascript">  
    function cal0() {
        var t1 = document.getElementById("<%=tbOldPassword.ClientID%>").value;
        document.getElementById("<%=tbOldPassword.ClientID%>").value = hex_md5(t1);
    }
</script>  
<script type="text/javascript">  
    function c0() {
        document.getElementById("<%=tbOldPassword.ClientID%>").value ="";
    }
</script>  




