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

<!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 include("adm/all/gjz.txt"); ?>网页游戏</title>
<meta name="description" content="<?php include("adm/all/description.txt"); ?>网页游戏" />
<meta name="keywords" content="<?php include("adm/all/gjz.txt"); ?>网页游戏" />
<link  href="css/css<?php include("adm/all/css.txt"); ?>.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--

#webyxm8 {
	float:left;
	border: 1px solid #CCCCCC;
	text-align: center;
	margin: 2px;
	padding-top: 3px;
	overflow: hidden;
	text-align: center;
	white-space:nowrap;
	height: 108px;
	width: 226px;
}

#dh27 {
	width: 958px;
	overflow: hidden;

}
#dh28 {
	width: 700px;
	overflow: hidden;
	float: right;
	border-left-width: 1px;
	border-left-style: solid;
	border-left-color: #00FFFF;
}
#dh29 {
	width: 243px;
	overflow: hidden;
	float: left;
	white-space:nowrap;
}

-->
</style>

</head>



<?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);
return $tt;
  }
/////////////////////////




$result = mysql_query("select distinct name from webk");
while($row = mysql_fetch_array($result))
  {
               	 $result1 = mysql_query("SELECT * FROM webyxlb where name ='".$row['name']."'");
	           	  if (mysql_num_rows($result1) != 0)//检查库里是否有这个用户名
	           	  {/////echo "有了不加了！";
	           	  }
				  else
				  {
				  mysql_query("INSERT INTO webyxlb (name) VALUES ('".$row['name']."')");
				  }//////////$yxm = $row['name'];
  }  
/////////////////////////以上循环是指，游戏存在于列表中，就提出名字，没有则添加/////////
?>

<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 order by rand() DESC LIMIT 0,30");
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>

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

<div id="dh29">
<table>
<tr bgcolor=#E8F0F8 >
  <td><?php echo $res[3]; ?></td>
  <td><?php echo $res[2]; ?></td>
  <td><?php echo $res[4]; ?></td>
  <td><?php echo $res[5]; ?></td>
</tr>
<tr><td colspan=4 ><hr></td></tr>

<?php
$result = mysql_query("SELECT * FROM webk order by rand() DESC LIMIT 0,33");
while($row = mysql_fetch_array($result))////广告只取随机前39条
  {
$name = z_f($row['name']);
$name = mysubstr($name,0,8); 
$time = z_f($row['time']);
$len = z_f($row['len']);
$len = mysubstr($len,0,8); 

echo "<tr>";
if ($time=="")
   {
   echo "<td>".gtime(time()). "　</td>";
   }
   else
   {
   echo "<td>".gtime($time) . "　</td>";
   }

             $result3 = mysql_query("SELECT * FROM webyxlb where name = '".$row['name']."' ");
			 while($row3 = mysql_fetch_array($result3))
            {
			$flid = $row3['id'];
			}

echo "<td><a href=webfl-".$flid.".html title=更多[".$row['name']."]天天PK提供  target=_blank >".$row['name']."</a></td>";

echo "<td><a href=go.php?id=".$row['id']. " title=天天PK马上开始[".$row['name']."]游戏 target=_blank  >".$len;
echo "</a></td>";
echo "<td>".$row['kf']."　</td>";
echo "<tr><td colspan=4><hr></td></tr>";
echo "</tr>";
  }
?>
</table>


</div>



<div id="dh28">
<?php
////$result8 = mysql_query("select distinct name from webk WHERE bz <> 'adm' order by rand() limit 0,8");
$result8 = mysql_query("select distinct name from webk order by rand() limit 0,18");
while($row8 = mysql_fetch_array($result8))
{
/////////////////////////////////////////////////////
$result = mysql_query("SELECT * FROM webk WHERE name = '".$row8['name']."' order by rand() limit 0,1");
while($row = mysql_fetch_array($result))
{
echo "<div id=webyxm8 >";
echo "<table><tr>";


             $result3 = mysql_query("SELECT * FROM webyxlb where name = '".$row['name']."' ");
			 while($row3 = mysql_fetch_array($result3))
            {
			$flid = $row3['id'];
		      if($row3['yx'] >=30)
			  {
echo "<td rowspan=3><img  width=110 height=80 src=webfl/".$row3['id'].".jpg onerror=\"this.src='webfl/err.jpg'\" alt=".$row['name'];
echo "天天PK ></td><td align=left >名称：";
			  echo "<img title=火  src=img/h.gif />";
			  }
			  else
			  {
echo "<td rowspan=3><img  width=110 height=80 src=webfl/".$row3['id'].".jpg onerror=\"this.src='webfl/err.jpg'\" alt=".$row['name'];
echo "天天PK ></td><td align=left >名称：";
			  }
            }
echo $row['name']. "</td></tr>";
echo "<tr><td align=left >类别：".$row['ip']."</td></tr>";
echo "<tr><td align=left >状态：火爆开启</td></tr>";

echo "<tr><td><a href=webfl-".$flid.".html title=更多[".$row['name']."]天天PK提供  target=_blank  >".$row['name']. "-列表</a></td>";
echo "<td><a href=go.php?id=".$row['id']. " title=天天PK马上开始[".$row['name']."]游戏 target=_blank  >开始[".$row['name']."]</a></td>";

echo "</tr></table>";
echo "</div>";
}
////////////////////////////////////////////////////
}

?>
</div>


</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>




<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>













<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"); ?>

