<%@ Page Language="C#" AutoEventWireup="true" Inherits="Web.inherits.UserViewPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户资料修改-<%=WebSiteConfig.SiteTitle%></title>
    <link href="<%path:%>Css/common.css" rel="stylesheet" />
    <link href="<%path:%>Css/user.css" rel="stylesheet" />
    <script src="/Js/jquery-1.8.2.min.js"></script>
    <script src="/Js/data.js"></script> 
    <script src="/Js/bx.library.js"></script>
    <script src="<%path:%>js/web.js"></script>
</head>
<body>
    <!--head-->
    <%template:_head.html%>
    <!--body-->
    <div class="body main">
        <div class="split">&nbsp;</div>
        <div class="usercenter">
            <div class="left"><%template:_usermenu.html%></div>
            <div class="right">
                <div class="content">
                    <div class="title">
                        <h3>资料修改 <span class="note">(<span class="nonullalert">*</span>为必须填写项)</span></h3>
                    </div>
                    <table class="infoform">
                        <tr>
                            <td class="itemtitle">用户名：</td>
                            <td class="itemcontent"><%=UserIdentity.Account%></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;请输入旧密码：</td>
                            <td class="itemcontent">
                                <input class="text" id="txtOldPassword" type="password" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;请输入新密码：</td>
                            <td>
                                <input class="text" id="txtNewPassword" type="password" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="itemtitle"><span class="nonullalert">*</span>&nbsp;再次输入密码：</td>
                            <td class="itemcontent">
                                <input class="text" id="txtRepeatNewPassword" type="password" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <input id="Button1" onclick="update();" type="button" value="完成修改" /></td>
                            <td>&nbsp;</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--foot-->
    <%template:_foot.html%>
    <script type="text/javascript">
    function update() {
        var oldpwd = document.getElementById("txtOldPassword").value;
        var newpwd = document.getElementById("txtNewPassword").value;
        if (oldpwd == "" || newpwd == "") {
            Alert("请输入新旧密码");
            return;
        }
        if (newpwd != document.getElementById("txtRepeatNewPassword").value) {
            Alert("两次密码不一致");
            return;
        }
        User.updatePassword({ "cmd": "updatepassword", "oldpassword": oldpwd, "newpassword": newpwd }, function (result) {
            if (result != null && result.status == "success") {
                Alert("已完成修改");
            }
            else {
                Alert("修改失败,请检查密码是否正确");
            }
        });
    }
    </script>

</body>
</html>
