
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>IndexEN</title>
    <script src="~/Content/layui/layui.js"></script>
    <script src="~/Content/jquery-1.8.3.js"></script>
    <link href="~/Content/layui/css/layui.css" rel="stylesheet" />
    <style type="text/css">
        ._TianChong {
            clear: both;
            height: 5px;
        }
    </style>
    <script type="text/javascript">
        layui.use(['layer'], function () {
            var layer = layui.layer;
            $("#btn_Save").click(function () {
                var oldpwd = $("#txt_oldpwd").val();
                var newpwd = $("#txt_newpwd").val();
                var chongpwd = $("#txt_QDnewpwd").val();
                if (oldpwd == "" || newpwd == "" || chongpwd == "") {
                    layer.alert("Password is not allowed to be empty");
                    return;
                }
                if (newpwd != chongpwd) {
                    layer.alert("Confirm passwords are inconsistent");
                    return;
                }
                $.post("/UpdatePassWord/UpdatePwdEN", { OldPwd: oldpwd, NewPwd: newpwd }, function (result) {
                    layer.alert(result.split(':')[1]);
                    if (result.split(':')[0] == "0") {
                        //var index = parent.layer.getFrameIndex(window.name)
                        //parent.layer.close(index);
                    }
                });
            });
            $("#txt_oldpwd").blur(function () {
                var oldpwd = $("#txt_oldpwd").val();
                if (oldpwd == "") {
                    layer.tips('Can not be empty', '#txt_oldpwd');
                }
            });
            $("#txt_newpwd").blur(function () {
                var newpwd = $("#txt_newpwd").val();
                if (newpwd == "") {
                    layer.tips('Can not be empty', '#txt_newpwd');
                }
            });
            $("#txt_QDnewpwd").blur(function () {
                var newpwd = $("#txt_newpwd").val();
                var chongpwd = $("#txt_QDnewpwd").val();
                if (newpwd != chongpwd) {
                    layer.tips('Inconsistent passwords', '#txt_QDnewpwd');
                }
            });
        });
    </script>
</head>
<body>
    <div class="layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-form-item">
                    <div class="_TianChong"></div>
                    <div class="_TianChong"></div>
                    <div class="_TianChong"></div>
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 120px;">Current Password</label>
                        <div class="layui-input-inline" style="width: auto;">
                            <input type="password" name="cid" id="txt_oldpwd" runat="server" placeholder="please enter" autocomplete="off" class="layui-input" />
                        </div>
                    </div>

                    <div>
                        <label class="layui-form-label" style="width: 120px;">New Password</label>
                        <div class="layui-input-inline" style="width: auto;">
                            <input type="password" name="cid" id="txt_newpwd" runat="server" placeholder="please enter" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="_TianChong"></div>
                    <div>
                        <label class="layui-form-label" style="width: 120px;">Confirm Password</label>
                        <div class="layui-input-inline" style="width: auto;">
                            <input type="password" name="cid" id="txt_QDnewpwd" runat="server" placeholder="please enter" autocomplete="off" class="layui-input" />
                        </div>
                    </div>
                    <div class="_TianChong" style="height:10px;"></div>
                    <div>
                        <label class="layui-form-label" style="width: 120px;"></label>
                        <div class="layui-input-inline" style="width: auto;">
                            <input id="btn_Save" type="button" value="Save" class="layui-btn layuiadmin-btn-comm" style="width:180px;" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
