<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

include_once( "inc/conn.php" );
include_once( "inc/function.php" );
login_check( );
$intpage = 30;
if ( isset( $_GET['page'] ) )
{
		$rsnum = ( intval( $_GET['page'] ) - 1 ) * $intpage;
}
else
{
		$rsnum = 0;
}
if ( $_GET['minNO'] && $_GET['maxNO'] )
{
		$sql = "Select ".$web_dbtop."game11.id,{$web_dbtop}game11.kgtime,{$web_dbtop}game11.kgjg,{$web_dbtop}game11.zjpl,{$web_dbtop}game11.kj,{$web_dbtop}game11_users_tz.hdpoints,{$web_dbtop}game11_users_tz.points from {$web_dbtop}game11,{$web_dbtop}game11_users_tz where {$web_dbtop}game11.id={$web_dbtop}game11_users_tz.NO and {$web_dbtop}game11_users_tz.uid=".intval( $_COOKIE['usersid'] ).( " and ".$web_dbtop."game11.id>=" ).intval( $_GET['minNO'] ).( " and ".$web_dbtop."game11.id<=" ).intval( $_GET['maxNO'] ).( " and kj=1 Order by ".$web_dbtop."game11.id desc" );
}
else
{
		$sql = "Select ".$web_dbtop."game11.id,{$web_dbtop}game11.kgtime,{$web_dbtop}game11.kgjg,{$web_dbtop}game11.zjpl,{$web_dbtop}game11.kj,{$web_dbtop}game11_users_tz.hdpoints,{$web_dbtop}game11_users_tz.points from {$web_dbtop}game11,{$web_dbtop}game11_users_tz where {$web_dbtop}game11.id={$web_dbtop}game11_users_tz.NO and {$web_dbtop}game11_users_tz.uid=".intval( $_COOKIE['usersid'] ).( " and kj=1 Order by ".$web_dbtop."game11.id desc" );
}
$query = $db->query( $sql );
if ( $rs = $db->fetch_array( $query ) )
{
		$maxid = $rs['id'];
		$intnum = $db->num_rows( $query );
}
if ( $_GET['minNO'] && $_GET['maxNO'] )
{
		$query = $db->query( "Select min(".$web_dbtop."game11.id) as id,sum({$web_dbtop}game11_users_tz.hdpoints) as hdpoints,sum({$web_dbtop}game11_users_tz.points) as tzpoints from {$web_dbtop}game11,{$web_dbtop}game11_users_tz where {$web_dbtop}game11.id={$web_dbtop}game11_users_tz.NO and uid=".intval( $_COOKIE['usersid'] ).( " and ".$web_dbtop."game11.id>=" ).intval( $_GET['minNO'] ).( " and ".$web_dbtop."game11.id<=" ).intval( $_GET['maxNO'] ) );
}
else
{
		$query = $db->query( "Select min(".$web_dbtop."game11.id) as id,sum({$web_dbtop}game11_users_tz.hdpoints) as hdpoints,sum({$web_dbtop}game11_users_tz.points) as tzpoints from {$web_dbtop}game11,{$web_dbtop}game11_users_tz where {$web_dbtop}game11.id={$web_dbtop}game11_users_tz.NO and uid=".intval( $_COOKIE['usersid'] ) );
}
if ( $rs = $db->fetch_array( $query ) )
{
		$minid = $rs['id'];
		$tzpoints = $rs['tzpoints'];
		$sumpoints = $rs['hdpoints'];
}
if ( $_GET['minNO'] && $_GET['maxNO'] )
{
		$minid = $_GET['minNO'];
		$maxid = $_GET['maxNO'];
}
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n<HTML xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>欢乐11-游戏中心-";
echo $web_name;
echo "</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n<meta name=\"keywords\" content=\"";
echo $web_keywords;
echo "\" />\r\n<meta name=\"description\" content=\"";
echo $web_description;
echo "\" />\r\n<META http-equiv=X-UA-Compatible content=IE=EmulateIE7>\r\n<link href=\"style/default.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n</head>\r\n";
include_once( "top.php" );
echo "<script language=\"javascript\">\r\nqiehuan(2);\r\ndocument.getElementById(\"qh_con2\").getElementsByTagName('li')[4].className=\"current\";</script>\r\n<DIV class=\"wrapper\">\r\n\t<DIV class=\"page_content\">\r\n\t\t<DIV class=\"webgame-info-title\">\r\n\t\t  <UL>\r\n\t\t\t<LI><A href=\"joyous.php\">欢乐11首页</A></LI>\r\n\t\t\t<LI><A href=\"joyoushelp.php\">欢乐11规则</A></LI>\r\n\t\t\t<LI class=\"current\"><A href=\"joyousmylist.php\">我的投注记录</A></LI>\r\n\t\t\t<LI><A href=\"joyousmodel.php\">投注模式编辑</A></LI>\r\n\t\t\t<LI><A href=\"joyousautoset.php\">自动投注</A></LI>\r\n\t\t\t<LI><A href=\"joyousdirection.php\">欢乐11走势图</A></LI>\r\n\t\t  </UL>\r\n\t\t</DIV>\r\n\t\t<DIV class=\"webgame-info\">\r\n\t\t\t<DIV class=\"webgame-info-tabs\">\t\t  \r\n\t\t\t  <table width=\"940\" height=\"27\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n                <tr>\r\n                  <td width=\"12\"><img src=\"images/game2_03.jpg\" width=\"12\" height=\"27\" /></td>\r\n                  <td background=\"images/game2_04.jpg\" class=\"font14\">我的投注记录:</td>\r\n                  <td width=\"13\"><img src=\"images/game2_06.jpg\" width=\"13\" height=\"27\" /></td>\r\n                </tr>\r\n              </table>\r\n\t\t\t  <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n                <tr>\r\n                  <td height=\"5\"></td>\r\n                </tr>\r\n              </table>\r\n\t\t\t  <table width=\"940\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n                <form action=\"?\" method=\"get\">\r\n                  <tr>\r\n                    <td colspan=\"9\"> 投注期数：\r\n                        <input name=\"minNO\" type=\"text\" size=\"20\" maxlength=\"10\" value=\"";
echo $minid;
echo "\"/>\r\n        至\r\n        <input name=\"maxNO\" type=\"text\" size=\"20\" maxlength=\"10\" value=\"";
echo $maxid;
echo "\" />\r\n        <input type=\"submit\" name=\"btnSearch\" value=\"查询\" />\r\n                    </td>\r\n                  </tr>\r\n                </form>\r\n                <tr>\r\n                  <td colspan=\"9\" height=\"30\"> 从\r\n                      ";
echo $minid;
echo "      期 至\r\n      ";
echo $maxid;
echo "      期已开奖期数中，你共投注\r\n      ";
echo $tzpoints;
echo "      ";
echo $web_moneyname;
echo "，中奖\r\n      ";
echo $sumpoints;
echo "      ";
echo $web_moneyname;
echo "，共盈利（亏损）\r\n      ";
echo $sumpoints - $tzpoints;
echo "      ";
echo $web_moneyname;
echo "，盈亏比为\r\n      ";
echo $sumpoints ? number_format( $sumpoints / $tzpoints * 100, 2 ) : "00.00";
echo "      %。 </td>\r\n                </tr>\r\n  <td bgcolor=\"#FFB91F\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">\r\n        <tr>\r\n          <td width=\"80\" height=\"28\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">期号</td>\r\n          <td width=\"130\" height=\"28\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">投注时间</td>\r\n          <td align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">开奖结果</td>\r\n          <td width=\"100\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">投入";
echo $web_moneyname;
echo "</td>\r\n          <td width=\"100\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">获得";
echo $web_moneyname;
echo "</td>\r\n          <td width=\"80\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">赔率</td>\r\n          <td width=\"80\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">盈亏比例</td>\r\n          <td width=\"60\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">详细</td>\r\n          <td width=\"100\" align=\"center\" background=\"images/joyousbj.jpg\" bgcolor=\"#FFFFFF\" class=\"font-white\">保存为投注模式</td>\r\n        </tr>\r\n        ";
$query = $db->query( $sql.( " limit ".$rsnum.",{$intpage}" ) );
while ( $rs = $db->fetch_array( $query ) )
{
		$kgh = explode( "|", $rs['kgjg'] );
		$zjpl = explode( "|", $rs['zjpl'] );
		echo "        <tr>\r\n          <td height=\"32\" align=\"center\" bgcolor=\"#FFFAC7\" class=\"font12game\">";
		echo $rs['id'];
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo $rs['kgtime'];
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo "<img src=\"images/joyous/number_".$kgh[2].".gif\" />";
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo number_format( $rs['points'] );
		echo "              <img src=\"";
		echo $web_moneypic;
		echo "\" /></td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo number_format( $rs['hdpoints'] )."<img src=\"".$web_moneypic."\" />";
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo $zjpl[$kgh[2] - 2];
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\" class=\"font12game\">";
		echo number_format( $rs['hdpoints'] / $rs['points'] * 100, 2 )."%";
		echo "</td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"joyousmydetail.php?joyousno=";
		echo $rs['id'];
		echo "\">查看</a></td>\r\n          <td align=\"center\" bgcolor=\"#FFFFFF\"><a href=\"joyousmodelsave.php?joyousno=";
		echo $rs['id'];
		echo "\">保存</a></td>\r\n        </tr>\r\n        ";
}
echo "    </table></td>\r\n  </tr>\r\n              </table>\r\n\t\t\t  <table width=\"940\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"4\">\r\n                <tr>\r\n                  <td align=\"center\">";
include_once( "inc/page_class.php" );
$page = new page( array(
		"total" => $intnum,
		"perpage" => $intpage
) );
echo $page->show( 5, "", "" );
echo "</td>\r\n                </tr>\r\n              </table>\r\n\t\t\t</DIV>\r\n\t\t\t<DIV class=cl></DIV>\r\n\t\t</DIV>\r\n\t\t<DIV class=\"area960-b h5px\"></DIV>\r\n\t<!--Flink End-->\r\n\t<div class=\"blank10\"></div>\r\n\t<!--Footer Start-->\r\n";
include_once( "footer.php" );
echo "</DIV>";
?>
