<?php
session_start();
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>
<? include_once("top.php");?>
<DIV class="wrapper">
	<DIV class="page_content">
		<!--主体左边 Start-->
		<DIV class="area690 fl">
			<DIV class="area340 fl">
				<DIV class="area340-t h5px"></DIV>
				<DIV class="area340-info">
				<?=flashslide("318","190");?>
				</DIV>
				<DIV class="area340-b h5px"></DIV>
			</DIV>
			<DIV class="area340 fr">
				<DIV class="area340-t h5px"></DIV>
				<DIV class="area340-info">
					<UL class="focus-list">
						<?
						$i=0;
						$query=$db->query("Select * from {$web_dbtop}news Order by top desc,id desc limit 5");
						while($rs=$db->fetch_array($query)){
						$i++;
							if($i==1){
						?>
						<LI class="focus">
							<H6><A title="<?=$rs["title"]?>" href="news_content.php?id=<?=$rs["id"]?>"><?=$rs["title"]?></A></H6>
							<SPAN><?=cnsubstr($rs["content"],50)?></SPAN> 
						</LI>
						<?
							}else{
						?>
						<LI><A title="<?=$rs["title"]?>"！ href="news_content.php?id=<?=$rs["id"]?>"><?=$rs["title"]?></A></LI>
						<?
							}
						}
						?>
					</UL>
				</DIV>
				<DIV class="area340-b h5px"></DIV>
			</DIV>
		</DIV>
		<!--主体左边 End-->
	
		<!--主体右边 Start-->
		<DIV class="area260 fr">
			<DIV class="news-title">
				<H3>会员登陆</H3>
			</DIV>
			<DIV class="area260-info">
				<UL class="news-list">
					<?php
					  $query=$db->query("Select * From {$web_dbtop}users where id=".intval($_COOKIE["usersid"])." and password='".str_check($_COOKIE["password"])."'");
					  if($rs=$db->fetch_array($query)){
					 ?>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="login">
						<tr>
							<td width="70" height="26">用户ID：</td>
							<td><span class=rf><?=$rs["id"]?></span> <?=($rs["vip"]==1?"<img src=\"".$web_dir."images/vip.gif\" alt=\"到期时间:".date("Y-m-d",strtotime($rs["vipdate"]."+1 day"))."\" />":"")?></td>
						</tr>
						<tr>
							<td height="26"><?=$web_moneyname?>：</td>
							<td><span class=rf><?=number_format($rs["points"])?></span><IMG height=10 src="<?=$web_moneypic?>" width=10 border=0></td>
						</tr>
						<tr>
							<td height="26">银行：</td>
							<td><span class=rf><?=number_format($rs["back"])?></span><IMG height=10 src="<?=$web_moneypic?>" width=10 border=0></td>
						</tr>
						<tr>
							<td height="26">经验值：</td>
							<td><span class=rf><?=number_format($rs["experience"])?></span></td>
						</tr>
						<tr>
							<td height="26">新消息：</td>
							<td><A href="usersms.php"><span <?=(msg_num(0)!=0?"class=rf":"")?>>新短消息(<?=msg_num(0)?>)</span></A></td>
						</tr>
						<tr align="center">
						  <td height="25" colspan="2"><a href="login.php?act=logout"><img src="images/dc03.gif" border="0"></a></td>
						</tr>
				 </table>
					<?
					}else{
					?>
					<form name='form' method='post' action='login.php?act=login'>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="login">
						<tr>
							<td width="70" height="26">登陆方式：</td>
							<td><INPUT id="rLoginID" type="radio" CHECKED value="1" name="tbLoginType"> 
							  ID 
							  <INPUT id="rLoginMail" type="radio" value="2" name="tbLoginType"> 
						    E-mail</td>
						</tr>
						<tr>
							<td height="26">用户名：</td>
							<td><input  name="tbUserAccount" type="text" id="tbUserAccount"  class="inpl" /></td>
						</tr>
						<tr>
							<td height="26">密&nbsp;&nbsp;&nbsp;码：</td>
							<td><input  name="tbUserPwd" type="password" id="tbUserPwd" class="inpl" /></td>
						</tr>
						<tr>
							<td height="26">验证码：</td>
							<td><input name="tbSafeCode" type="text" class="inp_yz" id="tbSafeCode" style="text-transform: uppercase" maxlength="4" />  <img id="vdimgck" src="inc/code.php" alt="看不清？点击更换" width="60" height="22" style="cursor:pointer" onclick="this.src=this.src+'?'" /></td>
						</tr>
						<tr align="center">
							<td height="26" colspan="2"><INPUT type=radio value=1 name="tbKeep">
							  永久
							    <INPUT type=radio value=24 name="tbKeep">
							    24小时
							    <INPUT type=radio CHECKED value=0 name="tbKeep">
						    退出失效</td>
						</tr>
						<tr align="center">
						  <td height="25" colspan="2"><input name="登陆" type="submit" class="but" value=""> 
						  <input name="注册" type="button" class="butreg" onclick=window.location="reg.php"> <a href="resetpassword.php">忘记密码</a></td>
						</tr>
				 </table>
			      </form>
					<?
					  }
					 ?>
				</UL>
			</DIV>
			<DIV class="area260-b h5px"></DIV>
		</DIV>
		<!--主体右边 End-->
		<DIV class=blank10></DIV>
		<DIV class="area690 fl">
			<DIV class="newshome-mmtitle">
				<SPAN><A href="prizes.php">更多&raquo;</A></SPAN>
				<H3>推荐奖品</H3>
			</DIV>
			<UL class="newshome-mmlist">
				<?
				$query=$db->query("Select * from {$web_dbtop}commodities where tj=1 Order by id desc limit 10");
				while($rs=$db->fetch_array($query)){
				?>
				<LI><A title="<?=$rs["name"]?>" href="prizes_content.php?id=<?=$rs["id"]?>"><IMG alt="<?=$rs["name"]?>" src="<?=$web_picdir.$rs["pic"]?>"><SPAN style="COLOR: #ff0000"><?=$rs["name"]?></SPAN></A></LI>
				<?
				}
				?>
			</UL>
			<DIV class="area690-b h5px"></DIV>
		</DIV>
		<DIV class="area260 fr">
			<DIV class="news-title">
				<H3>最新兑奖</H3>
			</DIV>
			<DIV class="area260-info">
				<ul class="kf-title">
					<li>时间</li>
					<li>奖品名称</li>
					<li>用户</li>
				</ul>
				<ul class="kf-list">
					<?
					$query=$db->query("Select * from {$web_dbtop}exchange Order by id desc limit 6");
					while($rs=$db->fetch_array($query)){
					?>
					<li><span><?=date("m-d",strtotime($rs["time"]))?></span><span style="text-align:center;"><a href="prizes_content.php?id=<?=$rs["commoditiesid"]?>"><?=showcontent("commodities","name",$rs["commoditiesid"])?></A></span><span style="text-align:right;"><A href="user.php?id=<?=$rs["uid"]?>"><?=$rs["uid"]?></A></span></li>
					<?
					}
					?>
				</ul>
			</DIV>
			<DIV class="area260-b h5px"></DIV>
		</DIV>
				<DIV class=blank10></DIV>
		<DIV class="area690 fl">
			<DIV class="area340 fl">
				<DIV class="newshome_tabs">
					<H3>最新活动</H3>
				</DIV>
				<DIV class="area340-info">
					<UL class="news-list">
						<?
						$i=0;
						$query=$db->query("Select * from {$web_dbtop}activities Order by id desc");
						while($rs=$db->fetch_array($query)){
						$i++;
							if($i==1){
						?>
						<LI class="photo"><a href="<?=$rs["url"]?>"><img src="<?=$web_webdir.$web_activitiesdir.$rs["pic"]?>" width="270" height="80" border="0" /></a></LI>
						<?
							}else{
						?>
						<LI><A title="<?=$rs["name"]?>" href="<?=$rs["url"]?>"><?=$rs["name"]?></A></LI>
						<?
							}
						}
						?>
					</UL>
				</DIV>
				<DIV class="area340-b h5px"></DIV>
			</DIV>
			<DIV class="area340 fr">
				<DIV class="newshome_tabs">
					<H3>新手帮助</H3>
				</DIV>
				<DIV class="area340-info">
					<UL class="help-list">
						<?
						$i=0;
						$query=$db->query("Select * from {$web_dbtop}help Order by top desc,id desc limit 12");
						while($rs=$db->fetch_array($query)){
						?>
						<LI><A title="<?=$rs["title"]?>" href="help_content.php?id=<?=$rs["id"]?>"><?=$rs["title"]?></A></LI>
						<?
						}
						?>
					</UL>
				</DIV>
				<DIV class="area340-b h5px"></DIV>
			</DIV>
		</DIV>
		
		<DIV class="area260 fr">
			<DIV class="news-title">
				<H3>论坛热帖</H3>
			</DIV>
			<DIV class="area260-info">
				<UL class="news-list">
					<?
					$query=$db->query("Select * from {$web_dbtop}bbs_posts Order by dj desc,id desc limit 6");
					while($rs=$db->fetch_array($query)){
					?>
					<LI><A title="<?=$rs["title"]?>" href="<?=$web_dir?>bbs/read.php?forumsid=<?=$rs["section"]?>&threadsid=<?=$rs["id"]?>" target=_blank><?=$rs["title"]?></A></LI>
					<?
					}
					?>
				</UL>
			</DIV>
			<DIV class="area260-b h5px"></DIV>
		</DIV>
	</DIV>
	<div class="blank10"></div>
	<div id="flink" class="clearfix">
		<div class="flink-h h5px"></div>
		<div class="flink-info">
			<div class="photo">
				<h6>合作商家</h6>
				<ul>
					<?
					$query=$db->query("Select * from {$web_dbtop}link Order by sort asc,id desc");
					while($rs=$db->fetch_array($query)){
					?>
					<li><a href='<?=$rs["weburl"]?>' target='_blank'><?=$rs["webname"]?></a></li>
					<?
					}
					?>
				</ul>
			</div>
		</div>
		<div class="flink-b h5px"></div>
	</div>
	<!--Flink End-->
	<div class="blank10"></div>
	<!--Footer Start-->
<? include_once("footer.php");?>
</DIV>