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

Web服务器

开发平台:

PHP

  1. <?php
  2. session_start();
  3. include("checks.php");
  4. $all_agent=$_SESSION["all_agent"];
  5. include("../inc/conn.php");
  6. include("../inc/base_status.inc.php");
  7. include("../inc/char.inc.php");
  8. include("../inc/update_cuts.inc.php");
  9. $_SESSION["menus"]="查看代理商详细资料";
  10. if(isset($_GET["view"]))
  11. {
  12.  $view=$_GET["view"];
  13. }else $view="A";
  14. if(isset($_GET["user"]))
  15. {
  16.  $users=$_GET["user"];
  17.  $sql=mysql_query("select * from agent_cut where user_account='$users' and cut_plate='$view' order by sign asc",$conn);
  18. }
  19. if(isset($_POST["act"]))
  20. {   for($i=1;$i<=18;$i++)
  21.       $c="cut".$i;
  22.   $u="unit".$i;
  23.   $p="pour".$i;
  24.   $is="id".$i;
  25.   $cut=$_POST[$c];
  26.   $unit=$_POST[$u];
  27.   $pour=$_POST[$p];
  28.   $id=$_POST[$is];
  29.       update_agent($users,$view,$i,$cut,$unit,$pour);////更新代理下会员退水
  30.       mysql_query("update agent_cut set cut_num='$cut' where ID='$id'",$conn);
  31.   mysql_query("update agent_cut set unit_limit='$unit',pour_limit='$pour'  where user_account='$users' and sign='$i'",$conn);//ABC盘同步
  32.   } 
  33. echo "<script language='javascript'>window.location.href='agent_details.php?user=".$users."&view=".$view."'</script>";
  34. }
  35. ?>
  36. <script language="javascript">
  37. function Isnum()
  38. {
  39.   return ((event.keyCode >= 48) && (event.keyCode <= 57));
  40. }
  41.  function check(form)
  42.  {
  43.  <?php for($sign=1;$sign<=18;$sign++)
  44.  { $upf=unit_pours($users,2,$sign,$view);
  45.    $ur=split(",",$upf);
  46.    $runit_limit=$ur[0];  //单项限额
  47.    $rpour_limit=$ur[1];//单注限额
  48.    $runit=$ur[2];//限额类型
  49.   ?>
  50.   if(form.unit<?=$sign?>.value><?=$runit_limit?>)
  51.   {
  52.     alert("<?=$runit?> 单项限额不能大于<?=$runit_limit?>");
  53. form.unit<?=$sign?>.focus();
  54. return false;
  55.   }
  56.   if(form.pour<?=$sign?>.value><?=$rpour_limit?>)
  57.   {
  58.     alert("<?=$runit?> 单注限额不能大于<?=$rpour_limit?>");
  59. form.pour<?=$sign?>.focus();
  60. return false;
  61.   }
  62.   <? }?>
  63. }
  64. </script>
  65. <head>
  66. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  67. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  68. <title></title>
  69. <style type="text/css">
  70. <!--
  71. body {
  72. margin-left: 10px;
  73. }
  74. .STYLE1 {color: #FFFFFF}
  75. -->
  76. </style></head>
  77. <body>
  78. <form name="form2" method="post" action="agent_details.php?user=<?=$users?>&view=<?=$view?>" onSubmit="return check(this);">
  79.   <table width="700" height="48" border="0" align="left" cellpadding="0" cellspacing="0" class="tmove">
  80.     <tr>
  81.       <td width="700"  height="48" valign="top"><table width="100%" height="95" border="0" cellpadding="0" cellspacing="1" class="t12">
  82.           <tr>
  83.             <td height="22" colspan="7"><table width="694" height="26" border="0" cellpadding="0" cellspacing="0" bgcolor="#417dec">
  84.                 <tr>
  85.                   <td width="553" height="26" class="fw12"><strong>代理商详细设定 <a href="agent_details.php?user=<?=$users?>&view=A" <?php if($view=="B"||$view=="C") echo "class='ah'";?>>A盘</a> <a href="agent_details.php?user=<?=$users?>&view=B" <?php if($view=="A"||$view=="C") echo "class='ah'";?>>B盘</a> <a href="agent_details.php?user=<?=$users?>&view=C" <?php if($view=="B"||$view=="A") echo "class='ah'";?>>C盘</a>
  86.                         <input name="act" type="hidden" id="act" value="yes">
  87.                   </strong></td>
  88.                   <td width="141"><div align="center"><a href="agent.php" class="fwhit9pt STYLE1">返回上一页</a></div></td>
  89.                 </tr>
  90.             </table></td>
  91.           </tr>
  92.           <tr class="t11">
  93.             <td width="84" height="22"><div align="center" class="fw12">类型</div></td>
  94.             <td width="82"><div align="center" class="fw12">退水设定</div></td>
  95.             <td width="107"><div align="center" class="fw12">单项(号)限额</div></td>
  96.             <td width="74"><div align="center" class="fw12">单注限额</div></td>
  97.             <td width="103"><div align="center"><span class="fw12">原退水设定</span></div></td>
  98.             <td width="111"><div align="center"><span class="fw12">原单项(号)限额</span></div></td>
  99.             <td width="131"><div align="center"><span class="fw12">原单注限额</span></div></td>
  100.           </tr>
  101.           <?php 
  102. while($row=mysql_fetch_array($sql))
  103. { ?>
  104.           <tr class="t17">
  105.             <td height="23"><div align="right"><strong>
  106.                 <? if($row["cut_unit"]=="特码A")
  107. {
  108.  echo "特码";
  109. }else echo $row["cut_unit"];?>
  110.             </strong></div></td>
  111.             <td>
  112.               <div align="right">
  113.                 <select name="cut<?=$row["sign"]?>" id="select">
  114.                   <?php 
  115.   $agent_sign=$row["sign"];
  116.   $cut_plate=$row["cut_plate"];
  117.   $sqlh=mysql_query("select * from agent_cut where user_account='$all_agent' and sign='$agent_sign' and  cut_plate='$cut_plate'",$conn);
  118.   $asign=mysql_result($sqlh,0,"sign");
  119.   $n=0;
  120.   $num=mysql_result($sqlh,0,"cut_num");
  121.   if($asign=="1"||$asign=="5"||$asign=="18")
  122.  {
  123.    for($i=0;$i<=$num;$i+=0.5)
  124.    { 
  125.     if($asign=="5")
  126. { $ns="";
  127. }else $ns="";
  128.    $pn[$n]=$ns.$i;
  129.    $n++;
  130.    }
  131.   }elseif($asign=="18")
  132.   {
  133.   for($i=0;$i<=$num;$i++)
  134.    { 
  135.   $pn[$n]=$i;
  136.   $n++;
  137.    }
  138.   }else
  139.   {
  140.     for($i=0;$i<=$num;$i+=0.25)
  141.     { 
  142.      $pn[$n]=$i;
  143.     $n++;
  144.     }
  145.   }
  146.    for($k=0;$k<=count($pn)-1;$k++)
  147.    {
  148.     if($pn[$k]==$row["cut_num"])
  149. {
  150.  $se="selected";
  151. }else $se="";
  152.     echo "<option value='".$pn[$k]."' ".$se.">".$pn[$k]."</option>";
  153.    }
  154.    unset($pn);
  155.    ?>
  156.                 </select>
  157.             </div></td>
  158.             <td><div align="center" class="fbred">
  159.                 <input name="unit<?=$row["sign"]?>" type="text" class="input" id="unit<?=$row["sign"]?>" value="<?=$row["unit_limit"]?>" size="10" onKeyPress="event.returnValue=Isnum();">
  160.             </div></td>
  161.             <td><div align="center" class="fblue12">
  162.                 <input name="pour<?=$row["sign"]?>" type="text" class="input" id="pour<?=$row["sign"]?>" value="<?=$row["pour_limit"]?>" size="10" onKeyPress="event.returnValue=Isnum();">
  163.                 <input name="id<?=$row["sign"]?>" type="hidden" id="id<?=$row["sign"]?>" value="<?=$row["ID"]?>">
  164.                 <input name="sign<?=$row["sign"]?>" type="hidden" id="sign<?=$row["sign"]?>" value="<?=$row["sign"]?>">
  165.               </div>
  166.                 <div align="center" class="fred12"> </div></td>
  167.             <td><div align="center"><strong>
  168.                 <?=$row["cut_num"]?>
  169.             </strong></div></td>
  170.             <td><div align="center" ><strong><strong>
  171.                 <?=$row["unit_limit"]?>
  172.             </strong></strong></div></td>
  173.             <td><div align="center"><span ><strong><strong>
  174.                 <?=$row["pour_limit"]?>
  175.             </strong></strong></span></div></td>
  176.           </tr>
  177.           <?php }?>
  178.           <tr class="t17">
  179.             <td height="23" colspan="7" class="t11"><div align="center"><span class="fred12">
  180.                 <input type="reset" name="Submit2" value=" 重置 ">
  181. &nbsp;
  182.                 <input type="submit" name="Submit" value=" 修改 ">
  183.             </span></div></td>
  184.           </tr>
  185.       </table></td>
  186.     </tr>
  187.   </table>
  188.   <br>
  189.   <br>
  190. </form>
  191. <br>
  192. <br>
  193. <iframe name=yyes id="yyes" src="" frameborder="0" width="0" scrolling="no" height="0"  ></iframe>
  194. </body>