<!--{include file="<!--{$mpath}-->block_header.tpl"}-->
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<header class="mui-bar mui-bar-nav report-header box-s" id="header">
    <a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
    <p>修改密码</p>
</header>
<div id="main" class="mui-clearfix">
    <div class="mpsw clearfloat box-s">
        <form action="" method="post">
            <input type="password" name="oldpwd" id="oldpwd" value="" placeholder="请输入原密码" />
            <input type="password" name="newpwd" id="" value="" placeholder="请输入新密码" />
            <input type="password" name="aginpwd" id="" value="" placeholder="请再次输入新密码" />
        </form>
    </div>
    <div class="psw-btn clearfloat">
        <a href="javascript:void(0)"  id="edit_btn" style="float:left;display:inline; margin-left: 27%;">修改密码</a>
    </div>
</div>
</body>
<script type="text/javascript" src="<!--{$mpath}-->js/jquery-1.8.3.min.js" ></script>
<script src="<!--{$mpath}-->layer_mobile/layer.js"></script>
<script src="<!--{$mpath}-->js/fastclick.js"></script>
<script src="<!--{$mpath}-->js/mui.min.js"></script>
<script type="text/javascript" src="<!--{$mpath}-->js/hmt.js" ></script>
<script>
    $(function(){
        $("#edit_btn").bind("click", function(){ //提交
            $oldpwd=$("[name=oldpwd]").val();
            $newpwd=$("[name=newpwd]").val();
            $aginpwd=$("[name=aginpwd]").val();
            $.ajax({
                type: "POST",
                url: "index.php?c=user&a=ajaxeditpwd",
                cache: false,
                data: {oldpwd:$oldpwd,newpwd:$newpwd,aginpwd:$aginpwd},
                dataType: "json",
                success: function(data) {
                    var json = eval(data);
                    var response = json.response;
                    var result = json.result;
                    if (response == '1') {
                        layer.open({
                            content: result
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        setTimeout( function(){
                            location.reload();
                            layer.close(index);
                        }, 1 * 1000 );//延迟5000毫米
                    } else {
                        layer.open({
                            content: result
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                    }
                },
            });
        });

    });
</script>
</html>
