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

Web服务器

开发平台:

PHP

  1. <?php
  2. session_start();
  3. include("../inc/conn.php");
  4. include("check.php");
  5. include("configs.inc.php");
  6. include("left_other_close.php");
  7. include("../inc/char.inc.php");
  8. $user=$_SESSION["user"];
  9. $credit=$_SESSION["credit"];
  10. $used=$_SESSION["used"];
  11. $type=$_SESSION["type"];
  12. $downdate=$_SESSION["downdate"];
  13. $dates=$downdate;
  14. $opendate=$_SESSION["opendate"];
  15. $drop_date=$_SESSION["downdate"];
  16. $open_date=$_SESSION["opendate"];
  17. $agent=$_SESSION["agent"];
  18. $all_agent=$_SESSION["all_agent"];
  19. $super_agent=$_SESSION["super_agent"];
  20. $open_date=str_replace("-","",$open_date);
  21. $plate=$_SESSION["plate"];
  22. include("../inc/cut.inc.php");
  23. $sqlm=mysql_query("select * from member_cut where user_account='$user' and sign='18'",$conn);
  24. $units=mysql_result($sqlm,0,"unit_limit");
  25. $maxrmb=mysql_result($sqlm,0,"pour_limit");
  26. $minrmb=$drop_lows;
  27. if(isset($_GET["act"]))
  28.  $drop_money=$_POST["drop_money"];
  29.  $drop_content=$_POST["drop_content"];
  30.  $drop_details=$_POST["drop_details"];
  31.  $drop_rate=$_POST["drop_rate"];
  32.  $drop_type="连码";
  33.   if($drop_money=="")
  34.   { 
  35.    echo "<script language='javascript'>alert('下注金额不能为空!');history.back(1);</script>";
  36.    }else
  37.   {
  38.     $leave=$_SESSION["credit"]-$_SESSION["used"];
  39.     if($leave>=$drop_money)
  40.     {
  41.      $money=$_SESSION["used"]+$drop_money;
  42.  $cut=cut(18);
  43.  $drop_agent_cut=cut_num($agent,18,$plate);
  44.  $drop_all_agent_cut=cut_num($all_agent,18,$plate);
  45.  $drop_super_agent_cut=cut_num($super_agent,18,$plate);
  46.      $ok=mysql_query("insert into drop_bill(agent,all_agent,super_agent,user_name,drop_date,open_date,drop_type,
  47.  drop_content,drop_rate,drop_cut,cut_sign,drop_money,drop_details,sign,num_sign,drop_plate,drop_agent_cut,
  48.  drop_all_agent_cut,drop_super_agent_cut)values('$agent','$all_agent','$super_agent','$user','$drop_date',
  49.  $open_date,'$drop_type','$drop_content','$drop_rate','$cut','18','$drop_money','$drop_details','0','5',
  50.  '$plate','$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut')",$conn);
  51.  //bs
  52.  $oks=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,drop_details,sign,num_sign,drop_plate,drop_agent_cut,drop_all_agent_cut,drop_super_agent_cut)values('$agent','$all_agent','$super_agent','$user','$drop_date',$open_date,'$drop_type','$drop_content','$drop_rate','$cut','18','$drop_money','$drop_details','0','5','$plate','$drop_agent_cut','$drop_all_agent_cut','$drop_super_agent_cut')",$conn);
  53.      $ys=mysql_query("update member set used_credit='$money' where user_account='$user'",$conn);
  54.      if($ys) $_SESSION["used"]=$money;
  55.  if($ok)  echo "<script language='javascript'>alert('恭喜您,下注成功!');window.location.href='uleft.php';</script>";
  56.     }else 
  57. {
  58.      echo "<script language='javascript'> alert('您的信用余额不够本次下注!');window.location.href='uleft.php'</script>";  
  59. }
  60.   }
  61. }
  62. $update_time=45;
  63. ?>
  64. <link href="../css/css2.CSS" rel="stylesheet" type="text/css">
  65. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  66. <meta http-equiv="refresh" content="<?=$update_time?>;URL=uleft.php">
  67. <style type="text/css">
  68. <!--
  69. body {
  70. background-color: #8FB3F3;
  71. margin-top: 5px;
  72. }
  73. -->
  74. </style>
  75. <?php
  76.  if(isset($_GET["jact"]))
  77. {   
  78.  $drop_contents=$_POST["drop_contenta"];
  79.  $drop_details=$_POST["drop_detailsa"];
  80.  $drop_rates=$_POST["drop_ratea"];
  81.  $drop_moneys=$_POST["drop_moneys"]*$_POST["units"];
  82. ?>
  83. <form name="form1" method="post" action="lnumber_check.php?act=yes">
  84. <div align="center"></div>
  85. <table width="100%" height="108"  border="0" align="center" cellpadding="0" cellspacing="1" class="aroundtable1">
  86.  
  87.     <tr  >
  88.       <td height="31" colspan="4"  background="../img2/skin1_07.png"><table width="98%" border="0" cellspacing="0" cellpadding="0">
  89.       <tr>
  90.         <td width="98%" height="10"></td>
  91.       </tr>
  92.       <tr>
  93.         <td width="98%" height="21"><div align="center"><span class="fb12">您下注的是</span></div></td>
  94.       </tr>
  95.     </table></td>
  96.     </tr>
  97.     <tr class="t12">
  98.       <td><div align="center" class="fw12">下注方式</div></td>
  99.       <td><div align="center" class="fw12">下注内容</div></td>
  100.       <td><div align="center" class="fw12">赔率</div></td>
  101.       <td height="22">        <div align="center" class="fw12">下注金额</div></td>
  102.     </tr>
  103.     <tr class="t17">
  104.       <td nowrap><div align="center">连码</div></td>
  105.       <td width="60"><div align="center"><?=$drop_contents?> <?=$drop_details?></div></td>
  106.       <td><div align="center"><?=$drop_rates?></div></td>
  107.       <td height="26" nowrap><div align="center"><?=$drop_moneys?></div></td>
  108.     </tr>
  109.     <tr class="t20">
  110.       <td height="29" colspan="4"><div align="center"><span class="style3">
  111.   <div align="center"><span class="style3">
  112. <input name="drop_rate" type="hidden" id="drop_rate3" value="<?=$drop_rates?>">
  113. <input name="drop_content" type="hidden" id="drop_content4" value="<?=$drop_contents?>">
  114. <input name="drop_details" type="hidden" id="drop_details3" value="<?=$drop_details?>">
  115. <input name="drop_money" type="hidden" id="drop_rate4" value="<?=$drop_moneys?>">
  116.   &nbsp;
  117.      
  118.   </span>
  119. </div>
  120.         <input name="Submit3" type="button" class="buttonrmin" value="取消下注" onClick="window.location.href='uleft.php';">
  121.         <input name="Submit22" type="submit" class="buttongmin" value="确定下注">
  122.       </span></div></td>
  123.     </tr>
  124. </table> 
  125. <br>
  126. </form>
  127. <?php 
  128. }
  129. else{
  130. $check=$_POST["check"];
  131. $fp=split(",",$check);
  132. $unum=count($fp)-1;
  133. $among=$_POST["ratetype"];
  134. $atype=$among;
  135. $rate=$_POST["rate"];
  136. $vrate=$rate;
  137. if($among=="1")
  138.  {
  139.    $among="三全中";
  140.    $ratemenu=$rate;
  141.  }elseif($among=="2")
  142.  {
  143.    $among="三中二";
  144.    $ay=split(",",$rate);
  145.    $rate1=$ay[0];
  146.    $rate2=$ay[1];
  147.    $vrate=$rate2;
  148.    $ratemenu="中二<font color='red'>".$rate1."</font><br>中三<font color='red'>".$rate2."</font>";
  149.   }elseif($among=="3")
  150.   {
  151.    $among="二全中";
  152.    $ratemenu=$rate;
  153.    $vrate=$rate;
  154.   }elseif($among=="4")
  155.   {
  156.     $among="二中特";
  157.     $ay=split(",",$rate);
  158.     $rate1=$ay[0];
  159.     $rate2=$ay[1];
  160.  $vrate=$rate2;
  161. $ratemenu="中特<font color='red'>".$rate1."</font><br>中二<font color='red'>".$rate2."</font>";
  162.   }elseif($among=="5")
  163.   {
  164.     $among="特串";
  165. $ratemenu=$rate;
  166.  $vrate=$rate;
  167.   }
  168.   if($atype==1||$atype==2)
  169.   {
  170.      if($unum==3)
  171.  {
  172.   $unums=1;
  173.  }elseif($unum==4)
  174.    {
  175.      $unums=4;
  176.    }elseif($unum==5)
  177.    {
  178.     $unums=10;
  179.    }elseif($unum==6)
  180.    {
  181.     $unums=20;
  182.    }elseif($unum==7)
  183.    {
  184.     $unums=35;
  185.    }elseif($unum==8)
  186.    {
  187.     $unums=56;
  188.    }elseif($unum==9)
  189.    {
  190.     $unums=84;
  191.    }elseif($unum==10)
  192.    {
  193.     $unums=120;
  194.    }
  195.   }else
  196.   {
  197.      if($unum==2)
  198.    {
  199.      $unums=1;
  200.    }elseif($unum==3)
  201.    {
  202.     $unums=3;
  203.    }elseif($unum==4)
  204.    {
  205.     $unums=6;
  206.    }elseif($unum==5)
  207.    {
  208.     $unums=10;
  209.    }elseif($unum==6)
  210.    {
  211.     $unums=15;
  212.    }elseif($unum==7)
  213.    {
  214.     $unums=21;
  215.    }elseif($unum==8)
  216.    {
  217.     $unums=28;
  218.    }elseif($unum==9)
  219.    {
  220.     $unums=36;
  221.     }elseif($unum==10)
  222.    {
  223.     $unums=45;
  224.    }
  225.   }
  226. $number=$among;   //单项限额
  227. $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='18'",$conn);
  228. $myrow=mysql_fetch_array($sqltm);
  229. $tmcount=$myrow[0];
  230. if($tmcount=="") $tmcount=0;
  231.   ?>
  232.   <script language="javascript">
  233. function checks(form)
  234. {
  235.   if(form.drop_moneys.value<<?=$minrmb?>)
  236.   {
  237.     alert("单注金额下限不能小于 <?=$minrmb?>");
  238. return false;
  239. form.drop_moneys.focus();
  240.   }
  241.   if(form.drop_moneys.value><?=$maxrmb?>)
  242.   {
  243.     alert("单注金额上限不能大于 <?=$maxrmb?>");
  244. return false;
  245. form.drop_moneys.focus();
  246.   }
  247.   var cmoney=parseFloat(form.drop_moneys.value)+<?=$tmcount?>;
  248.   if(cmoney><?=$units?>)
  249.   {
  250.     alert("连码 单项限额不能大于 <?=$units?>");
  251. return false;
  252. form.drop_moneys.focus();
  253.   }
  254. }
  255. function win_money()
  256. {
  257. var rmb=this.form1.drop_moneys.value;
  258. amoney.innerText=rmb*<?=$unums?>;
  259. //this.form1.drop_money.value=rmb*<?=$unums?>;
  260. rmb=rmb*<?=$rate?>-rmb;
  261. winmoney.innerText=roundFun(rmb,2);
  262. }
  263. function Isnum(){
  264.   return ((event.keyCode >= 48) && (event.keyCode <= 57));
  265. }
  266. function roundFun(numberRound,roundDigit) //四舍五入,保留位数为roundDigit ,供计算时用
  267.      {
  268.          if (numberRound>=0)
  269.          {
  270.             var tempNumber = parseInt((numberRound * Math.pow(10,roundDigit)+0.5))/Math.pow(10,roundDigit);
  271.             return tempNumber;
  272.         }
  273.         else 
  274.          {
  275.             numberRound1=-numberRound
  276.             var tempNumber = parseInt((numberRound1 * Math.pow(10,roundDigit)+0.5))/Math.pow(10,roundDigit);
  277.             return -tempNumber;
  278.         }
  279.      }
  280.   </script>
  281. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="aroundtable1">
  282.   <form name="form1" method="post" action="lnumber_check.php?jact=yes" onSubmit="return checks(this);"><tr>
  283.     <td width="253" height="31" background="../img2/skin1_07.png" ><table width="98%" border="0" cellspacing="0" cellpadding="0">
  284.       <tr>
  285.         <td width="98%" height="10"></td>
  286.       </tr>
  287.       <tr>
  288.         <td width="98%" height="21"><div align="center"><span class="fb12">香港六合彩 连码 下注单</span></div></td>
  289.       </tr>
  290.     </table></td>
  291.   </tr>
  292.   <tr>
  293.     <td class="t20"><table width="186" height="332"  border="0" align="center" cellpadding="0" cellspacing="0">
  294.       <tr>
  295.         <td height="20" colspan="2"><table width="91%" height="60"  border="0" align="center" cellpadding="0" cellspacing="0">
  296.             <tr>
  297.               <td width="38%"><div align="right">会员帐号:</div></td>
  298.               <td width="62%" height="20"><div align="right">
  299.                   <?=$user?>
  300.               </div></td>
  301.             </tr>
  302.             <tr>
  303.               <td><div align="right">会员盘类:</div></td>
  304.               <td height="20"><div align="right"><span class="style3">
  305.                   <?=$type?>
  306.               盘</span></div></td>
  307.             </tr>
  308.             <tr>
  309.               <td><div align="right">信用额度:</div></td>
  310.               <td height="20"><div align="right"><span class="style3">
  311.                   <?=rmb($credit)?>
  312.               </span></div></td>
  313.             </tr>
  314.         </table></td>
  315.       </tr>
  316.       <tr>
  317.         <td height="13" colspan="2"><hr width="98%" size="1"></td>
  318.       </tr>
  319.       <tr>
  320.         <td height="20" colspan="2"><div align="center"><font color="blue"><strong>期数
  321.                 <?=$downdate?>
  322.         </strong></font><br>
  323.         <strong><font color="#FF0000">连码
  324.                   <?=$among?>
  325.             </font></strong> <span class="fat">@ </span> <font color="#FF0000">
  326.             <?=$ratemenu?>
  327.         </font> </div></td>
  328.       </tr>
  329.       <tr>
  330.         <td height="18" colspan="2"><div align="center">
  331.             <?=$check?>
  332.         </div></td>
  333.       </tr>
  334.       <tr>
  335.         <td height="20" colspan="2"><div align="center">组合 共 <strong>
  336.             <?=$unums?>
  337.         </strong> 组
  338.         <input name="units" type="hidden" id="units" value="<?=$unums?>">
  339.         <hr width="98%" size="1">
  340.         </div></td>
  341.       </tr>
  342.       <tr>
  343.         <td width="86"><div align="right">
  344.           <input name="drop_money2" type="hidden" id="drop_money22">
  345.           下注金额:</div></td>
  346.         <td width="100" height="20" nowrap><input name="drop_moneys" type="text" class="input" id="drop_moneys3" onKeyPress="event.returnValue=Isnum();" onKeyUp="win_money();" onBlur="win_money();" size="10" maxlength="10">
  347.         /组            </td>
  348.       </tr>
  349.       <tr>
  350.         <td><div align="right">总下注金额:</div></td>
  351.         <td height="20"><div id="amoney" class="fred12" align="right">0 </div></td>
  352.       </tr>
  353.       <tr>
  354.         <td><div align="right">可赢金额:</div></td>
  355.         <td height="20"><div id="winmoney" class="fred12" align="right">0 </div></td>
  356.       </tr>
  357.       <tr>
  358.         <td><div align="right">最低限额:</div></td>
  359.         <td height="20"><div align="right"> 
  360.             <?=$minrmb?>
  361.         </div></td>
  362.       </tr>
  363.       <tr>
  364.         <td><div align="right">单号限额:</div></td>
  365.         <td height="20"><div align="right">
  366.             <?=$units?>
  367.        </div></td>
  368.       </tr>
  369.       <tr>
  370.         <td><div align="right">单项限额:</div></td>
  371.         <td height="20"><div align="right">
  372.             <?=$maxrmb?>
  373.        </div></td>
  374.       </tr>
  375.       <tr>
  376.         <td><div align="right">已使用信用:</div></td>
  377.         <td height="20" align="right"><?=rmb($used)?></td>
  378.       </tr>
  379.       <tr>
  380.         <td height="29" colspan="2"><div align="center">
  381. <input name="drop_ratea" type="hidden" id="drop_rate4" value="<?=$rate?>">
  382.             <input name="drop_detailsa" type="hidden" id="drop_details4" value="<?=$check?>">
  383.             <input name="drop_contenta" type="hidden" id="drop_content3" value="<?=$among?>">
  384.             <input name="Submit" type="button" class="buttonrmin" value="取消下注" onClick="javascript:window.location.href='uleft.php';">
  385.             <input name="Submit2" type="submit" class="buttongmin" value="确定下注">            
  386.         </div></td>
  387.       </tr>
  388.     </table></td>
  389.   </tr>
  390.   <tr>
  391.     <td height="23" class="t12"><div id="jump" align="center" class="t12"></div></td>
  392.   </tr> <script>
  393. function countDown(secs)
  394. {
  395. var tv;
  396. jump.innerText="更新秒数:"+secs+" 秒";
  397. if(--secs>0)
  398. tv=setTimeout("countDown("+secs+")",1000);
  399. }
  400. countDown(<?=$update_time?>);
  401. </script>
  402.   </form>
  403. </table>
  404. <?php }?>
  405. <p>&nbsp;</p>
  406. <p>&nbsp;</p>