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

Web服务器

开发平台:

PHP

  1. <?php 
  2. session_start();
  3. include("checks.php");
  4. include("../inc/conn.php");
  5. $_SESSION["menus"]="修改默认赔率";
  6. $sql=mysql_query("select * from dnum where sign='6' order by id asc",$conn);
  7. if(isset($_POST["id"]))
  8. { $id=$_POST["id"];
  9.   $rate=chop($_POST["rate"]);
  10.   $brate=chop($_POST["brate"]);
  11.    if($rate<>"")
  12.    {
  13.     $sqlgc=mysql_query("select * from dnum where ID='$id'",$conn);  //变更更新
  14. if(mysql_num_rows($sqlgc)<>0)
  15. {
  16.   $gup=mysql_result($sqlgc,0,"rate");
  17.   mysql_query("update dnum set brate='$gup' where ID='$id'",$conn);
  18. } $timep=date("YmdHis");
  19.   $ok=mysql_query("update dnum set rate='$rate',brate='$brate',m='1',h='1',uptime='$timep' where ID='$id'",$conn);
  20.   if($ok) echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='red'><strong>修改成功!</strong></font>";
  21.   echo "<meta http-equiv='refresh' content='3;URL=drate_animal_color.php?menu=6'>";
  22.   }else
  23.   {
  24.    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='red'><strong>请输入赔率!</strong></font>";
  25.   }
  26. }
  27. ?>
  28. <head>
  29. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  30. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  31. <title></title>
  32. <style type="text/css">
  33. <!--
  34. body {
  35. margin-left: 10px;
  36. }
  37. -->
  38. </style></head>
  39. <body>
  40. <?php include("drate_menu.inc.php");?>
  41. <br>
  42. <br>
  43. <table width="271" height="48" border="0" align="left" cellpadding="0" cellspacing="0" class="tmove">
  44.   <tr>
  45.     <td width="271" height="48" valign="top"><table width="271" height="48" border="0" cellpadding="0" cellspacing="1" class="t12">
  46.         <tr class="t11">
  47.           <td width="72" height="22"><div align="center" class="fw12">类型</div></td>
  48.           <td width="80"><div align="center" class="fw12">当前赔率</div></td>
  49.           <td width="115"><div align="center" class="fw12">修改赔率</div></td>
  50.         </tr>
  51.         <?php 
  52. while($row=mysql_fetch_array($sql))
  53. {
  54.         ?>
  55.         <form name="form2" method="post" action="drate_animal_color.php?menu=6">
  56.           <tr class="t17">
  57.             <td height="23"><div align="center"><strong>
  58.                 <?=$row["tp"]?>
  59.             </strong></div></td>
  60.             <td><div align="center"> <span class="fbred">
  61.                 <input name="brate" type="hidden" id="brate" value=" <?=$row["rate"]?>">
  62.                 <?=$row["rate"]?>
  63.                 </span>
  64.                     <input name="id" type="hidden" id="id2" value="<?=$row["ID"]?>">
  65.             </div></td>
  66.             <td><div align="center" class="fbred">
  67.                 <input name="rate" type="text" class="input" id="rate_num2" size="5" ONKEYPRESS="event.returnValue=Isnum();">
  68.                 <input type="submit" name="Submit" value="修改">
  69.             </div></td>
  70.           </tr>
  71.         </form>
  72.         <? }?>
  73.     </table></td>
  74.   </tr>
  75. </table>
  76. </body>