<?php
require(dirname(__FILE__)."/"."global.php");

if($action=='money2card')
{
	if(!$lfjuid){
		showerr("請先登錄");
	}
	if(!is_numeric($atc_moneycard))
	{
		showerr("請輸入一個正整數");
	}

	$atc_moneycard=intval($atc_moneycard);

	if($atc_moneycard<1)
	{
		showerr("你輸入的數字必須大于0");
	}
	elseif($atc_moneycard>$lfjdb[moneycard])
	{
		showerr("你輸入的數值不能大于你本身的金幣數");
	}
	$db->query("UPDATE {$pre}memberdata SET moneycard=moneycard-'$atc_moneycard' WHERE uid='$lfjuid'");
	add_user($lfjuid,$atc_moneycard*$webdb[MoneyRatio]);
	refreshto("$FROMURL","恭喜你,兌換succeed",1);
}


$lfjdb && $lfjdb[money]=get_money($lfjdb[uid]);

$query = $db->query("SELECT * FROM {$pre}jfsort ORDER BY list");
while($rs = $db->fetch_array($query)){
	$fnameDB[$rs[fid]]=$rs[name];
	$query2 = $db->query("SELECT * FROM {$pre}jfabout WHERE fid='$rs[fid]' ORDER BY list");
	while($rs2 = $db->fetch_array($query2)){
		eval("\$rs2[title]=\"$rs2[title]\";");
		eval("\$rs2[content]=\"$rs2[content]\";");
		$jfDB[$rs[fid]][]=$rs2;
	}
}

require(PHP168_PATH."inc/head.php");
require(html("jf"));
require(PHP168_PATH."inc/foot.php");

?>