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

Web服务器

开发平台:

PHP

  1. <?php
  2. session_start();
  3. include("checks.php");
  4. $agent=$_SESSION["all_agent"];
  5. $_SESSION["menus"]="会员管理";
  6. include("../inc/conn.php");
  7. include("../inc/base_status.inc.php");
  8. include("../inc/char.inc.php");
  9. $fct="";
  10. if(isset($_GET["fct"]))
  11. {
  12.  $fct=$_GET["fct"];
  13.  $id=$_GET["id"];
  14.  if($fct=="stop") mysql_query("update member set deleted='1' where ID='$id'",$conn);
  15.  if($fct=="use") mysql_query("update member set deleted='0' where ID='$id'",$conn);
  16. }
  17. $act="";
  18. if(isset($_GET["act"]))
  19. { $act=$_GET["act"];
  20.  if($act=="uselist")
  21.  {
  22.  $sq=" deleted='0' and all_agent='$agent' and m='0'";
  23.  }elseif($act=="stoplist")
  24.  {
  25.  $sq=" deleted='1' and all_agent='$agent' and m='0'";
  26.  }
  27. }else
  28. {
  29. $sq=" deleted='0' and all_agent='$agent' and m='0'";
  30. }
  31. if(isset($_GET["rank"]))
  32. {
  33. $rank=$_GET["rank"];
  34. if($rank=="time")
  35. {
  36.  $rk="reg_time";
  37. }elseif($rank=="name")
  38. {
  39. $rk="user_name";
  40. }elseif($rank=="credit")
  41. {
  42. $rk="user_credit";
  43. }elseif($rank=="login")
  44. {
  45. $rk="login_time";
  46. }
  47. }else
  48. {
  49. $rk="id";
  50. }
  51. if(isset($_GET["pusers"]))
  52. { $puser=trim($_GET["pusers"]);
  53.   $_SESSION["pusersu"]=$puser;
  54. }else $puser=$_SESSION["pusersu"];
  55. if(isset($puser))
  56. {
  57. $st=" agent='$puser' and ";
  58. }else $st="";
  59. $pagesize=15;
  60. $sqlc=mysql_query("select count(*) from member where $st all_agent='$agent'",$conn);
  61. $myrow=mysql_fetch_array($sqlc);
  62. $numrows=$myrow[0];
  63. $pages=intval($numrows/$pagesize);
  64. if ($numrows%$pagesize) $pages++;
  65. if (isset($_GET['page'])) 
  66. $page=intval($_GET['page']);
  67. }
  68. else{
  69. $page=1;
  70. }
  71. $offset=$pagesize*($page - 1); 
  72. $sql=mysql_query("select * from member where $st $sq order by $rk desc limit $offset,$pagesize",$conn); 
  73. ?>
  74. <head>
  75. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  76. <link href="../css/css.CSS" rel="stylesheet" type="text/css">
  77. <title></title>
  78. <style type="text/css">
  79. <!--
  80. body {
  81. margin-left: 10px;
  82. margin-right: 10px;
  83. }
  84. -->
  85. </style>
  86. <script language="JavaScript" type="text/JavaScript">
  87. <!--
  88. function MM_jumpMenu(targ,selObj,restore){ //v3.0
  89.   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  90.   if (restore) selObj.selectedIndex=0;
  91. }
  92. //-->
  93. </script>
  94. </head>
  95. <body>
  96. <table width="800" border="0" cellpadding="0" cellspacing="0" class="t12">
  97.   <tr bgcolor="#417dec">
  98.     <td width="9">&nbsp;</td>
  99.     <form name="form1">
  100.       <td bgcolor="#417dec" class="fw12"> <script>
  101. function countDown(secs)
  102. {
  103. clearTimeout();
  104. jump.innerText=secs+" 秒";
  105. if(--secs>0)
  106. setTimeout("countDown("+secs+")",1000);
  107. }
  108. </script>      <div align="right">
  109.   <table border="0" align="left" cellpadding="0" cellspacing="0">
  110.     <tr>
  111.       <td width="65" height="26"> <font color="#ffffff">会员管理</font> </td>
  112.       <td width="77"> <div align="center" class="fw12" ><?php 
  113.      if($act==""):
  114.      echo "启用列表";
  115.  elseif($act=="uselist"):
  116.  echo "启用列表";
  117.  elseif($act=="stoplist"):
  118.  echo "停用列表"; 
  119.  endif; ?>
  120.        </div></td>
  121.       <td width="427">          <select name="menu1" onChange="MM_jumpMenu('self',this,0)">
  122.         <option value="menber_manage.php?rank=time" <?php if(@$_GET["rank"]=="time") echo "selected";?>>按新增日期</option>
  123. <option value="menber_manage.php?rank=name"  <?php if(@$_GET["rank"]=="name") echo "selected";?>>按会员名称</option>
  124.         <option value="menber_manage.php?rank=credit" <?php  if(@$_GET["rank"]=="credit") echo "selected";?>>按信用额度</option>
  125.         <option value="menber_manage.php?rank=login"  <?php if(@$_GET["rank"]=="login") echo "selected";?>>按最后登录</option>
  126.       </select>
  127.         <font color="#FFFFFF">代理商</font>
  128.         <select name="menu2" onChange="MM_jumpMenu('self',this,0)">
  129. <?php
  130. $sqlw=mysql_query("select * from  agent where m='0' and all_agent='$agent' order by user_account asc",$conn);
  131. while($rsl=mysql_fetch_array($sqlw))
  132. ?>
  133.           <option value="menber_manage.php?pusers=<?=$rsl["user_account"]?>" <?php if($puser==$rsl["user_account"]) echo "selected";?>><?=$rsl["user_account"]?></option>
  134.   <? }?>
  135.         </select></td>
  136.       <td width="211"><div align="right"><a href="menber_manage.php?act=uselist" class="ah">启用列表</a> <a href="menber_manage.php?act=stoplist" class="ah">停用列表</a> <a href="menber_add.php" class="ah">新增</a> </div></td>
  137.     </tr>
  138.   </table>
  139.       </div></td>
  140.     </form>
  141.     <td width="11">&nbsp;</td>
  142.   </tr>
  143. </table>
  144. <table width="100%" height="62" border="0" align="center" cellpadding="0" cellspacing="0" class="tmove">
  145.   <tr>
  146.     <td height="62" valign="top"><table width="800" border="0" cellpadding="5" cellspacing="1" class="t12">
  147.       <tr class="t11">
  148.         <td><div align="center" class="fw12">所属代理商</div></td>
  149.         <td><div align="center" class="fw12">会员账号</div></td>
  150.         <td><div align="center" class="fw12">会员名称</div></td>
  151.         <td><div align="center" class="fw12">盘类</div></td>
  152.         <td><div align="center" class="fw12">信用额度</div></td>
  153.         <td><div align="center" class="fw12">新增日期</div></td>
  154.         <td><div align="center" class="fw12">登入次数</div></td>
  155.         <td><div align="center" class="fw12">最后登入</div></td>
  156.         <td><div align="center" class="fw12">状况</div></td>
  157.         <td><div align="center"></div>          
  158.           <div align="center" class="fw12">功能设定</div></td>
  159.         </tr><?php
  160. while($row=mysql_fetch_array($sql))
  161. {
  162. ?>
  163.       <tr class="t17">
  164.         <td><div align="center" class="fblue12"><?=$row["agent"]?></div></td>
  165.         <td><div align="center">
  166.           <?=$row["user_account"]?>
  167.           </div></td>
  168.         <td><div align="center">
  169.           <?=$row["user_name"]?>
  170.         </div></td>
  171.         <td><div align="center"><?=$row["user_plate"]?>盘</div></td>
  172.         <td><div align="center" class="fred12"><?=rmb($row["user_credit"])?></div></td>
  173.         <td><div align="center"><? echo substr($row["reg_time"],5)?></div></td>
  174.         <td><div align="center"><? echo $row["login_num"]?></div></td>
  175.         <td><div align="center"><? echo substr($row["login_time"],5)?></div></td>
  176.         <td><div align="center" class="fblue12"><a href="#" class="ags">
  177. <?
  178.  if($row["deleted"]=="0")
  179.  {
  180.  echo "<a href='menber_manage.php?fct=stop&id=".$row["ID"]."&act=uselist'>启用</a>";
  181.  }else
  182.  {
  183.  echo "<a href='menber_manage.php?fct=use&id=".$row["ID"]."&act=stoplist'>停用</a>";
  184.  }
  185.  ?></a></div></td>
  186.         <td><div align="center"></div>          
  187.           <div align="center"><a href="menber_modify.php?id=<?=$row["ID"]?>" target="_self" class="ags">修改</a> / <a href="menber_details.php?user=<?=$row["user_account"]?>&view=<?=$row["user_plate"]?>" class="ags">限额</a> </div></td>
  188.         </tr><? }?>
  189.       <tr class="t17">
  190.         <td colspan="10" class="t12"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  191.           <tr>
  192.             <form name="form1">
  193.               <td> 
  194.                   <? 
  195. $fp="menber_manage.php";
  196. $first=1;
  197. $prev=$page-1;
  198. $next=$page+1;
  199. $last=$pages;
  200. if ($page>1)
  201. {
  202. echo "<a href='".$fp."?page=".$first."' class='aw'>第一页</a>&nbsp;&nbsp;";
  203. echo "<a href='".$fp."?page=".$prev."' class='aw'>上一页</a>&nbsp;&nbsp;";
  204. }else
  205. {
  206.  echo "<font color='#ffffff'>第一页&nbsp;&nbsp;上一页</font>&nbsp;&nbsp;";
  207. }
  208. if ($page<$pages)
  209. {
  210. echo "<a href='".$fp."?page=".$next."' class='aw'>下一页</a>&nbsp;&nbsp;";
  211. echo "<a href='".$fp."?page=".$last."' class='aw'>最终页</a>&nbsp;&nbsp;";
  212. } else
  213. {
  214.  echo "<font color='#ffffff'>下一页&nbsp;&nbsp;最终页</font>&nbsp;&nbsp;";
  215. }
  216. $nums=$pagesize*$pages;
  217. ?>
  218.                   <span class="fw12"> 页次:</span>
  219.                   <select name="select" onChange="MM_jumpMenu('self',this,0)">
  220.                     <?php for ($i=1;$i<=$pages;$i++) 
  221. {
  222. if($page==$i)
  223. { $se="selected";
  224. }else $se="";
  225.                        echo "<option value='".$fp."?page=".$i."' ".$se.">".$i."</option>"; 
  226.    }
  227.         ?>
  228.                   </select>
  229.               </td>
  230.             </form>
  231.             <td><div align="right"><span class="fw12">共 <strong>
  232.                 <?=$pages?>
  233.             </strong> 页</span></div></td>
  234.           </tr>
  235.         </table></td>
  236.         </tr>
  237.     </table></td>
  238.   </tr>
  239. </table>
  240. </body>