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

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="jscript">
function checkdata()
{
    if (document.form1.gpname.value=="")
        alert("组别名不能为空");
    else
        document.form1.submit();
}
</script>
<title>修改用户组</title>
<body background="bkg.bmp" style="background-attachment: fixed; background-position-y:130;">
<p align="center"><font size="3"><b>修改用户组</b></font></p>
<center>
<?php
    $gpid=$_REQUEST["gpid"];
    if ($gpid!="") {
        $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 gpname,comment from groups where gpid=".$gpid,$db);		//读取用户组信息
		if ($row = mysql_fetch_array($rs)) {
?>
<form name="form1" method="POST" action="revisegp3.php">
<table border="1" bordercolor="#008080" cellspacing="0" cellpadding="0">
   <tr>
      <td align="center" width="100">
      组名<input type="hidden" name="gpid" value="<?php echo $gpid; ?>">
      </td>
      <td align="left" width="250">&nbsp;
      <input type="text" name="gpname" size="10" value="<?php echo $row["gpname"]; ?>" maxlength="50">
      </td>
   </tr>
   <tr>
      <td align="center" width="100">
      备注
      </td>
      <td align="left" width="250">&nbsp;
      <input type="text" name="comment" size="20" value=<?php echo $row["comment"]; ?>>
      </td>
   </tr>
   <tr>
      <td align="center" width="350" colspan="2">
      <input type="button" name="b1" value="确认" onclick="checkdata();">
      </td>
   </tr>
</table>
</form>
<?php   } else {
           echo("无效组别");
        }
        mysql_free_result($rs);
        mysql_close($db);
	 }
     else {
         echo("组别不能为空");
     }
?>
</center>
</body>

</html>
