<?php include("sql/conn.php"); 
session_start(); 

$result = mysql_query("SELECT * FROM webyxlb WHERE id='".$_GET['id']."'");
while($row = mysql_fetch_array($result))
{
$flname = $row['name'];
}
///$flname = $flname."私服|";
$flname = $flname."|";

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><?php 
echo $flname;
include("adm/all/gjz.txt"); ?> 网页游戏</title>
<meta name="description" content="<?php 
echo $flname;
include("adm/all/description.txt"); ?> 网页游戏" />
<meta name="keywords" content="<?php 
echo $flname;
include("adm/all/gjz.txt"); ?> 网页游戏" />
<link  href="css/css<?php include("adm/all/css.txt"); ?>.css" rel="stylesheet" type="text/css">
</head>


<?php
////////////////////////////////////////////////////////////////////////
$file = fopen("adm/tm.txt", "r") or exit("Unable to open file!");
while(!feof($file))
  {
$hang = fgets($file);
$res=explode("%%",$hang,20);
  }/////获得表格表头
///////////////////////////////////////////////////////////////////////////
?>



<body >


<div id="top">
<?php include("user.php");  ?>
</div>
<?php include("gh.php");  ?>

<div align="center">
<?php include("logo.php");  ?>


<div id="dh" ><?php 
 if(file_exists("dh1.php"))
 {
include("dh1.php"); 
 }
 else
 {
include("action/dh1.php"); 
 }
?></div>



</div>

<?php //////////////////////广告时间到期，自动删除//////
$iipp = $_SERVER["REMOTE_ADDR"];
$noww = time();

