<?php
/*************************************************************\
+-------------------------------------------------------------+
| 通灵佛教网在线烧香程序 System                                 |
| Copyright (c) 2003-2010 Alfred China                        |
| All rights reserved.                                        |
+-------------------------------------------------------------+
\*************************************************************/
require_once('chk.php');
require_once('netgou.php');
$uid = intval($uid);

if($mode == "update"){

	$uppasswd = '';
	if($passwd != ''){
		$crypted = md5($passwd);
		$uppasswd = "password = '$crypted', ";
	}
	db_query("UPDATE $sql_tbl[users] SET $uppasswd email = '$email', hxname = '$hxname', hxage = '$hxage', hxsex = '$hxsex', hxaddress = '$hxaddress', hxgd = '$hxgd', msnqq = '$msnqq' WHERE uid = '$uid'");
	
	showmsg("资料修改成功","user.php?uid=$uid");

}

$userinfo = ng_query_first("SELECT $sql_tbl[users].* FROM $sql_tbl[users] WHERE uid = '$uid'");
$userinfo['regdtm'] = get_datetime($userinfo['regdtm']);
$userinfo['logindtm'] = get_datetime($userinfo['logindtm']);

$ng_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
$ng_obstart ? $ng_gzip="Gzip enabled":$ng_gzip="Gzip disabled";

require_once PrintTemp('user');
require_once "./footer.php";

$output=str_replace(array('<!--<!--<!---->','<!--<!---->','<!---->'),array('','',''),ob_get_contents());
ob_end_clean();
echo $output;
flush;
exit;
?>