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

$query=$db->query("Select id,kgtime,tzpoints,tznum,zjpl from {$web_dbtop}game16 where id=".intval($_GET["happyno"]));
if($rs=$db->fetch_array($query)){
	$kgqh=$rs["id"];
	$kgtime=$rs["kgtime"];
	$tzpoints=$rs["tzpoints"];
	$tznum=$rs["tznum"];
	$zjpl=$rs["zjpl"];
}
?>
<!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>开心16-游戏中心-<?=$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(2);
document.getElementById("qh_con2").getElementsByTagName('li')[2].className="current";
</script>
<DIV class="wrapper">
	<DIV class="page_content">
		<DIV class="webgame-info-title">
		  <UL>
			<LI class="current"><A href="happy.php">开心16首页</A></LI>
			<LI><A href="happyhelp.php">开心16规则</A></LI>
			<LI><A href="happymylist.php">我的投注记录</A></LI>
			<LI><A href="happymodel.php">投注模式编辑</A></LI>
			<LI><A href="happyautoset.php">自动投注</A></LI>
			<LI><A href="happydirection.php">开心16走势图</A></LI>
		  </UL>
		</DIV>
		<DIV class="webgame-info">
			<DIV class="webgame-info-tabs">		  
			  <table width="940" height="27" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="12"><img src="images/game2_03.jpg" width="12" height="27" /></td>
                  <td background="images/game2_04.jpg" class="font14">当前第
                      <?=$kgqh?>
                      期　<?=$web_moneyname?>总数:<font color="red">
                      <?=number_format($tzpoints)?>
                      </font>　总投注数:<font color="red">
                      <?=$tznum?>
                      注</font></td>
                  <td width="269" align="right" background="images/game2_04.jpg" class="font14">开奖时间:
                      <?=$kgtime?></td>
                  <td width="13"><img src="images/game2_06.jpg" width="13" height="27" /></td>
                </tr>
              </table>
			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="5"></td>
                </tr>
              </table>
			  <table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td bgcolor="#9F4F18"><table width="100%" border="0" cellpadding="0" cellspacing="1">
                      <tr>
                        <td width="250" height="28" align="center" background="images/happy16_40.jpg" bgcolor="#FFFFFF"  class="font-white">投注</td>
                        <td width="250" height="28" align="center" background="images/happy16_40.jpg" bgcolor="#FFFFFF"  class="font-white">赔率</td>
                        <td align="center" background="images/happy16_40.jpg" bgcolor="#FFFFFF"  class="font-white">您的投注结果</td>
                      </tr>
                      <?
						$zjplsz=explode("|",$zjpl);
						$query=$db->query("Select tznum,tzpoints from {$web_dbtop}game16_users_tz where NO=".intval($_GET["happyno"])." and uid=".intval($_COOKIE["usersid"])." Order by id desc");
						if($rs=$db->fetch_array($query)){
							$tznum=explode("|",$rs["tznum"]);
							$tzpoints_array=explode("|",$rs["tzpoints"]);
						}
						for($i = 0; $i < 16; $i ++){
							$tzpoints=0;
							for($y = 0; $y < count($tznum); $y++){
								if($tznum[$y]==($i+3)){
									$tzpoints=$tzpoints_array[$y];
								}
							}
					?>
                      <tr>
                        <td height="32" align="center" bgcolor="#FCF5E1" class="font-red font12game"><img src="images/happy/number_<?=$i+3?>.gif" /></td>
                        <td align="center" bgcolor="#FFFFFF" class="font12game"><?=$zjplsz[$i]?></td>
                        <td align="center" bgcolor="#FFFFFF" class="font12game"><?=number_format($tzpoints);?>
                            <img src="<?=$web_moneypic?>" /></td>
                      </tr>
                      <?
				  }
				  ?>
                  </table></td>
                </tr>
              </table>
			</DIV>
			<DIV class=cl></DIV>
		</DIV>
		<DIV class="area960-b h5px"></DIV>
	<!--Flink End-->
	<div class="blank10"></div>
	<!--Footer Start-->
<?php include_once("footer.php");?>
</DIV>