$result = mysql_query("SELECT * FROM webk");
while($row = mysql_fetch_array($result))
  {
$zltime = $row['ks'] + $row['long1'];///、//发布时间加上延续时间
$timec = time(); /////、、、、、、、、、、//算出当前时间
             if ($zltime<$timec)
			 {
			 mysql_query("DELETE FROM webk WHERE id='".$row['id']."'");////删除动作
			 mysql_query("INSERT INTO text (name, time, ip, ing, f) 
			 VALUES ('".$row['bz']."', '".$noww."', '".$iipp."', '到期下架[".$row['name']."]', '0')");
			 }
  }
///////////////////////广告时间到期，自动删除////////  ?>


<div class="clear"></div>


<?php 
 if(file_exists("top.php"))
 {
include("top.php"); 
 }
 else
 {
include("action/top.php"); 
 }
?>


<div class="clear"></div>


<div align="center">
<div id="nr">



<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>




<?php
include("han2.php");
////////////////////////显示当前时间的函数
function gtime($tt)
  {
$hour = substr(date("H:i:s",$tt),0,2);
$hour=(int)$hour; 
$dl = array('【通宵推荐】','【通宵推荐】','【通宵推荐】','凌晨3点整','凌晨4点整','早晨5点整','早晨6点整','早晨7点整','上午8点整','上午9点整','上午10点整','中午11点整','中午12点整','下午13点整','下午14点整','下午15点整','下午16点整','晚上17点整','晚上18点整','晚上19点整','晚上20点整','晚上21点整','晚上22点整','【通宵推荐】');
$tt = date("m月d日",$tt).$dl[$hour];
return $tt;
  }
/////////////////////////


echo "<TABLE class=webtd id=table ><TBODY>";


$result = mysql_query("SELECT * FROM webyxlb WHERE id='".$_GET['id']."'");
while($row = mysql_fetch_array($result))
{
echo "<tr><td colspan=1><img src=webfl/".$row['id'].".jpg alt=天天PK".$row['name']." onerror=\"this.src='webfl/err.jpg'\"  ></td>";
echo "<td colspan=7 align=left class=qzhh >　　".$row['js']."<p align=right><strong>";
include("adm/all/gjz.txt"); 
echo "</strong></p></td></tr>";
$flname = $row['name'];
}


echo "<TR class=tabletop height=29 >";
echo "<TD width=121>╠".$res[1]."╣</td>";
echo "<TD width=141>╠".$res[2]."╣</td>";
echo "<TD width=136>╠".$res[3]."╣</td>";
echo "<TD width=96>╠".$res[4]."╣</td>";
echo "<TD width=96>╠".$res[5]."╣</td>";
echo "<TD >╠".$res[6]."╣</td>";
echo "<TD width=68>╠开始╣</td>";
echo "<TD >-</td></TR>";





$result = mysql_query("SELECT * FROM webk WHERE bz <> 'adm' and name = '".$flname."' order by rand()");
while($row = mysql_fetch_array($result))
  {

if($row['ks'] < time())
{
echo "<TR class=webtd";
echo ">";

$name = z_f($row['name']);
$ip = z_f($row['ip']);
$time = z_f($row['time']);
$len = z_f($row['len']);
$js = z_f($row['js']);
$kf = z_f($row['kf']);

echo "<TD class=webtd><div id=webip>".$ip . "</div></div></td>";
echo "<TD class=webtd><a href=go.php?id=".$row['id']. " title=".$row['name']."  target=_blank  >".$name . "</a></td>";
if ($time=="")
   {
   echo "<TD class=webtd>".gtime(time()). "</td>";
   }
   else
   {
echo "<TD class=webtd>".gtime($time). "</td>";//////时间经过格式化
   }
echo "<TD class=webtd ><a href=go.php?id=".$row['id']. " target=_blank  >".$len . "</a></td>";
echo "<TD class=webtd><div id=sfkf >".$kf . "</div></td>";
/////////////////////////////////////////////////////专属礼包/////////
echo "<TD class=webtd><div id=sfjs >";

	 $result6 = mysql_query("SELECT * FROM key1 where idid ='".$row['idid']."' and number <> '' LIMIT 0,1");
	 if (mysql_num_rows($result6) != 0)//检查库里是否有这个用户名
	 {
	    while($row6 = mysql_fetch_array($result6))
   	      {
		  $jlid=$row6['id'];
		  }
	 
	 echo "<a href=weblb_".$jlid.".html target=_blank ><img  title=专属礼包 src=img/lb.gif /></a>";
	 }

echo $js . "</div></td>";
///////////////////////////////////////////////////专属礼包///////////
echo "<TD class=webtd><a href=go.php?id=".$row['id']. "  target=_blank  >立即开始</a></td>";
$zltime = $row['ks'] + $row['long1'];///、//发布时间加上延续时间
$timec = time(); /////、、、、、、、、、、//算出当前时间
$zltime = $zltime - $timec;///////、、、、//相差，算出剩下多少时间！
$zltime = (int)($zltime/3600);

echo "<TD>";

if($row['zt']=="2")
{
echo "<img src=img/top.gif />";
}
elseif($row['zt']=="6")
{
echo "<img src=img/sf.gif />";
}
else
{
echo "<img src=img/im.gif />";
}


echo "</td>";

echo "</TR>";
}

  }

/////echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"; ///空上一行 
  
$timejia = 0;
$result = mysql_query("SELECT * FROM webk WHERE bz = 'adm' and name = '".$flname."' order by rand()");
while($row = mysql_fetch_array($result))
  {

echo "<TR class=webtd";

echo ">";

$name = z_f($row['name']);
$ip = z_f($row['ip']);
$time = z_f($row['time']);
$len = z_f($row['len']);
$js = z_f($row['js']);
$kf = z_f($row['kf']);


$timejia = $timejia + 168;
echo "<TD class=webtd >".$ip . "</div></td>";
echo "<TD class=webtd><a href=go.php?id=".$row['id']. "  target=_blank  >".$name . "</a></td>";
if ($time=="")
   {
   echo "<TD class=webtd>".gtime(time()). "</td>";
   }
   else
   {
   echo "<TD class=webtd>".$time . "</td>";
   }
echo "<TD class=webtd ><a href=go.php?id=".$row['id']. "  target=_blank  >".$len . "</a></td>";
echo "<TD class=webtd>".$kf . "</td>";
echo "<TD class=webtd><div id=sfjs >".$js . "</div></td>";
echo "<TD class=webtd><a href=go.php?id=".$row['id']. "  target=_blank  >立即开始</a></td>";
echo "<TD class=webtd>精</td>";

echo "</TR>";
  }


echo "<tr><td colspan=8>";
include("ad/ad1.txt");
echo "</td></tr>";
  
echo "</TBODY></TABLE>";
?> 



<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>




</div></div>

<div class="clear"></div>

<div align="center"><div id="nr">


<div class="RoundedCorner">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<div id="nr2">



<?php 
 if(file_exists("12.php"))
 {
include("12.php"); 
 }
 else
 {
include("action/12.php"); 
 }
?>



</div>
<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b></b>
</div>


</div></div>


<div class="clear"></div>


<script type="text/javascript">
var $ = function(a, b){a = document.getElementById(a);return b ? a.getElementsByTagName(b) : a;} 
var trs = $("table", "TR");
for(var i=0,len = trs.length;i<len;i++){
 trs[i].onmouseover = function(){
  this.className = "current";
 }
 trs[i].onmouseout = function(){
  this.className = "";
 }
}
</script>


<?php
/////////////////// 上边的SCRIPT是经过表格发生变化的东东
 ?>

<?php 
 if(file_exists("foot.php"))
 {
include("foot.php"); 
 }
 else
 {
include("action/foot.php"); 
 }
?>

</body>


<?php include("sql/close.php"); ?>

