<?php
header("content-type:text/html;charset=utf-8");
session_start();
error_reporting(0);
if(!isset($_SESSION['admin_name'])){
   exit; 
}
date_default_timezone_set("PRC");
include "../sql.php";
$id=$_POST['xg_tixian_hid'];
$xg_tixian_username=$_POST['xg_tixian_username'];
$xg_tixian_zonger=$_POST['xg_tixian_zonger'];
$xg_tixian_jiner=$_POST['xg_tixian_jiner'];
$xg_tixian_yuer=$_POST['xg_tixian_yuer'];
$xg_tixian_shenhe=$_POST['xg_tixian_shenhe'];
$xg_tixian_zhifu=$_POST['xg_tixian_zhifu'];
$user_sql="select id from user where username='{$xg_tixian_username}'";
$row=mysql_fetch_assoc(mysql_query($user_sql));
    $sql="update tixian_shenhe set uid='{$row['id']}',zonger='{$xg_tixian_zonger}',tixianjiner='{$xg_tixian_jiner}',tixian_yuer='{$xg_tixian_yuer}',shifoutongguo='{$xg_tixian_shenhe}',shifouzhifu='{$xg_tixian_zhifu}',time=".time()." where id='{$id}'";
   if(mysql_query($sql)){
       echo "<script>alert('修改成功！');location='../index.php';</script>";
   }else{
        echo "<script>alert('修改失败！')；history.back();</script>";
   }

?>