znumber_check.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:14k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("../inc/conn.php");
- include("check.php");
- include("configs.inc.php");
- include("other_close.php");
- $user=$_SESSION["user"];
- $drop_date=$_SESSION["downdate"];
- $open_date=$_SESSION["opendate"];
- $open_date=str_replace("-","",$open_date);
- $plate=$_SESSION["plate"];
- $agent=$_SESSION["agent"];
- $all_agent=$_SESSION["all_agent"];
- $super_agent=$_SESSION["super_agent"];
- $sqlm=mysql_query("select * from member_cut where user_account='$user' and sign='5'",$conn);
- $minrmb=$drop_lows;
- $znumber="正码";
- $units=mysql_result($sqlm,0,"unit_limit");
- $maxrmb=mysql_result($sqlm,0,"pour_limit");
- ?>
- <link href="../css/css2.CSS" rel="stylesheet" type="text/css">
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <style type="text/css">
- <!--
- body {
- margin-left: 10px;
- margin-top: 5px;
- }
- .style1 {font-weight: bold}
- -->
- </style>
- <?php
- include("../inc/cut.inc.php");
- if(isset($_GET["act"]))
- {
- if(isset($_POST["drop_number_t"]))
- {
- $rcount=$_POST["rcount"];
- $leave=$_SESSION["credit"]-$_SESSION["used"];
- if($leave<$rcount)
- {
- echo "<script language='javascript'> alert('您的信用余额不够本次下注!');window.location.href='znumber.php'</script>";
- }else
- {
- $drop_number_t=$_POST["drop_number_t"];
- $drop_type_t=$_POST["drop_type_t"];
- $drop_rate_t=$_POST["drop_rate_t"];
- $drop_money_t=$_POST["drop_money_t"];
- $a_t=split(",",$drop_number_t);
- $c_t=split(",",$drop_rate_t);
- $d_t=split(",",$drop_money_t);
- $cut=cut(5);
- $drop_agent_cut=cut_num($agent,5,$plate);
- $drop_all_agent_cut=cut_num($all_agent,5,$plate);
- $drop_super_agent_cut=cut_num($super_agent,5,$plate);
- for($i=0;$i<count($a_t)-1;$i++)
- {
- $sqlyz=mysql_query("select * from num where num='$a_t[$i]' and sign='3'",$conn); //赔率变动check
- $prate=mysql_result($sqlyz,0,"rate");
- if($prate<>$c_t[$i])
- {
- $yesrate=1;
- $ys=1;
- }else $yesrate=0;
- $sqlss=mysql_query("insert into drop_bill(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,
- drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,drop_all_agent_cut,
- drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent','$user','$drop_date','$open_date','$drop_type_t',
- '$a_t[$i]','$c_t[$i]','$cut','5','$d_t[$i]','1','3','$plate','$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut','$yesrate')",$conn);
- //bs
- $sqlsss=mysql_query("insert into drop_bills(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,drop_all_agent_cut,drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent','$user','$drop_date','$open_date','$drop_type_t','$a_t[$i]','$c_t[$i]','$cut','5','$d_t[$i]','1','3','$plate','$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut','$yesrate')",$conn);
- if($sqlss) $money+=$d_t[$i];
- }
- }
- }
- if(isset($_POST["drop_number_d"])) //d
- {
- $drop_number_d=$_POST["drop_number_d"];
- $drop_type_d=$_POST["drop_type_d"];
- $number_type="正码";
- $drop_rate_d=$_POST["drop_rate_d"];
- $drop_cut_d=$_POST["drop_cut_d"];
- $cut_sign_d=$_POST["cut_sign_d"];
- $drop_money_d=$_POST["drop_money_d"];
- $a_d=split(",",$drop_number_d);
- $c_d=split(",",$drop_rate_d);
- $cut_d=split(",",$drop_cut_d);
- $sign_d=split(",",$cut_sign_d);
- $d_d=split(",",$drop_money_d);
- for($i=0;$i<count($a_d)-1;$i++)
- {
- $drop_agent_cut=cut_num($agent,$sign_d[$i],$plate);
- $drop_all_agent_cut=cut_num($all_agent,$sign_d[$i],$plate);
- $drop_super_agent_cut=cut_num($super_agent,$sign_d[$i],$plate);
- $sqlyz=mysql_query("select * from num where tp='$a_d[$i]' and sign='2'",$conn); //赔率变动check
- $prate=mysql_result($sqlyz,0,"rate");
- $prate-=$_SESSION["tdnum"];
- if(trim($prate)<>trim($c_d[$i])):
- $c_d[$i]=$prate;
- $yesrate=1;
- $ys=1;
- $_SESSION["yesrate"]=1;
- else:
- $yesrate=0;
- endif;
- $sqldd=mysql_query("insert into drop_bill(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,
- drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,
- drop_all_agent_cut,drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent',
- '$user','$drop_date','$open_date','$number_type','$a_d[$i]','$c_d[$i]','$cut_d[$i]','$sign_d[$i]','$d_d[$i]','1','2','$plate',
- '$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut','$yesrate')",$conn);
- //bs
- $sqldds=mysql_query("insert into drop_bills(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,drop_all_agent_cut,drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent','$user','$drop_date','$open_date','$number_type','$a_d[$i]','$c_d[$i]','$cut_d[$i]','$sign_d[$i]','$d_d[$i]','1','2','$plate','$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut','$yesrate')",$conn);
- if($sqldd) $money+=$d_d[$i];
- }
- }
- $sqlr=mysql_query("select * from drop_bill where sign='1' and user_name='$user' order by id desc",$conn);
- //bs
- $sqlrs=mysql_query("select * from drop_bills where sign='1' and user_name='$user' order by id desc",$conn);
- ?>
- <br>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="31" background="../img2/skin1_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"><div align="center" class="fbback">您的下注状态</div></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td><table height="74" border="0" align="left" cellpadding="2" cellspacing="1" class="t12">
- <tr class="t12">
- <td><div align="center" class="fw12">下注方式</div></td>
- <td><div align="center" class="fw12">下注内容</div></td>
- <td><div align="center" class="fw12">赔率</div></td>
- <td height="26">
- <div align="center" class="fw12">下注金额</div></td>
- <td class="fw12">状态</td>
- <td class="fw12"> </td>
- </tr>
- <?php
- while($rowr=mysql_fetch_array($sqlr))
- { if($rowr["yesrate"]=="1")
- { $ts="class='t13'";
- }else $ts="class='t15'";?>
- <tr class="t20" <?=$ts?>>
- <td height="22"><?=$rowr["drop_type"]?></td>
- <td height="22"><?=$rowr["drop_content"]?></td>
- <td height="22">
- <div align="right">
- <?=$rowr["drop_rate"]?>
- </div></td>
- <td height="22">
- <div align="right">
- <?=$rowr["drop_money"]?>
- </div></td>
- <td><div align="center" class="fgreng"><? if($rowr["yesrate"]=="1")
- { echo "<font color='red'>失败</font>";
- }else echo "成功";?></div></td>
- <td>
- <?php if($rowr["yesrate"]=="1")
- { echo "原因:赔率发生变动";
- }else $all_money+=$rowr["drop_money"];?></td>
- </tr>
- <?
- } $moneys=$all_money+$_SESSION["used"]; //更新信用额度
- $ys=mysql_query("update member set used_credit='$moneys' where user_account='$user'",$conn);
- if($ys) $_SESSION["used"]=$moneys;
- mysql_query("update drop_bill set sign='0' where user_name='$user'",$conn);
- mysql_query("delete from drop_bill where user_name='$user' and yesrate='1'",$conn);
- //bs
- mysql_query("update drop_bills set sign='0' where user_name='$user'",$conn);
- mysql_query("delete from drop_bills where user_name='$user' and yesrate='1'",$conn);
- ?> <tr class="t21">
- <td height="22" colspan="3"><div align="right" class="fw12">下注成功合计:</div></td>
- <td height="22"><div align="right" class="fw12"><?=$all_money?></div></td>
- <td><input name="rcount" type="hidden" id="rcount" value="<?=$all_money?>"></td>
- <td> </td>
- </tr>
- <meta http-equiv="refresh" content="20;URL=znumber.php">
- </table></td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- </table>
- 请点<a href="znumber.php">正码下单</a>,或稍等8秒后自动返回快速下单页面!
- <?
- }else
- {
- for($i=1;$i<=49;$i++)
- {
- if(strlen($i)==1)
- { $n="0".$i;
- }else $n=$i;
- $sp="t".$n;
- $totxt=$_POST[$sp];
- if($totxt<>"") $check.=$n.",";
- }
- //$check=@$_POST["check"];
- $list=split(",",$check);
- function outscript($arr)
- {
- echo "<script language='javascript'>".$arr."</script>";
- }
- for($i=0;$i<count($list)-1;$i++)
- {
- $p="t".$list[$i];
- $txt=@$_POST[$p];
- $rmb_count+=$txt;
- }
- ?>
- <table width="200" border="0" cellspacing="1" cellpadding="0">
- <form name="form1" method="post" action="znumber_check.php?act=yes">
- <tr>
- <td><table width="188" height="97" border="0" align="left" cellpadding="0" cellspacing="1" class="t12">
- <tr background="../img/left_t.gif">
- <td height="26" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="31" background="../img2/skin1_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"><div align="center" class="fbback">您的下注状态</div></td>
- </tr>
- </table>
- </td>
- </tr>
- </table></td>
- </tr>
- <tr class="t12">
- <td><div align="center" class="fw12">下注方式</div></td>
- <td><div align="center" class="fw12">下注内容</div></td>
- <td><div align="center" class="fw12">赔率</div></td>
- <td height="22">
- <div align="center" class="fw12">下注金额</div></td>
- </tr>
- <?php
- $x=0;
- for($i=0;$i<count($list)-1;$i++)
- {
- $p="t".$list[$i];
- $txt=@$_POST[$p];
- if($txt<>"")
- {
- $number=$list[$i]; //单项限额
- $drop_money=$txt;
- $sqltm=mysql_query("select sum(drop_money) from drop_bill where drop_date='$drop_date' and user_name='$user' and drop_content='$number' and cut_sign='5'",$conn);
- $myrow=mysql_fetch_array($sqltm);
- $tmcount=$myrow[0];
- $ladd=$drop_money+$tmcount;
- if($ladd>$units) echo "<script language='javascript'> alert('正码 ".$number." 单项限额不能大于 ".$units."');history.back();</script>";
- if($txt<$minrmb)
- {
- outscript("alert('单注最低限额为 ".$minrmb."');history.back(1);");
- }elseif($txt>$maxrmb)
- {
- echo outscript("alert('正码 ".$number." 单注最高限额为 ".$maxrmb."');history.back(1);");
- }else
- {
- if(substr($txt,0,1)=="0") $txt=substr($txt,1,strlen($txt));
- $x++;
- ?>
- <tr class="t20">
- <td><div align="center">
- <?=$znumber?>
- </div></td>
- <td><div align="center">
- <?=$list[$i]?>
- </div></td>
- <td><div align="center">
- <?php
- $sql=mysql_query("select * from num where sign='3' and num='$list[$i]' order by id asc",$conn);
- $rate=mysql_result($sql,0,"rate");
- $droprate_t.=$rate.",";
- echo $rate;
- ?>
- </div></td>
- <td height="26"><div align="center">
- <?php
- $tmoney.=$txt.",";
- $recount+=$tmoney;
- echo $txt;
- ?>
- </div></td>
- </tr>
- <?php
- }
- }
- }
- for($i=7;$i<11;$i++)
- {
- $d="d".$i;
- $txtd=$_POST[$d];
- if($txtd<>"")
- {
- $f=$i;
- switch($f)
- {
- case "7":
- $cond.="7,";
- $tcontent="总单";
- $cutd.=cut(6).",";
- $signd.=cutsign(6).",";
- break;
- case "8":
- $cond.="8,";
- $tcontent="总双";
- $cutd.=cut(6).",";
- $signd.=cutsign(6).",";
- break;
- case "9":
- $cond.="9,";
- $tcontent="总大";
- $cutd.=cut(7).",";
- $signd.=cutsign(7).",";
- break;
- case "10":
- $cond.="10,";
- $tcontent="总小";
- $cutd.=cut(7).",";
- $signd.=cutsign(7).",";
- break;
- }
- $sqld=mysql_query("select * from num where sign='2' and num='$f' order by id asc",$conn);
- $rated=mysql_result($sqld,0,"rate");
- if($plate=="A")
- { $rateds=$rated;
- $_SESSION["tdnum"]=0;
- }
- if($plate=="B")
- { $rateds=$rated-0.01;
- $_SESSION["tdnum"]=0.01;
- }
- if($plate=="C")
- { $rateds=$rated-0.02;
- $_SESSION["tdnum"]=0.02;
- }
- $rated=$rateds;
- $drate.=$rated.",";
- $dmoney.=$txtd.",";
- $dcontent.=$tcontent.",";
- echo "<tr class=t20><td><div align=center>".$znumber."</div></td>";
- echo "<td><div align=center>".$tcontent."</div></td>";
- echo "<td><div align=center>".$rated."</div></td>";
- echo "<td><div align=center>".$txtd."</div></td><tr>";
- $rmb_count+=$txtd;
- }
- }
- if($rmb_count==""||$rmb_count==0) outscript("alert('请输入下注金额!');history.back(1);");
- ?>
- <tr class="t21">
- <td height="22" colspan="4"><div align="center"></div>
- <div align="right" class="fw12"> 共 <span class="style1">
- <?=$x?>
- </span> 注 合计: <span class="style1">
- <?=$rmb_count?>
- </span> </div>
- <div align="right"></div>
- <div align="center" class="fw12"> </div></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td height="27">
- <script language="javascript">
- function kk(){
- document.form1.Submit2.disabled="disabled";
- document.form1.submit();
- }
- </script>
- <div align="center">
- <input name="Submit" type="button" class="buttonrmin" value="取消下注" onclick="javascript:history.back(1);">
- <input name="Submit2" type="button" class="buttongmin" value="确定下注" onclick="kk();">
- <input name="drop_number_t" type="hidden" id="drop_number_t" value="<?=$check?>">
- <input name="drop_type_t" type="hidden" id="znumber" value="<?=$znumber?>">
- <input name="drop_rate_t" type="hidden" id="check" value="<?= $droprate_t?>">
- <input name="drop_money_t" type="hidden" id="check" value="<?=$tmoney?>">
- <input name="rcount" type="hidden" id="check" value="<?=$recount?>">
- <input name="drop_number_d" type="hidden" id="drop_number_d" value="<?=$dcontent?>">
- <input name="drop_type_d" type="hidden" id="drop_type_d" value="正码">
- <input name="drop_rate_d" type="hidden" id="drop_number_d" value="<?=$drate?>">
- <input name="drop_cut_d" type="hidden" id="drop_cut_d" value="<?=$cutd?>">
- <input name="cut_sign_d" type="hidden" id="drop_cut_d" value="<?=$signd?>">
- <input name="drop_money_d" type="hidden" id="drop_number_d" value="<?=$dmoney?>">
- </div></td>
- </tr> </form>
- </table>
- <? }?>