agent.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:8k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- session_start();
- include("checks.php");
- $agent=$_SESSION["all_agent"];
- include("../inc/conn.php");
- include("../inc/base_status.inc.php");
- include("../inc/char.inc.php");
- $_SESSION["menus"]="代理商管理";
- if(isset($_GET["fct"]))
- {
- $fct=$_GET["fct"];
- $id=$_GET["id"];
- $users=$_GET["luser"];
- if($fct=="stop")
- { mysql_query("update agent set deleted='1' where ID='$id'",$conn);
- mysql_query("update member set deleted='1' where agent='$users'",$conn);
- }elseif($fct=="use")
- {
- mysql_query("update agent set deleted='0' where ID='$id'",$conn);
- mysql_query("update member set deleted='0' where agent='$users'",$conn);
- }
- }
- $act="";
- if(isset($_GET["act"]))
- { $act=$_GET["act"];
- if($_GET["act"]=="uselist")
- {
- $sq="where deleted='0' and m='0' and all_agent='$agent'";
- }elseif($_GET["act"]=="stoplist")
- {
- $sq="where deleted='1' and m='0' and all_agent='$agent'";
- }
- }else
- {
- $sq="where deleted='0' and m='0' and all_agent='$agent'";
- }
- if(isset($_GET["rank"]))
- {
- $rank=$_GET["rank"];
- if($rank=="time")
- {
- $rk="reg_time";
- }elseif($rank=="name")
- {
- $rk="user_name";
- }elseif($rank=="credit")
- {
- $rk="user_credit";
- }elseif($rank=="login")
- {
- $rk="login_time";
- }
- }else
- {
- $rk="id";
- }
- $pagesize=15;
- $sqlc=mysql_query("select count(*) from agent where m='0' and deleted='0' and all_agent='$agent'",$conn);
- $myrow=mysql_fetch_array($sqlc);
- $numrows=$myrow[0];
- $pages=intval($numrows/$pagesize);
- if ($numrows%$pagesize) $pages++;
- if (isset($_GET['page']))
- {
- $page=intval($_GET['page']);
- }
- else{
- $page=1;
- }
- $offset=$pagesize*($page - 1);
- $sql=mysql_query("select * from agent $sq order by $rk desc limit $offset,$pagesize",$conn);
- ?>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href="../css/css.CSS" rel="stylesheet" type="text/css">
- <title></title>
- <style type="text/css">
- <!--
- body {
- margin-left: 0px;
- margin-right: 10px;
- }
- -->
- </style>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- function MM_jumpMenu(targ,selObj,restore){ //v3.0
- eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
- if (restore) selObj.selectedIndex=0;
- }
- //-->
- </script>
- </head>
- <body>
- <table width="800" border="0" cellspacing="0" cellpadding="0">
- <tr bgcolor="#417dec">
- <td width="9"> </td>
- <form name="form1">
- <td class="fw12"> <script>
- function countDown(secs)
- {
- clearTimeout();
- jump.innerText=secs+" 秒";
- if(--secs>0)
- setTimeout("countDown("+secs+")",1000);
- }
- </script> <div align="right">
- <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
- <tr>
- <td width="64" height="26"><span class="fw12">代理商管理</span> </td>
- <td width="61"><div align="center" class="fw12" ><?php
- if($act==""):
- echo "启用列表";
- elseif($act=="uselist"):
- echo "启用列表";
- elseif($act=="stoplist"):
- echo "停用列表";
- endif; ?>
- </div></td>
- <td width="18"> </td>
- <td width="490"> </td>
- <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>
- </tr>
- </table>
- </div></td>
- </form>
- <td width="11"> </td>
- </tr>
- </table>
- <table width="100%" height="62" border="0" align="center" cellpadding="0" cellspacing="0" class="tmove">
- <tr>
- <td height="62" valign="top"><table width="800" border="0" cellpadding="5" cellspacing="1" class="t12">
- <tr class="t11">
- <td><div align="center" class="fw12">所属总理商</div></td>
- <td><div align="center" class="fw12">账号</div></td>
- <td><div align="center" class="fw12">名称</div> <div align="center" class="fw12"></div></td>
- <td class="fw12">会员数</td>
- <td><div align="center" class="fw12">信用额度</div></td>
- <td><div align="center" class="fw12">新增日期
- <select name="menu1" onChange="MM_jumpMenu('self',this,0)">
- <option value="agent.php?rank=time" selected>按新增日期</option>
- <option value="agent.php?rank=name">按会员名称</option>
- <option value="agent.php?rank=credit">按信用额度</option>
- <option value="agent.php?rank=login">按最后登录</option>
- </select>
- </div></td>
- <td><div align="center" class="fw12">登入次数</div></td>
- <td><div align="center" class="fw12">最后登入</div></td>
- <td><div align="center" class="fw12">状况</div></td>
- <td><div align="center"></div>
- <div align="center" class="fw12">功能设定</div></td>
- </tr><?php
- while($row=mysql_fetch_array($sql))
- {
- ?>
- <tr class="t17">
- <td><div align="center" class="fblue12"><?=$row["all_agent"]?></div></td>
- <td><div align="center">
- <?=$row["user_account"]?>
- </div></td>
- <td><div align="center">
- <?=$row["user_name"]?>
- </div> </td>
- <td> <div align="center"><?=anum($row["user_account"],1)?> </div></td>
- <td><div align="center" class="fred12"><?=rmb($row["user_credit"])?></div></td>
- <td><div align="center"><? echo substr($row["reg_time"],5)?></div></td>
- <td><div align="center"><? echo $row["login_num"]?></div></td>
- <td><div align="center"><? echo substr($row["login_time"],5)?></div></td>
- <td><div align="center" class="fblue12"><a href="#" class="ags">
- <?
- if($row["deleted"]=="0")
- {
- echo "<a href='agent.php?fct=stop&id=".$row["ID"]."&act=uselist&luser=".$row["user_account"]."'>启用</a>";
- }else
- {
- echo "<a href='agent.php?fct=use&id=".$row["ID"]."&act=stoplist&luser=".$row["user_account"]."'>停用</a>";
- }
- ?></a></div></td>
- <td><div align="center"></div>
- <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>
- </tr><? }?>
- <tr class="t17">
- <td colspan="10" class="t12"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <form name="form1">
- <td>
- <?
- $fp="result.php";
- $first=1;
- $prev=$page-1;
- $next=$page+1;
- $last=$pages;
- if ($page>1)
- {
- echo "<a href='".$fp."?page=".$first."' class='aw'>第一页</a> ";
- echo "<a href='".$fp."?page=".$prev."' class='aw'>上一页</a> ";
- }else
- {
- echo "<font color='#ffffff'>第一页 上一页</font> ";
- }
- if ($page<$pages)
- {
- echo "<a href='".$fp."?page=".$next."' class='aw'>下一页</a> ";
- echo "<a href='".$fp."?page=".$last."' class='aw'>最终页</a> ";
- } else
- {
- echo "<font color='#ffffff'>下一页 最终页</font> ";
- }
- $nums=$pagesize*$pages;
- ?>
- <span class="fw12"> 页次:</span>
- <select name="select" onChange="MM_jumpMenu('self',this,0)">
- <?php for ($i=1;$i<=$pages;$i++)
- {
- if($page==$i)
- { $se="selected";
- }else $se="";
- echo "<option value='".$fp."?page=".$i."' ".$se.">".$i."</option>";
- }
- ?>
- </select>
- </td>
- </form>
- <td><div align="right"><span class="fw12">共 <strong>
- <?=$pages?>
- </strong> 页</span></div></td>
- </tr>
- </table></td>
- </tr>
- </table></td>
- </tr>
- </table>
- </body>