<?php
  error_reporting(E_ALL^E_WARNING^E_NOTICE);
  $uid = $_SESSION["userid"];  
  if($uid!=''){
		$sql2 = "select count(*) as won_count from `won_auctions` a where a.userid=$uid and a.`won_date`>= DATE_SUB(now(), INTERVAL 28 DAY) ";
  	$res2 = mysql_query($sql2);
  	$obj2 = mysql_fetch_object($res2);
		$won_count = $obj2->won_count;		
  }
  if($won_count>8)$won_count=8;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$AllPageTitle;?></title>
<link href="style/css/index.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="jquery.js"></script>
<script language="javascript" src="effect.js"></script>
<script language="javascript" src="default.js"></script>
<script language="javascript" src="jqModal.js"></script>
  <script language="javascript">
	function _delete_login_fields(_field, _default, _current) {
	  if (_default == _current) {
		_field.value='';
	  }
	}
  </script>

</head>
<body>
<div id="top">
	<div class="top-wrap">
		
		<? if($_SESSION["userid"]==""){ ?>
		<div class="subnav1">
		<a href="login.html">用户登录</a> | <a href="simreg.html">免费注册</a>
		</div>
		<div class="subnav2">
			<a href="article_11.html">放心承诺</a>|<a href="article_15.html">意见反馈</a>|<a href="faq.html">帮助中心</a>
		</div>

		<? } else { ?>
		<div >
			<a href="myaccount.html">我的拍客</a>
			<?=$lng_welcome;?>&nbsp;<font color=blue><?=getUserName($_SESSION["userid"]);?></font>&nbsp;<span>|</span>&nbsp;<?=stripslashes($lng_availablebids);?> : <span id="bids_count" style="color: #000000"><?=GetUserFinalBids($_SESSION["userid"]);?></span>&nbsp;&nbsp;|&nbsp;&nbsp;已中标<font color=red><?=$won_count;?> </font>次 / 28天内还有<font color=red><?=8-$won_count;?></font> 次机会 &nbsp;&nbsp;|&nbsp;&nbsp;<a href="logout.html"><font color=blue><?=stripslashes($lng_logout);?></font></a>
			</div>
				<? } ?>			
		
		
		<div class="clear"></div>
	</div>
</div>

<div id="header">
	<div class="logo"><a href=""><img src="style/images/logo.gif" /></a></div>
	<div class="trends">
		<ul>
<?php
$qrycount = "select w.id,r.username,w.won_date,p.name,a.auc_final_price,p.price,(100-100*a.auc_final_price/p.price) as discount,a.auctionID from won_auctions w left join auction a on w.auction_id=a.auctionID left join products p on a.productID=p.productID inner join registration r on w.userid = r.id where w.userid>=0 order by w.won_date DESC, id DESC limit 0,6 ";
$rescount = mysql_query($qrycount);
while($obj1 = mysql_fetch_array($rescount)) { 
?>
<li><a href="#<?=$linkurl . $obj1['id'];?>">恭喜<?=$obj1["username"];?> 以 ￥<?=$obj1["auc_final_price"];?>  赢得了 <?=$obj1["name"];?></a></li>
<?php
}
?>
		</ul>
	</div>
	<div class="clear"></div>
</div>

<div id="nav">
	<ul>
		<li ><a href="index.html">网站首页</a></li>		 
		<li ><a href="experience-index.html">新用户体验</a></li>		 
		<li ><a href="show_index.html">网友晒单</a></li>		 
		<li ><a href="article_16.html">在线客服</a></li>		 
		<li><a href="announce-index.html">网站公告</a></li>		 
		<li><a href="faq.html">帮助中心</a></li>		 
		<li ><a href="article_14.html">联系我们</a></li>		 
		<li ><a href="article_13.html">关于我们</a></li>
	</ul>
</div>
<input type="hidden" id="appPath" value="/" />
<script src="js/hp.js" type="text/javascript"></script>

<script type="text/javascript" src="js/o_code.js"></script>
<input type="hidden" id="qahp" value="qahp" />

</body>
</html>