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



$result = mysql_query("SELECT * FROM key1 WHERE id='".$_GET['id']."'");
while($row = mysql_fetch_array($result))
{
$flname = $row['name'];
$idid = $row['idid'];
}

$result = mysql_query("SELECT * FROM key1 where idid ='".$idid."' and number <> '' ");
$lbsl = mysql_num_rows($result);/////检查库里礼包数量


?>


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

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



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



<style type="text/css">
#ff{
	width: 378px;
	overflow: visible;
	word-wrap: break-word;
	word-break: normal;
	background-color: #FF6666;
}

</style>



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


<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 ><TBODY>";


$result = mysql_query("SELECT * FROM webyxlb WHERE name='".$flname."'");
while($row = mysql_fetch_array($result))
{
echo "<tr><td colspan=8>";


echo "<table><tr><td><img src=webfl/".$row['id'].".jpg alt=天天PK".$row['name']." ></td>";
echo "<td class=qzhh >　　".$row['js']."<p align=right><strong>";
include("adm/all/gjz.txt"); 
echo "</strong></p>";
echo "</td></tr></table>";


echo "</td></tr>";
$flname = $row['name'];
}


echo "<TR bgcolor=#E8F0F8 height=2><TD colspan=8 ></td></TR>";

echo "<TR >";
echo "<TD colspan=5 width=560 align=left style=font-size:16px >";
echo "<h2 align=center>礼包领取</h2><hr>";
$result = mysql_query("SELECT * FROM key1 WHERE id='".$_GET['id']."'");
while($row = mysql_fetch_array($result))
{
echo "<p>　游戏名称：".$row['name']."</p>";
echo "<p>　运 营 商：".$row['kf']."</p>";
echo "<p>　服务器名：".$row['len']."　　[<a href=gojl.php?id=".$row['id']." target=_blank >开始游戏</a>]</p>";
$tim = $row['time1']+ $row['life'];
$date3=date('Y-m-d H:i:s',$tim);
echo "<p>　下架日期：".$date3."</p>";
echo "<div id=ff ><p>　使用方法：".$row['ff']."</p></div>";
echo "<p>　礼包库存：<img  title=专属礼包 src=img/lb.gif />".$lbsl."/100";

if($lbsl>0)
{
   if($_SESSION['jf']<$_SESSION['qf'])
   {
echo "　<a title=领取专属礼包 >领取[积分不足]</a>　";
   }
   else
   {
echo "　<a href=weblb2.php?id=".$idid." title=领取专属礼包";
  ?> onClick="return confirm('确定之后，礼包KEY在下边的文本框内，复制出来即可！？')" <?php
echo" >领取</a>　";
   }

}
else
{
echo "　<a title=专属礼包都被领取走了 >米有了</a>　";
}

echo "</p>";
}
echo "<hr>";
echo "<p>　礼包KEY：<textarea cols=26 rows=2 id=content >".$_SESSION['keynumber']."</textarea>";
echo "<a onclick=jsCopy() >复制</a></p>";
echo "<p>　您现有积分".$_SESSION['jf'] ."，奖励码需要扣". $_SESSION['qf']."分。如果积分不够可以与客服联系或<a href=qd.php title=签到>签到</a>。</p>";
echo "</td>";

echo "<TD colspan=3 width=400 align=center>";
include("ad/ad2.txt");
echo "</td></TR>";


echo "<TR bgcolor=#E8F0F8 height=2><TD colspan=8 ></td></TR>";
echo "<td colspan=8>";
include("ad/ad1.txt");
echo "</td>";
  
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>

<script type="text/javascript"> 
    function jsCopy(){ 
        var e=document.getElementById("content");//对象是content 
        e.select(); //选择对象 
        document.execCommand("Copy"); //执行浏览器复制命令 
    } 
</script> 


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


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

</body>


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

