<?
require("../login_session.php");

mysql_connect("140.117.74.200", "db_09", "db_09") or die("<a href='index.php'>無法連結主機</a>");
mysql_select_db("db_09") or die("<a href='index.php'>無法連結資料庫</a>");
@mysql_query("SET CHARACTER SET UTF8");

$gId = $_GET['gameId'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>BTFM - 確認付款</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link rel="stylesheet" href="../style/btfm_beta.css" type="text/css" />
</head>

<body>

<div id="roll">
	<div id="header">
		<h1><a href="../index.php">BTFM&nbsp;</a></h1>
		<div class="desc">線上遊戲金幣購買系統</div>
		
		<ul class="topmenu">
		<li><a href="../index.php">首頁</a></li>
		<li><a href="../readme.php">使用說明</a></li>
		<li><a href="../order.php">線上購幣</a></li>
		<li><a href="../register/time.php">會員註冊</a></li>
		<? if(!$_SESSION['login']){	?>
		<li><a href="../login/test5.php">會員登入</a></li>
		<? }else{	?>
		<li><a href="../login/logout.php">會員登出</a></li>
		<? }	?>
		<li class="alt"><a href="../check/data.php">確認付款</a></li>
		<li class="admin"><a href="../index.php">有刺勿近</a></li>
		</ul>
		
	</div>
	<div id="chest">
		
		<div class="leftmenu">
			<ul>
<?
$sql = mysql_query("select * from `game` where 1");
while( list( $id, $gName ) = mysql_fetch_row( $sql ) ){
?>
			<li<? echo ($gId==$id)?" class=\"alt\"":"";?>><a href="../order.php?gameId=<? echo $id; ?>"><? echo $gName; ?></a></li>
<?
	if($gId==$id){
		$game = $gName;
	}
}
?>
			</ul>
		</div>
		
		<div class="content">
<? 
$tTime = $_GET['tTime'];
$sql = "select * from transaction where tTime = '$tTime' ";
$query = mysql_query($sql);
$row = mysql_fetch_object($query);
$sId = $row->sId;

$sql2 = "select * from virtualclerk where sId = '$sId' limit 1";
$query2 = mysql_query($sql2);
$row2 = mysql_fetch_object($query2);

$sql3 = "update transaction set isDone = '1' where tTime = '$tTime'";
$query3 = mysql_query($sql3);

$query4 = mysql_query("select * from server where sId = '$sId' limit 1");
$row4 = mysql_fetch_object($query4);
$gId = $row4->gId;

$query5 = mysql_query("select * from game where id = '$gId' limit 1");
$row5 = mysql_fetch_object($query5);

?>
        <h3>已完成交易手續！</h3>
		
		<hr />
		<p>交易明細:</p>
		<table style="border: 1px solid #999; width: 100%" border="1" >
			<tr>
				<td>領幣人物:<br />(為您的遊戲暱稱)</td>
				<td><? echo $row->gNickname; ?></td>
			</tr>
			<tr>
				<td>發幣人員:<br />(為我方人員的遊戲暱稱)</td>
				<td><? echo $row2->vname; ?></td>
			</tr>
			<tr>
				<td>領幣地點:</td>
				<td>請至遊戲 <strong><? echo $row5->gName;?></strong> 中的 <strong><? echo $row4->sName;?></strong> 伺服器</td>
			</tr>
		</table>
		<p>*請使用您登記的領幣人物登入遊戲，到指定的伺服器後，使用密語聯絡我們的發幣人員。</p>
		<p>如有任何問題，歡迎聯絡我們的線上客服 林刺刺(nigel0828@hotmail.com - 24小時MSN在線)</p>
		<p>謝謝您的購買！</p>
		
	</div>
	
</div>

</body>
</html>