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

$query=$db->query("Select * from {$web_dbtop}game28_auto where uid=".intval($_COOKIE["usersid"])." Order by id desc");
if($rs=$db->fetch_array($query)){
	$id=$rs["id"];
	$startNO=$rs["startNO"];
	$endNO=$rs["endNO"];
	$minG=$rs["minG"];
	$maxG=$rs["maxG"];
	$autoid=$rs["autoid"];
}else{
	echo "<script language=javascript>alert('对不起，您是不是进错地方了！');location.href='luck.php';</script>";
	exit;
}
$query=$db->query("Select * from {$web_dbtop}game28_auto_tz where id=".$autoid." Order by id asc");
if($rs=$db->fetch_array($query)){
	$tzname=$rs["tzname"];
	$tzunm=explode("|",$rs["tzunm"]);
	$tzpoints=$rs["tzpoints"];
}

if($_GET["act"] =="endStart"){
	$db->query("delete from {$web_dbtop}game28_auto where id=".$id);
	echo "<script language=javascript>alert('取消自动投注成功！');location.href='luckautoset.php';</script>";
	exit;
}
?>
<!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>幸运28-游戏中心-<?=$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')[0].className="current";
</script>
<DIV class="wrapper">
	<DIV class="page_content">
		<DIV class="webgame-info-title">
		  <UL>
			<LI><A href="luck.php">幸运28首页</A></LI>
			<LI><A href="luckhelp.php">幸运28规则</A></LI>
			<LI><A href="luckmylist.php">我的投注记录</A></LI>
			<LI><A href="luckmodel.php">投注模式编辑</A></LI>
			<LI class="current"><A href="luckautoset.php">自动投注</A></LI>
			<LI><A href="luckdirection.php">幸运28走势图</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 b">自动投注设置：</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>
			<form action="?act=endStart" method="post">
            <table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#248301"><table width="100%" border="0" cellpadding="0" cellspacing="1">
                    <tr>
                      <td colspan="4" bgcolor="#FFFFFF" class="font12">&nbsp;&nbsp;自动投注起止期数为<font class="rbf"><?=$startNO?></font>期------<font class="rbf"><?=$endNO?></font>期<br />
                      &nbsp;&nbsp;当账户<?=$web_moneyname?>小于<font class="rbf"><?=$minG?></font><?=$web_moneyname?>时或者大于<font class="rbf"><?=$maxG?></font>停止自动投注<br />
                      &nbsp;&nbsp;您使用的投注模式为<font class="rbf"><?=$tzname?></font>，每期投注的<?=$web_moneyname?>数为<font class="rbf"><?=$tzpoints?></font>！</td>
                    </tr>
                    <tr>
                      <td width="50%" height="28" align="center" background="images/310-bj.jpg" bgcolor="#FFFFFF" class="wf">投注结果</td>
                      <td align="center" background="images/310-bj.jpg" bgcolor="#FFFFFF" class="wf">投注<?=$web_moneyname?>数</td>
                    </tr>
					<?
					for($i = 0; $i < count($tzunm); $i ++){
					?>
					 <tr>
						<td height="32" align="center" bgcolor="#E6F7E0"><img src="images/luck/number_<?=$i?>.gif" /></td>
						<td align="center" bgcolor="#FFFFFF"><?=$tzunm[$i]?><img src="<?=$web_moneypic?>" /></td>
					  </tr>
					 <?
					 }
					 ?>
                  	<tr>
                      <td height="40" colspan="4" align="center" bgcolor="#FFFFFF"><input type="submit" id="btnSubmit" name="btnCancel" class="btnCancelInvest pointer" value=" " /></td>
                    </tr>
				 </table></td>
              </tr>
            </table>
			</form>
		  </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>