<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/user.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"member");
$url="<a href=ListMemberGroup.php>管理会员组</a>&nbsp;&nbsp;(<a href=AddMemberGroup.php?enews=AddMemberGroup>增加会员组</a>)";
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理会员组</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
  <tr>
    <td>位置：<?=$url?></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  <tr class="header"> 
    <td width="6%" height="25"> <div align="center">ID</div></td>
    <td width="40%" height="25"> <div align="center">会员组名称</div></td>
    <td width="13%"><div align="center">级别值</div></td>
    <td width="13%" height="25"> <div align="center">本组会员数</div></td>
    <td width="12%"><div align="center">发送短信息</div></td>
    <td width="16%" height="25"> <div align="center">操作</div></td>
  </tr>
  <?
  $sql=$empire->query("select * from {$dbtbpre}enewsmembergroup order by level desc");
  while($r=$empire->fetch($sql))
  {
  //统计会员数
  $t=$empire->fetch1("select count(*) as total from ".$user_tablename." where ".$user_group."='$r[groupid]'");
  $total=$t[total];
  ?>
  <tr bgcolor="#FFFFFF"> 
    <td height="25"> <div align="center"> 
        <?=$r[groupid]?>
      </div></td>
    <td height="25"> <div align="center"> 
        <?=$r[groupname]?>
      </div></td>
    <td><div align="center"> 
        <?=$r[level]?>
      </div></td>
    <td height="25"> <div align="center"> 
        <?=$total?>
      </div></td>
    <td><div align="center"><a href="SendMsg.php?groupid=<?=$r[groupid]?>" target=_blank>发送信息</a></div></td>
    <td height="25"> <div align="center">[<a href="AddMemberGroup.php?enews=EditMemberGroup&groupid=<?=$r[groupid]?>">修改</a>] 
        [<a href="../enews.php?enews=DelMemberGroup&groupid=<?=$r[groupid]?>" onclick="return confirm('确认要删除此会员组？');">删除</a>]</div></td>
  </tr>
  <?
  }
  db_close();
  $empire=null;
  ?>
  <tr bgcolor="#FFFFFF"> 
    <td height="25" colspan="6">说明：级别值越高，查看信息的权限越大</td>
  </tr>
</table>
</body>
</html>
