<?php
	$acl=$_SESSION["acl"];
	if (strlen($acl)<1 || !strpos($acl,"<2023>")) {	//没有权限
		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">
<p align="center">
<?php
	$timestr=strftime("%Y-%m-%d %H:%M:%S");
	$userid=trim($_REQUEST["userid"]);
	if ($userid!="") {						//必须输入用户ID
		$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 userid from users where userid='".$userid."' and checked='y'",$db );
		if ($row = mysql_fetch_array($rs)) {
			mysql_free_result($rs);
			mysql_query( "update users set checked='n',deletetime='' where userid='".$userid."'",$db );
			mysql_query( "insert into operation values('".$_SESSION["operator"]."','".$timestr."','恢复注销用户，用户ID：".$userid."')",$db );
			echo("恢复注销成功！");
		}
		else {
			mysql_free_result($rs);
			echo("错误，该注销用户ID不存在！");
		}
		mysql_close($db);
	}
	else {
		echo("必须输入需要恢复注销的用户ID");
	}
?>
</p>
<hr>
<p align="center">SIP宽带上网计费管理系统</p>
<p align="center">作者：<b>深圳市飞沃软件有限公司</b></p>

</body>

</html>
