<?
$C_126cmsadmin_tname = 'group_config';

include(dirname(__FILE__)."/global.php");




@$job=$submitted_vars['job'];

$gptype = $submitted_vars['gptype'];


if($job == "del"){
   
   $id = $_GET['id'];
   $query="DELETE FROM `w6_admin` WHERE `id`='$id' ";
   $result=mysql_query($query) or die( mysql_error() );

   if ($result)
     {
       $showmsg = "删除成功！";
	   $formurl = "group_list.php?gptype=$gptype";
     }
  else
     {
       $showmsg = "删除失败！";
	   $formurl = "group_list.php?gptype=$gptype";
     }
	 
  include('showmsg.php');
  exit;
  
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: underline;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
.font_hs {
	color: #999999;
}
-->
</style>
</head>

<body>
<div align="center" class="font12">
  <table width="100%"  border="0" cellpadding="3" cellspacing="1" bgcolor="#A4B6D7">
    <tr>
      <td width="100%" height="22" align="center" background="images/titlebg.jpg">&nbsp;</td>
    </tr>
  </table>
  <br />
  <table width="100%" height="25" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td align="left" bgcolor="#FFFFFF"> [<a href="group.php" class="a_bt">后台管理组</a>] </td>
    </tr>
  </table>
  <br />
  <br />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tr>
      <td height="22" align="left" class="head">后台管理组编辑</td>
    </tr>
    <tr>
      <td height="24" align="left">
	  <br /></td>
    </tr>
    <tr>
      <td align="center">
	  <FORM name="formlist" action="" method="post">
  <table width="99%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td width="4%" height="30" align="center" background="images/titlebg.jpg">ID</td>
          <td width="18%" align="center" background="images/titlebg.jpg">用户名</td>
          <td width="17%" align="center" background="images/titlebg.jpg">日期</td>
          <td width="12%" align="center" background="images/titlebg.jpg">IP</td>
          <td width="16%" align="center" background="images/titlebg.jpg">电子邮箱</td>
          <td width="12%" align="center" background="images/titlebg.jpg">用户权限</td>
          <td width="11%" align="center" background="images/titlebg.jpg">修改</td>
          <td width="10%" align="center" background="images/titlebg.jpg">删除</td>
        </tr>
		        
		<?
		
	$query="SELECT * FROM `w6_admin` WHERE `gptype` = '$gptype'";

  	//echo "<br>".$query."<br><br><br><br>aaaa<br><br><br><br>";
  	$result=mysql_query($query) or die("Could not connect: " . mysql_error());
	//
  	$num=mysql_num_rows($result);
	
	$url = '?job='.$job.'&fid='.$fid.'&mid='.$module_id.'&type='.$type.'&keyword='.$keyword;
  	$page = isset($_GET['page']) ? $_GET['page'] : 1;  //当前页
	$showpage = getpage($url,$article_page_size,$num,$page);
    $query=$query." ORDER BY `id` DESC  LIMIT ".(($page-1)*$article_page_size)." , $article_page_size ";
    
	//echo "<br>".$query."<br><br><br><br>2aaaa<br><br><br><br>";

  	$result=mysql_query($query);
  	while($row=mysql_fetch_array($result))
  	{
  	$id      =  stripslashes($row["id"]);
  	$gptype      =  stripslashes($row["gptype"]);
  	$userid      =  stripslashes($row["userid"]);
  	$email      =  stripslashes($row["email"]);
  	$row['logintime'] != 0 ? $logintime = '登录时间:'.date("Y-m-d H:i",$row['logintime']) : $logintime = '';
  	$loginip       =  stripslashes($row["loginip"]);
	
	if($gptype==1){
		$gptype_str = '超级管理员';
	}else if($gptype==2){
		$gptype_str = '管理员';
	}else if($gptype==3){
		$gptype_str = '网站编辑';
	}
	

?>

        <tr class=trA onMouseOver="this.className='trB'" onmouseout="this.className='trA'">
          <td align="center" class="td" style="color: #FF0000;"><?=$id?></td>
          <td align="left" class="td" style="color:;"><?=$userid?> </td>
          <td align="center" class="td"><?=$logintime?> </td>
          <td align="center" class="td"><?=$loginip?> </td>
          <td align="center" class="td"><?=$email?> </td>
          <td align="center" class="td"><?=$gptype_str?> </td>
          <td align="center" class="td"><a href="group_add.php?job=edit&id=<?=$id?>"><font color="#0000FF">修改</font></a></td>
          <td align="center" class="td"><a href="group_list.php?job=del&id=<?=$id?>&gptype=<?=$gptype?>"><font color="#0000FF">删除</font></a></td>
	     </tr>
<?
}
?>            
		        <tr>
          <td height="30" colspan="8" align="center">&nbsp;</td>
        </tr>
      </table>
	  </form></td>
    </tr>
  </table>
  </div>
</body>
</html>
