<?php
	$acl=$_SESSION["acl"];
	if (strlen($acl)<1 || !strpos($acl,"<1007>")) {	//没有权限
		ob_clean();
		header("Location: accesserror.html");
		exit;
	}
?>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>组上网范围管理</title>
</head>

<body background="bkg.bmp">

<p align="center"><font size="5"><b>组上网范围管理</b></font></p>
<hr color="#999966">

<form>
<div align="center">
  <center>
  <table border="1" width="90%" bordercolor="#008080" cellspacing="0" cellpadding="0">
    <tr>
      <td width="28%">
        <p align="center">组别名称</td>
      <td width="43%">
        <p align="center">备注</td>
      <td width="29%">
        <p align="center">是否控制上网范围</td>
    </tr>
<?php
	$db=mysql_pconnect(get_cfg_var("SIPSERVER"),get_cfg_var("SIPUSER"),get_cfg_var("SIPPWD"));
	mysql_select_db(get_cfg_var("SIPDB"),$db);
	$rs = mysql_query( "select gpid,gpname,comment from groups",$db );
	while ($row = mysql_fetch_array($rs)) {
		$checkstr="";
		$rs1 = mysql_query( "select mode from useracl1 where userid='gp_".strval($row["gpid"])."'",$db );
		if ($row1 = mysql_fetch_array($rs1)) {
			$checkstr=" checked ";
		}
		mysql_free_result($rs1);
		echo("<tr><td width='28%'><a href=groupacl1.php?gpid=".strval($row["gpid"])."&gpname=".$row["gpname"].">".$row["gpname"]."</a></td><td width='43%'>".$row["comment"]."&nbsp;</td><td width='29%' align='center'><input type=checkbox".$checkstr." disabled=true></td></tr>");
	}
	mysql_free_result($rs);
    mysql_close($db);
?>
  </table>
  </center>
</div>
</form>

<hr>
<p align="center">SIP宽带上网计费管理系统</p>
<p align="center">作者：<b>深圳市飞沃软件有限公司</b></p>
</body>

</html>
