drate_tnum_check.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:5k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- include("../inc/conn.php");
- $_SESSION["menus"]="修改默认赔率";
- $minrmb=0.01;
- $maxrmb=1000;
- $check=@$_POST["check"];
- $znumber=@$_POST["tnumber"];
- $timep=date("YmdHis");
- $rs=$znumber;
- if($znumber=="a")
- {
- $znumber="特码A";
- }else
- {
- $znumber="特码B";
- }
- $list=split(",",$check);
- function outscript($arr)
- {
- echo "<script language='javascript'>".$arr."</script>";
- }
- $x=0;
- $msg=0;
- 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));
- if(substr($txt,0,1)=="0") $txt=substr($txt,1,strlen($txt));
- if($txt<>"") $checks.=$list[$i].",";
- $x+=1;
- $t+=$p.",";
- $sql=mysql_query("select * from dnum where sign='1' and num='$list[$i]' order by id asc",$conn);
- $rate=mysql_result($sql,0,"rate");
- if($rs=="a"):
- $droprate_t.=$rate.",";
- else:
- $droprate_t.=$rate.",";
- endif;
- $tmoney.=$txt.",";
- }
- }
- }
- for($i=1;$i<11;$i++)
- {
- $d="d".$i;
- $txtd=$_POST[$d];
- if($txtd<>"")
- {
- $f=$i;
- switch($f)
- {
- case "1":
- $cond.="1,";
- $tcontent="特单";
- break;
- case "2":
- $cond.="2,";
- $tcontent="特双";
- break;
- case "3":
- $cond.="3,";
- $tcontent="特大";
- break;
- case "4":
- $cond.="4,";
- $tcontent="特小";
- break;
- case "5":
- $cond.="5,";
- $tcontent="合单";
- break;
- case "6":
- $cond.="6,";
- $tcontent="合双";
- break;
- case "7":
- $cond.="7,";
- $tcontent="总单";
- break;
- case "8":
- $cond.="8,";
- $tcontent="总双";
- break;
- case "9":
- $cond.="9,";
- $tcontent="总大";
- break;
- case "10":
- $cond.="10,";
- $tcontent="总小";
- break;
- }
- $sqld=mysql_query("select * from dnum where sign='2' and num='$f' order by id asc",$conn);
- $rated=mysql_result($sqld,0,"rate");
- $drate.=$rated.",";
- $dmoney.=$txtd.",";
- }
- }
- for($i=1;$i<4;$i++)
- {
- $c="c".$i;
- $txtc=$_POST[$c];
- if($txtc<>"")
- {
- $g=$i;
- switch($g)
- {
- case "1":
- $conc.="1,";
- $tcontent="红波";
- break;
- case "2":
- $conc.="2,";
- $tcontent="蓝波";
- break;
- case "3":
- $conc.="3,";
- $tcontent="绿波";
- break;
- }
- $sqlc=mysql_query("select * from dnum where sign='7' and num='$g' order by id asc",$conn);
- $ratec=mysql_result($sqlc,0,"rate");
- $crate.=$ratec.",";
- $cmoney.=$txtc.",";
- $ccontent.=$tcontent.",";
- }
- }
- if($checks<>"") //t
- {
- $msg=1;
- $drop_number_t=$checks;
- $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++)
- {
- $sqlg=mysql_query("select * from dnum where num='$a_t[$i]' and sign='1'",$conn); //变更更新
- if(mysql_num_rows($sqlg)<>0)
- {
- $gup=mysql_result($sqlg,0,"rate");
- mysql_query("update dnum set brate='$gup' where num='$a_t[$i]' and sign='1'",$conn);
- }
- mysql_query("update dnum set rate='$d_t[$i]',brate='$d_t[$i]',bnum='0',m='1',h='1',uptime='$timep' where num='$a_t[$i]' and sign='1'",$conn);
- }
- }
- if($cond<>"") //d
- {
- $msg=1;
- $drop_number_d=$cond;
- $drop_money_d=$dmoney;
- $a_d=split(",",$drop_number_d);
- $d_d=split(",",$drop_money_d);
- for($i=0;$i<count($a_d)-1;$i++)
- {
- $sqlgd=mysql_query("select * from dnum where num='$a_d[$i]' and sign='2'",$conn); //变更更新
- if(mysql_num_rows($sqlgd)<>0)
- {
- $gup=mysql_result($sqlgd,0,"rate");
- mysql_query("update dnum set brate='$gup' where num='$a_d[$i]' and sign='2'",$conn);
- }
- mysql_query("update dnum set rate='$d_d[$i]',brate='$d_t[$i]',bnum='0',m='1',h='1',uptime='$timep' where num='$a_d[$i]' and sign='2'",$conn);
- }
- }
- if($ccontent<>"") //c
- {
- $msg=1;
- $drop_number_c=$ccontent;
- $drop_money_c=$cmoney;
- $a_c=split(",",$drop_number_c);
- $d_c=split(",",$drop_money_c);
- for($i=0;$i<count($a_c)-1;$i++)
- {
- $sqlgc=mysql_query("select * from dnum where num='$a_c[$i]' and sign='7'",$conn); //变更更新
- if(mysql_num_rows($sqlgc)<>0)
- {
- $gup=mysql_result($sqlgc,0,"rate");
- mysql_query("update dnum set brate='$gup' where num='$a_c[$i]' and sign='7'",$conn);
- }
- mysql_query("update dnum set rate='$d_c[$i]',brate='$d_t[$i]',bnum='0',m='1',h='1',uptime='$timep' where tp='$a_c[$i]' and sign='7'",$conn);
- }
- }
- if($msg<>1)
- { outscript("alert('请输入赔率数!');window.location.href='drate_tnum.php';");
- }else
- {
- mysql_query("update member set update1='1'",$conn);
- echo outscript("window.location.href='drate_tnum.php'");
- }
- ?>