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

Web服务器

开发平台:

PHP

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