<?php
require_once("../check.php");
require_once("../../config.php");
$usersql = "select * from dunling_user where username='$username'";
$userery = mysql_query($usersql,$config);
$user = mysql_fetch_array($userery);

?>
<!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 qq = $("#qq").val();
        var pay1 = $("#pay1").val();
        var pay2 = $("#pay2").val();
        var pay3 = $("#pay3").val();
        
        if(pay1==""){
            $(".ts").text("请输入您的收款银行【建议使用支付宝】");
            return false;
        }
        if(pay2==""){
            $(".ts").text("请正确填写收款账号!");
            return false;
        }
        if(pay3==""){
            $(".ts").text("请填写收款人的姓名!");
            return false;
        }
        $.post("ziliao_2.php",{
            qq:qq,
            pay1:pay1,
            pay2:pay2,
            pay3:pay3
        },function(a,b){
          if(a=="ok"){
        $("#form").attr("disabled",true);
        $(".ts").html("<span style='color:red'>修改成功!</span>");
        return false;
          }else{
        $(".ts").text("系统出错!");
        return false;
          }
          
          
        });
        
    });
   
});
</script>

<div id="table">
<div class="W100">我的账号:</div><div class="W350"><?php echo $username;?></div>
</div>
<div id="table">
<div class="W100">QQ号码:</div><div class="W350"><input class="text" value="<?php echo $user['qq'];?>" type="text" id="qq" /></div>
</div>

<div id="table">
<div class="W100">收款银行:</div><div class="W350"><input class="text" value="<?php echo $user['pay1'];?>" type="text" id="pay1" /></div><div class="W350">建议使用支付宝</div>
</div>

<div id="table">
<div class="W100">收款账号:</div><div class="W350"><input class="text" value="<?php echo $user['pay2'];?>" type="text" id="pay2" /></div>
</div>

<div id="table">
<div class="W100">收款姓名:</div><div class="W350"><input class="text" value="<?php echo $user['pay3'];?>" type="text" id="pay3" /></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>