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

Web服务器

开发平台:

PHP

  1. <?php
  2. session_start();
  3. include("checks.php");
  4. include("../inc/conn.php");
  5. include("../inc/base_status.inc.php");
  6. include("../inc/char.inc.php");
  7. if(isset($_GET["act"]))
  8. {
  9.  $id=$_POST["id"];
  10.  $user_name=$_POST["user_name"];
  11.  $pwd1=$_POST["pwd1"];
  12.  $pwd2=$_POST["pwd2"];
  13.  $user_plate=$_POST["user_plate"];
  14.  $user_credit=$_POST["user_credit"];
  15.  $old_credit=$_POST["old_credit"];
  16.  $agents=$_POST["agent"];
  17.  $tb_right=$_POST["tb_right"];
  18.  $used_credits=$user_credit-$old_credit;   // 额差
  19. // echo $used_credits
  20.  $drop_type=$_POST["drop_type"];
  21.  $password=md5($pwd1);
  22.  if($pwd1<>$pwd2)
  23.  { 
  24.   echo "<script language='javascript'>alert('两次密码不一致!');window.location.href='menber_modify.php?id=".$id."';</script>";
  25.  }else
  26.  { if($pwd1==""&&$pwd2=="" )
  27.     {
  28.       $sqlyes=mysql_query("update member set user_name='$user_name',user_plate='$user_plate',user_credit='$user_credit',drop_type='$drop_type',tb_right='$tb_right' where ID='$id'",$conn);//used_credit='$used_credits',
  29.     }else   $sqlyes=mysql_query("update member set user_name='$user_name',user_password='$password',user_plate='$user_plate',user_credit='$user_credit',drop_type='$drop_type',tb_right='$tb_right' where ID='$id'",$conn);
  30.    if($sqlyes)
  31.    {
  32.     mysql_query("update agent set used_credit=used_credit+$used_credits where user_account='$agents'",$conn);
  33.     echo "<script language='javascript'>alert('修改成功!');window.location.href='menber_manage.php';</script>";
  34.    }else
  35.    {
  36.     echo "<script language='javascript'>alert('修改失败,请重新修改!');window.location.href='menber_modify.php?id=".$id."'</script>";
  37.    }
  38.  }
  39. }
  40. $id=$_GET["id"];
  41. $sqlv=mysql_query("select * from member where id='$id'",$conn);
  42. $user_account=mysql_result($sqlv,0,"user_account");
  43. $user_name=mysql_result($sqlv,0,"user_name");
  44. $user_plate=mysql_result($sqlv,0,"user_plate");
  45. $user_credit=mysql_result($sqlv,0,"user_credit");
  46. $agent=mysql_result($sqlv,0,"agent");
  47. $drop_type=mysql_result($sqlv,0,"drop_type");
  48. $tb_right=mysql_result($sqlv,0,"tb_right");
  49. ?>
  50. <script language="javascript">
  51. function check(form)
  52. {
  53.   if(form.user_name.value=="")
  54.   {
  55.     alert('请输入用户名称!');
  56. return false;
  57. form.user_name.focus();
  58.   }
  59.   if(form.user_credit.value=="")
  60.   {
  61.     alert('请输入额度!');
  62. return false;
  63. form.user_credit.focus();
  64.   }
  65.    if(parseFloat(form.user_credit.value)>parseFloat(form.can_credit.value))
  66.   {
  67.     alert('开设额度不能越过可用额度 '+form.can_credit.value+'!');
  68. return false;
  69. form.user_credit.focus();
  70.   }
  71. }
  72. </script><script language="javascript">
  73. function Isnum(){
  74.   return ((event.keyCode >= 48) && (event.keyCode <= 57));
  75. }
  76. </script>
  77. <head>
  78. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  79. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  80. <title></title>
  81. <style type="text/css">
  82. <!--
  83. body {
  84. margin-left: 10px;
  85. }
  86. .STYLE1 {color: #FFFFFF}
  87. -->
  88. </style></head>
  89. <body>
  90. <table width="645" height="91" border="0" align="left" cellpadding="0" cellspacing="0" class="tmove">
  91.   <tr>
  92.     <td height="91" valign="top"><table width="645" height="127" border="0" cellpadding="0" cellspacing="0" class="t17">
  93.       <tr bgcolor="#417dec">
  94.         <td width="553" height="22"><strong class="fw12"> 修改会员</strong></td>
  95.         <td width="92" bgcolor="#417dec"><a href="menber_manage.php" class="fwhit9pt STYLE1">返回上一页</a></td>
  96.       </tr>
  97.       <tr> <form name="form2" method="post" action="menber_modify.php?act=yes" onSubmit="return check(this);">
  98.         <td colspan="2"><div align="right"></div>          
  99.           <div align="center">
  100.             <table width="100%" height="207" border="0" cellspacing="1">
  101.               <tr>
  102.                 <td height="22"><div align="right">代理商:</div></td>
  103.                 <td><div align="left">
  104.                   <?=$agent?>
  105.                   <input name="id" type="hidden" id="id" value="<?=$id?>"> 
  106.   <?php 
  107.    $sqlcc=mysql_query("select * from agent where user_account='$agent'",$conn);
  108.    $user_creditm=mysql_result($sqlcc,0,"user_credit");
  109.    $used_credit=mysql_result($sqlcc,0,"used_credit");
  110.    $low_credit=$user_creditm-$used_credit;
  111.    $tb_right_f=mysql_result($sqlcc,0,"tb_right");
  112.  ?>
  113.                   <input name="agent" type="hidden" id="agent" value="<?=$agent?>">
  114. </div></td>
  115.               </tr>
  116.               <tr>
  117.                 <td width="16%" height="22"><div align="right">账号:</div></td>
  118.                 <td width="84%"><div align="left">
  119.                   <?=$user_account?>
  120.                 </div></td>
  121.               </tr>
  122.               <tr>
  123.                 <td height="24"><div align="right">会员名称:</div></td>
  124.                 <td><div align="left">
  125.                   <input name="user_name" type="text" class="input" id="user_name" value="<?=$user_name?>" size="15" maxlength="15">
  126. </div></td>
  127.               </tr>
  128.               <tr>
  129.                 <td><div align="right">密码:</div></td>
  130.                 <td><div align="left">
  131.                   <input name="pwd1" type="password" class="input" id="pwd1" size="15" maxlength="15">
  132.                   <span class="fred12">密码框为空,则默认为原密码</span></div></td>
  133.               </tr>
  134.               <tr>
  135.                 <td height="25"><div align="right">确认密码:</div></td>
  136.                 <td><div align="left">
  137.                   <input name="pwd2" type="password" class="input" id="pwd2" size="15" maxlength="15">
  138.                 </div></td>
  139.               </tr>
  140.               <tr>
  141.                 <td><div align="right">开放盘别:</div></td>
  142.                 <td><div align="left">
  143.                   <select name="user_plate" id="user_plate">
  144.                     <option value="A" <?php if($user_plate=="A") echo "selected";?>>A盘</option>
  145.                     <option value="B" <?php if($user_plate=="B") echo "selected";?>>B盘</option>
  146.                     <option value="C" <?php if($user_plate=="C") echo "selected";?>>C盘</option>
  147.                   </select>
  148.                 </div></td>
  149.               </tr>
  150.               <tr>
  151.                 <td height="26"><div align="right">投注方式:</div></td>
  152.                 <td><div align="left"><select name="drop_type" id="drop_type">
  153.                     <option value="信用额度" <? if($drop_type=="信用额度") echo "selected" ?> >信用额度</option>
  154.                     <option value="现金投注" <? if($drop_type=="现金投注") echo "selected" ?>>现金投注</option>
  155.                   </select>
  156.                     </div></td>
  157.               </tr>
  158.               <tr>
  159.                 <td height="26"><div align="right">信用额度:</div></td>
  160.                 <td><div align="left"><input name="user_credit" type="text" class="input" id="user_credit" value="<?=$user_credit?>" size="15" maxlength="15" ONKEYPRESS="event.returnValue=Isnum();">
  161.                   
  162.                 (可用额度 <span class="fred12">
  163.                 <?=$low_credit?>
  164.                 </span>)
  165.                 <input name="can_credit" type="hidden" id="can_credit3" value="<? echo $low_credit+$user_credit?>">                
  166.                 <input name="old_credit" type="hidden" id="old_credit2" value="<?=$user_credit?>">
  167.                 </div></td>
  168.               </tr>
  169.   <tr>
  170.                 <td><div align="right">特码B:</div></td>
  171.                 <td><select name="tb_right" id="tb_right" <? if($tb_right_f==0){?>disabled="disabled"<? }?>>
  172. <option value="0" <? if($tb_right==0){?>selected<? }?>>禁止</option>
  173. <option value="1" <? if($tb_right==1){?>selected<? }?>>允许</option>
  174.                 </select></td>
  175.               </tr>
  176.               <tr>
  177.                 <td><div align="right"></div></td>
  178.                 <td><div align="left">
  179.                       <input type="submit" name="Submit" value="确认修改">  
  180.                       <input type="reset" name="Submit2" value="重置">                  
  181.                     </div></td>
  182.               </tr>
  183.             </table>
  184.            
  185.            
  186.             </div></td> </form>
  187.         </tr>
  188.     </table></td>
  189.   </tr>
  190. </table>
  191. <p>&nbsp;</p>
  192. <p>&nbsp;</p>
  193. </body>