znumber_check.php
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:14k
源码类别:

Web服务器

开发平台:

PHP

  1. <?php
  2. session_start();
  3. include("../inc/conn.php");
  4. include("check.php");
  5. include("configs.inc.php");
  6. include("other_close.php");
  7. $user=$_SESSION["user"];
  8. $drop_date=$_SESSION["downdate"];
  9. $open_date=$_SESSION["opendate"];
  10. $open_date=str_replace("-","",$open_date);
  11. $plate=$_SESSION["plate"];
  12. $agent=$_SESSION["agent"];
  13. $all_agent=$_SESSION["all_agent"];
  14. $super_agent=$_SESSION["super_agent"];
  15. $sqlm=mysql_query("select * from member_cut where user_account='$user' and sign='5'",$conn);
  16. $minrmb=$drop_lows;
  17. $znumber="正码";
  18. $units=mysql_result($sqlm,0,"unit_limit");
  19. $maxrmb=mysql_result($sqlm,0,"pour_limit");
  20. ?>
  21. <link href="../css/css2.CSS" rel="stylesheet" type="text/css">
  22. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  23. <style type="text/css">
  24. <!--
  25. body {
  26. margin-left: 10px;
  27. margin-top: 5px;
  28. }
  29. .style1 {font-weight: bold}
  30. -->
  31. </style>
  32. <?php
  33. include("../inc/cut.inc.php");
  34. if(isset($_GET["act"]))
  35.  if(isset($_POST["drop_number_t"]))   
  36.  {
  37.      $rcount=$_POST["rcount"];
  38.      $leave=$_SESSION["credit"]-$_SESSION["used"];
  39.      if($leave<$rcount)
  40.       {
  41.        echo "<script language='javascript'> alert('您的信用余额不够本次下注!');window.location.href='znumber.php'</script>";
  42.       }else
  43.       {
  44.    $drop_number_t=$_POST["drop_number_t"];
  45.    $drop_type_t=$_POST["drop_type_t"];
  46.    $drop_rate_t=$_POST["drop_rate_t"];
  47.    $drop_money_t=$_POST["drop_money_t"];
  48.    $a_t=split(",",$drop_number_t);
  49.    $c_t=split(",",$drop_rate_t);
  50.    $d_t=split(",",$drop_money_t);
  51.    $cut=cut(5);
  52.    $drop_agent_cut=cut_num($agent,5,$plate);
  53.    $drop_all_agent_cut=cut_num($all_agent,5,$plate);
  54.    $drop_super_agent_cut=cut_num($super_agent,5,$plate);
  55.     for($i=0;$i<count($a_t)-1;$i++)
  56.     {
  57.  $sqlyz=mysql_query("select * from  num where num='$a_t[$i]' and sign='3'",$conn);  //赔率变动check
  58.      $prate=mysql_result($sqlyz,0,"rate");
  59.  if($prate<>$c_t[$i])
  60.  {
  61.    $yesrate=1;
  62.    $ys=1;
  63.  }else $yesrate=0;
  64.      $sqlss=mysql_query("insert into drop_bill(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,
  65.  drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,drop_all_agent_cut,
  66.  drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent','$user','$drop_date','$open_date','$drop_type_t',
  67.  '$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);
  68.      //bs
  69.  $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);
  70. if($sqlss) $money+=$d_t[$i];
  71.     }
  72.    }
  73.  } 
  74.  if(isset($_POST["drop_number_d"]))    //d
  75.  {
  76.    $drop_number_d=$_POST["drop_number_d"];
  77.    $drop_type_d=$_POST["drop_type_d"];
  78.    $number_type="正码";
  79.    $drop_rate_d=$_POST["drop_rate_d"];
  80.    $drop_cut_d=$_POST["drop_cut_d"];
  81.    $cut_sign_d=$_POST["cut_sign_d"];
  82.    $drop_money_d=$_POST["drop_money_d"];
  83.    $a_d=split(",",$drop_number_d);
  84.    $c_d=split(",",$drop_rate_d);
  85.    $cut_d=split(",",$drop_cut_d);
  86.    $sign_d=split(",",$cut_sign_d);
  87.    $d_d=split(",",$drop_money_d);
  88.    for($i=0;$i<count($a_d)-1;$i++)
  89.    {
  90.     $drop_agent_cut=cut_num($agent,$sign_d[$i],$plate);
  91.     $drop_all_agent_cut=cut_num($all_agent,$sign_d[$i],$plate);
  92.     $drop_super_agent_cut=cut_num($super_agent,$sign_d[$i],$plate);
  93.  $sqlyz=mysql_query("select * from  num where tp='$a_d[$i]' and sign='2'",$conn);  //赔率变动check
  94.      $prate=mysql_result($sqlyz,0,"rate");
  95.  $prate-=$_SESSION["tdnum"];
  96.   if(trim($prate)<>trim($c_d[$i])):
  97.    $c_d[$i]=$prate;
  98.    $yesrate=1;
  99.    $ys=1;
  100.    $_SESSION["yesrate"]=1;
  101.   else:
  102.    $yesrate=0;
  103.    endif;
  104.     $sqldd=mysql_query("insert into drop_bill(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,
  105. drop_content,drop_rate,drop_cut,cut_sign,drop_money,sign,num_sign,drop_plate,drop_agent_cut,
  106.  drop_all_agent_cut,drop_super_agent_cut,yesrate)values('$agent','$all_agent','$super_agent',
  107. '$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',
  108. '$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut','$yesrate')",$conn);
  109. //bs
  110.  $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);
  111.     if($sqldd) $money+=$d_d[$i];
  112.    }
  113.  }
  114.  $sqlr=mysql_query("select * from drop_bill where sign='1' and user_name='$user' order by id desc",$conn);
  115.  //bs
  116.  $sqlrs=mysql_query("select * from drop_bills where sign='1' and user_name='$user' order by id desc",$conn);
  117.  ?>
  118.  <br>
  119.     <table border="0" cellspacing="0" cellpadding="0">
  120.       <tr>
  121.         <td height="31" background="../img2/skin1_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  122. <tr>
  123.         <td height="10"></td>
  124.       </tr>
  125.   <tr>
  126.     <td align="center"><div align="center" class="fbback">您的下注状态</div></td>
  127.   </tr>
  128. </table>
  129. </td>
  130.       </tr>
  131.       <tr>
  132.         <td><table height="74"  border="0" align="left" cellpadding="2" cellspacing="1" class="t12">
  133.           <tr class="t12">
  134.             <td><div align="center" class="fw12">下注方式</div></td>
  135.             <td><div align="center" class="fw12">下注内容</div></td>
  136.             <td><div align="center" class="fw12">赔率</div></td>
  137.             <td height="26">
  138.               <div align="center" class="fw12">下注金额</div></td>
  139.             <td class="fw12">状态</td>
  140.             <td class="fw12">&nbsp;</td>
  141.           </tr>
  142.           <?php 
  143.        while($rowr=mysql_fetch_array($sqlr))
  144.          { if($rowr["yesrate"]=="1")
  145.  { $ts="class='t13'";
  146.  }else $ts="class='t15'";?>
  147.           <tr class="t20" <?=$ts?>>
  148.             <td height="22"><?=$rowr["drop_type"]?></td>
  149.             <td height="22"><?=$rowr["drop_content"]?></td>
  150.             <td height="22">
  151.               <div align="right">
  152.                 <?=$rowr["drop_rate"]?>
  153.             </div></td>
  154.             <td height="22">
  155.               <div align="right">
  156.                 <?=$rowr["drop_money"]?>
  157.             </div></td>
  158.             <td><div align="center" class="fgreng"><? if($rowr["yesrate"]=="1")
  159. { echo "<font color='red'>失败</font>";
  160. }else echo "成功";?></div></td>
  161.             <td>
  162. <?php if($rowr["yesrate"]=="1")
  163. { echo "原因:赔率发生变动";
  164. }else $all_money+=$rowr["drop_money"];?></td>
  165.           </tr>
  166.           <? 
  167.   } $moneys=$all_money+$_SESSION["used"];  //更新信用额度
  168.             $ys=mysql_query("update member set used_credit='$moneys' where user_account='$user'",$conn);
  169.             if($ys) $_SESSION["used"]=$moneys;
  170.    mysql_query("update drop_bill set sign='0' where user_name='$user'",$conn);
  171.    mysql_query("delete from drop_bill where user_name='$user' and yesrate='1'",$conn);
  172.    //bs
  173.    mysql_query("update drop_bills set sign='0' where user_name='$user'",$conn);
  174.    mysql_query("delete from drop_bills where user_name='$user' and yesrate='1'",$conn);
  175.   ?> <tr class="t21">
  176.             <td height="22" colspan="3"><div align="right" class="fw12">下注成功合计:</div></td>
  177.             <td height="22"><div align="right" class="fw12"><?=$all_money?></div></td>
  178.             <td><input name="rcount" type="hidden" id="rcount" value="<?=$all_money?>"></td>
  179.             <td>&nbsp;</td>
  180.           </tr>
  181.           <meta http-equiv="refresh" content="20;URL=znumber.php">
  182.         </table></td>
  183.       </tr>
  184.       <tr>
  185.         <td>&nbsp;</td>
  186.       </tr>
  187.     </table>
  188. 请点<a href="znumber.php">正码下单</a>,或稍等8秒后自动返回快速下单页面!
  189.  <?
  190. }else
  191. {
  192. for($i=1;$i<=49;$i++)
  193. {
  194.   if(strlen($i)==1)
  195.   { $n="0".$i; 
  196.   }else $n=$i;
  197.   $sp="t".$n;
  198.   $totxt=$_POST[$sp];
  199.   if($totxt<>"") $check.=$n.",";
  200. }
  201. //$check=@$_POST["check"];
  202. $list=split(",",$check);
  203. function outscript($arr)
  204. {
  205.  echo "<script language='javascript'>".$arr."</script>";
  206. }
  207. for($i=0;$i<count($list)-1;$i++)
  208. {
  209.  $p="t".$list[$i];
  210.  $txt=@$_POST[$p];
  211.  $rmb_count+=$txt;
  212. }
  213. ?>
  214. <table width="200" border="0" cellspacing="1" cellpadding="0">
  215.   <form name="form1" method="post" action="znumber_check.php?act=yes">
  216.   <tr>
  217.     <td><table width="188" height="97"  border="0" align="left" cellpadding="0" cellspacing="1" class="t12">
  218.       <tr background="../img/left_t.gif">
  219.         <td height="26" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  220.           <tr>
  221.             <td height="31" background="../img2/skin1_07.png"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  222. <tr>
  223.         <td height="10"></td>
  224.       </tr>
  225.   <tr>
  226.     <td align="center"><div align="center" class="fbback">您的下注状态</div></td>
  227.   </tr>
  228. </table>
  229. </td>
  230.           </tr>
  231.         </table></td>
  232.         </tr>
  233.       <tr class="t12">
  234.         <td><div align="center" class="fw12">下注方式</div></td>
  235.         <td><div align="center" class="fw12">下注内容</div></td>
  236.         <td><div align="center" class="fw12">赔率</div></td>
  237.         <td height="22">
  238.           <div align="center" class="fw12">下注金额</div></td>
  239.       </tr>
  240. <?php
  241. $x=0;
  242. for($i=0;$i<count($list)-1;$i++)
  243. {
  244. $p="t".$list[$i];
  245. $txt=@$_POST[$p];
  246. if($txt<>"")
  247.  {
  248. $number=$list[$i];   //单项限额
  249. $drop_money=$txt;
  250. $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);
  251. $myrow=mysql_fetch_array($sqltm);
  252. $tmcount=$myrow[0];
  253. $ladd=$drop_money+$tmcount;
  254. if($ladd>$units) echo "<script language='javascript'> alert('正码 ".$number." 单项限额不能大于 ".$units."');history.back();</script>";
  255.   if($txt<$minrmb)
  256.   { 
  257.    outscript("alert('单注最低限额为 ".$minrmb."');history.back(1);");
  258.   }elseif($txt>$maxrmb)
  259.   {
  260.   echo outscript("alert('正码 ".$number." 单注最高限额为 ".$maxrmb."');history.back(1);");
  261.   }else
  262.   {
  263.   if(substr($txt,0,1)=="0") $txt=substr($txt,1,strlen($txt));
  264.   $x++;
  265.   ?>
  266.   <tr class="t20">
  267.         <td><div align="center">
  268.             <?=$znumber?>
  269.         </div></td>
  270.         <td><div align="center">
  271.             <?=$list[$i]?>
  272.         </div></td>
  273.         <td><div align="center">
  274.             <?php
  275.  $sql=mysql_query("select * from num where sign='3' and num='$list[$i]' order by id asc",$conn);
  276.              $rate=mysql_result($sql,0,"rate");
  277.  $droprate_t.=$rate.",";
  278.  echo $rate;
  279.  ?>
  280.         </div></td>
  281.         <td height="26"><div align="center">
  282.             <?php
  283. $tmoney.=$txt.",";
  284. $recount+=$tmoney;
  285. echo $txt;
  286. ?>
  287.         </div></td>
  288.       </tr>
  289.   <?php
  290.   }
  291.  }
  292.  }
  293. for($i=7;$i<11;$i++)
  294. {
  295.  $d="d".$i;
  296.  $txtd=$_POST[$d];
  297.  if($txtd<>"")
  298.  {
  299.   $f=$i;
  300.  switch($f)
  301.  {
  302.    case "7":
  303.    $cond.="7,";
  304.    $tcontent="总单";
  305.    $cutd.=cut(6).",";
  306.    $signd.=cutsign(6).",";
  307.    break;
  308.   case "8":
  309.    $cond.="8,";
  310.    $tcontent="总双";
  311.   $cutd.=cut(6).",";
  312.   $signd.=cutsign(6).",";
  313.    break;
  314.   case "9":
  315.    $cond.="9,";
  316.    $tcontent="总大";
  317.   $cutd.=cut(7).",";
  318.    $signd.=cutsign(7).",";
  319.    break;
  320.   case "10":
  321.    $cond.="10,";
  322.    $tcontent="总小";
  323.    $cutd.=cut(7).",";
  324.    $signd.=cutsign(7).",";
  325.    break;
  326.  }
  327.   $sqld=mysql_query("select * from num where sign='2' and num='$f' order by id asc",$conn);
  328.   $rated=mysql_result($sqld,0,"rate");
  329.             if($plate=="A")
  330. { $rateds=$rated;
  331. $_SESSION["tdnum"]=0;
  332. }
  333.                 if($plate=="B")
  334. { $rateds=$rated-0.01;
  335. $_SESSION["tdnum"]=0.01;
  336. }
  337.             if($plate=="C")
  338. { $rateds=$rated-0.02;
  339. $_SESSION["tdnum"]=0.02;
  340. }
  341. $rated=$rateds;
  342.   $drate.=$rated.",";
  343.   $dmoney.=$txtd.",";
  344.   $dcontent.=$tcontent.",";
  345.   echo "<tr class=t20><td><div align=center>".$znumber."</div></td>"; 
  346.   echo "<td><div align=center>".$tcontent."</div></td>";
  347.   echo "<td><div align=center>".$rated."</div></td>";
  348.   echo "<td><div align=center>".$txtd."</div></td><tr>";
  349.   $rmb_count+=$txtd;
  350.  }
  351. }
  352. if($rmb_count==""||$rmb_count==0) outscript("alert('请输入下注金额!');history.back(1);"); 
  353. ?>
  354.       <tr class="t21">
  355.         <td height="22" colspan="4"><div align="center"></div>
  356.             <div align="right" class="fw12"> 共 <span class="style1">
  357.               <?=$x?>
  358.               </span> 注 合计: <span class="style1">
  359.               <?=$rmb_count?>
  360.             </span> </div>
  361.             <div align="right"></div>
  362.             <div align="center" class="fw12"> </div></td>
  363.       </tr>
  364.     </table></td>
  365.   </tr>
  366.   <tr>
  367.     <td height="27">
  368. <script language="javascript">
  369. function kk(){
  370. document.form1.Submit2.disabled="disabled";
  371. document.form1.submit();
  372. }
  373. </script>
  374. <div align="center">
  375.           <input name="Submit" type="button" class="buttonrmin" value="取消下注" onclick="javascript:history.back(1);">
  376.           <input name="Submit2" type="button" class="buttongmin" value="确定下注" onclick="kk();">
  377.           <input name="drop_number_t" type="hidden" id="drop_number_t" value="<?=$check?>">           
  378.           <input name="drop_type_t" type="hidden" id="znumber" value="<?=$znumber?>">  
  379.    <input name="drop_rate_t" type="hidden" id="check" value="<?= $droprate_t?>">      
  380.            <input name="drop_money_t" type="hidden" id="check" value="<?=$tmoney?>">
  381.     <input name="rcount" type="hidden" id="check" value="<?=$recount?>">
  382.             <input name="drop_number_d" type="hidden" id="drop_number_d" value="<?=$dcontent?>">
  383.             <input name="drop_type_d" type="hidden" id="drop_type_d" value="正码">
  384.             <input name="drop_rate_d" type="hidden" id="drop_number_d" value="<?=$drate?>">
  385.             <input name="drop_cut_d" type="hidden" id="drop_cut_d" value="<?=$cutd?>">
  386.             <input name="cut_sign_d" type="hidden" id="drop_cut_d" value="<?=$signd?>">
  387.             <input name="drop_money_d" type="hidden" id="drop_number_d" value="<?=$dmoney?>">
  388. </div></td>
  389.   </tr> </form>
  390. </table>
  391. <? }?>