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

<?php
	$userid="";
	$username="";
	$usertel="";
	$comment="";
	$deletetime="";
	$errno=1;
	$loginname=trim($_REQUEST["loginname"]);
	if ($loginname!="") {
		$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,username,usertel,comment,deletetime from users where checked='y' and loginname='".$loginname."'",$db);
		if ($row = mysql_fetch_array($rs)) {
			$userid=$row["userid"];
			$username=$row["username"];
			$usertel=$row["usertel"];
			$comment=$row["comment"];
			$deletetime=$row["deletetime"];
		}
	    else {
	       $errno=3;
		}
		mysql_free_result($rs);
		mysql_close($db);
	}
    else {
       $errno=2;
	}
?>

<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">

</SCRIPT>


<title>恢复注销用户</title>
</head>

<body background="bkg.bmp">

<p align="center"><font size="5"><b>恢复注销用户</b></font></p>
<hr color="#999966">
<div align="center">
<?php if ($errno==1) { ?>
  <form name=form1 method="POST" action="undeluser_result.php">
  <input type="hidden" name="userid" value="<?php echo $userid; ?>">
  <table border="1" width="584" height="183" bordercolor="#008080" cellspacing="0" cellpadding="0">
    <tr>
      <td width="173" align="center" height="50">注销用户ID</td>
      <td width="397" align="left" height="50">
          <p align="center"><?php echo $loginname; ?></p>
        </td>
    </tr>
    <tr>
      <td width="173" align="center" height="50">用户名称</td>
      <td width="397" align="left" height="50">
          <p align="center"><?php echo $username; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="173" align="center" height="50">联系方式</td>
      <td width="397" align="left" height="50">
          <p align="center"><?php echo $usertel; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="173" align="center" height="50">备注说明</td>
      <td width="397" align="left" height="50">
          <p align="center"><?php echo $comment; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="173" align="center" height="50">注销日期</td>
      <td width="397" align="left" height="50">
          <p align="center"><?php echo $deletetime; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td colspan="2" width="524" align="center" height="51"><input type="submit" value="确认恢复" name="B1"></td>
    </tr>
  </table>
  </form>
<?php } elseif ($errno==2) { ?>
<p>必须输入用户ID</p>
<?php } elseif ($errno==3) { ?>
<p>无效ID，或该用户没有被注销、不用恢复。</p>
<?php } ?>
</div>

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

</body>

</html>








