<?php
	
	if(!defined('VI_BASE')) {
		ob_clean();
		exit('Access Denied');
	}
	
	/////////////////////////////////
	
	if( $config["PAYMENT_MONEY"] ){

		//载入支付整合包
		require_once VI_ROOT.'module/payment/function.php';

		$trade = new Trade();
		$detail = $trade -> query( $_GET['trade'] );
		
		//更新状态
		if( $detail['defray'] && $detail['fid'] == $fid ){
			$sql="UPDATE `mod:value` SET state=1 WHERE fid=".$detail['fid']." and id=".$detail['sid']." and appid = '".$detail['appid']."'";
			System :: $db -> execute( $sql );
		}

	}
	
	//查询结果
	$smarty->assign("detail", $detail );
	
	//关闭数据库
	System :: connect();


?>