<?php
require_once("../check.php");
require_once("../../config.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>修改密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="../js/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="../style/template.css" />
<style>
input.text{
    width: 300px;height:30px;
}
</style>
</head>
<body>
<script>
$(function(){
    $("#form").click(function(){
        var pass1 = $("#pass1").val();
        var pass2 = $("#pass2").val();
        var pass3 = $("#pass3").val();
        if(pass1==""){
            $(".ts").text("请输入您的原始密码！");
            return false;
        }
        if(pass2==""){
            $(".ts").text("请输入新密码!");
            return false;
        }
        if(pass2!=pass3){
            $(".ts").text("两次新密码不一致,请重新输入!");
            return false;
        }
        $.post("password_2.php",{
            pass1:pass1,
            pass2:pass2,
            pass3:pass3
        },function(a,b){
          if(a=="ok"){
        $("#form").attr("disabled",true);
        $(".ts").text("修改成功!");
        return false;
          }
        if(a=="error"){
        $(".ts").text("原密码有误!");
        return false;
          }
          
          
        });
        
    });
   
});
</script>

<div id="table">
<div class="W100">原始密码</div><div class="W350"><input class="text" type="text" id="pass1" /></div>
</div>
<div id="table">
<div class="W100">设置密码</div><div class="W350"><input class="text" type="text" id="pass2" /></div>
</div>
<div id="table">
<div class="W100">重复密码</div><div class="W350"><input class="text" type="text" id="pass3" /></div>
</div>
<div id="table">
<div class="W100"> </div><div class="W350"><input class="text" type="button" id="form" value="修改密码" /></div>
</div>
<div id="table">
<div class="W100"> </div><div class="W350 ts"></div>
</div>




</body>
</html>