<?php
include_once("inc/conn.php");
include_once("inc/function.php");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>兑奖排行-<?=$web_name;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="<?=$web_keywords;?>" />
<meta name="description" content="<?=$web_description;?>" />
<META http-equiv=X-UA-Compatible content=IE=EmulateIE7>
<link href="style/default.css" rel="stylesheet" type="text/css" />
</head>
<?php include_once("top.php");?>
<script language="javascript">
qiehuan(4);
document.getElementById("qh_con4").getElementsByTagName('li')[4].className="current";
</script>
<DIV class="wrapper">
	<DIV class="page_content">
		<!--主体左边 Start-->
		<div class="area690 fl">
			<div class="table690 h5px"></div>
					<table class="ng_tab" width="100%" cellpadding="0" cellspacing="0">
					<thead>
						  <th width="10%" align="center" height="30">名次</th>
						    <th width="24%" align="center">用户ID</th>
						    <th width="15%" align="center">兑奖次数</th>
						    <th align="center">兑奖总<?=$web_moneyname?>数</th>
							<th width="15%" align="center">详情</th>
					</thead>
					<tbody>
					<?
					$intpage = 20;
					if (isset($_GET['page'])) {
						$rsnum = (intval($_GET['page']) -1)*$intpage;
					}else{
						$rsnum = 0;
					}
					$i=$rsnum;
					$sql="Select * from {$web_dbtop}users where djcs>0 Order by djpoints desc";
					$query=$db->query($sql);
					if($db->fetch_array($query)) 
						$intnum=$db->num_rows($query);
					$query=$db->query($sql." limit $rsnum,$intpage");
					while($rs=$db->fetch_array($query)){
					$i++;
					?>
					<tr>
						<td><?=$i?></td>
						<td><A href="user.php?id=<?=$rs["id"]?>" target="_blank"><?=$rs["id"]?><?=($rs["vip"]==1?"<IMG src=\"images/vip.gif\">":"")?></A></td>
						<td><?=$rs["djcs"]?></td>
						<td><?=number_format($rs["djpoints"])?><IMG src="<?=$web_moneypic?>" align=absMiddle></td>
						<td><A href="prizes_rank_u.php?id=<?=$rs["id"]?>">查看</A></td>
					</tr>
					<?
					}
					?>
					</tbody>
					</table>
					<div class="area690-b h5px"></div>	
					<div class="pages" style="text-align:center;">
					<?php
					include_once("inc/page_class.php");
					$page=new page(array('total'=>$intnum,'perpage'=>$intpage));
					echo $page->show(5,"","");?>
					</div>
		</div>
		<!--主体左边 End-->
  		<!--主体右边 Start-->
    	<div class="area260 fr">
			<DIV class="webgame-title2">
				 <H3>栏目导航</H3>
			</DIV>
			 <UL class="area260-info list">
				<?
				$query=$db->query("Select * from {$web_dbtop}ctype where typeid=0 Order by sort asc,id desc");
				while($rs=$db->fetch_array($query)){
				?>
				<LI>
					<h3><?=$rs["name"];?></h3>
					<?
						$query_f=$db->query("Select * from {$web_dbtop}ctype where typeid=".$rs["id"]." Order by sort asc,id desc");
						while($rs_f=$db->fetch_array($query_f)){
							echo"<A href=\"prizes_list.php?id=".$rs_f["id"]."\">".$rs_f["name"]."</A>\r\n";
						}
						?>
				</LI>
				<?
				}
				?>
			 </UL>
			 <DIV class="area260-b h5px"></DIV>
			 <DIV class=blank10></DIV>
		</div>
	</DIV>
	<!--Flink End-->
	<div class="blank10"></div>
	<!--Footer Start-->
<?php include_once("footer.php");?>
</DIV>