drate_right_num_check.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:1k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/conn.php");
- $_SESSION["menus"]="修改默认赔率";
- $user=$_SESSION["user"];
- $downdate=$_SESSION["downdate"];
- $minrmb=0.01;
- $maxrmb=1000;
- $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;
- }
- if($rmb_count==""||$rmb_count==0) outscript("alert('请输入赔率数额!');history.back(1);");
- for($i=0;$i<count($list)-1;$i++)
- {
- $p="t".$list[$i];
- $txt=@$_POST[$p];
- if($txt<>"")
- {
- if($txt<$minrmb)
- {
- outscript("alert('赔率最低限额为 ".$minrmb."');history.back(1);");
- }elseif($txt>$maxrmb)
- {
- echo outscript("alert('赔率最高限额为 ".$maxrmb."');history.back(1);");
- }else
- {
- if(substr($txt,0,1)=="0") $txt=substr($txt,1,strlen($txt));
- $sql=mysql_query("select * from num where sign='1' and num='$list[$i]' order by id asc",$conn);
- $rate=mysql_result($sql,0,"rate");
- $droprate_t.=$rate.",";
- $tmoney.=$txt.",";
- }
- }
- }
- if(isset($check))
- {
- $drop_number_t=$check;
- $drop_money_t=$tmoney;
- $a_t=split(",",$drop_number_t);
- $d_t=split(",",$drop_money_t);
- for($i=0;$i<count($a_t)-1;$i++)
- {
- mysql_query("update num set rate='$d_t[$i]' where num='$a_t[$i]' and sign='3'",$conn);
- }
- }
- echo outscript("window.location.href='rate_right_num.php?menu=3'");
- ?>