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

<?php
	$loginname="";
	$password="";
	$username="";
	$usertel="";
	$comment="";
	$ipaddr="";
	$createtime="";
	$usertype="";
	$timelength=0;
	$datalength=0;
	$userdept="";
	$daytime=0;
	$daydata=0;
	$mac="";
	$band="无限制";
	$userid=trim($_REQUEST["userid"]);
	if ($userid!="") {
		$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 loginname,password,username,usertel,comment,createtime,gpid,ipaddr,timelength,datalength,userdept,daytime,daydata,mac from users where userid='".$userid."'",$db );
		if ($row = mysql_fetch_array($rs)) {
			$loginname=$row[0];
			$password=$row[1];
			$username=$row[2];
			if ($username=="") {
			   $username="&nbsp;";
			}
			$usertel=$row[3];
			if ($usertel=="") {
			   $usertel="&nbsp;";
			}
			$comment=$row[4];
			if ($comment=="") {
			   $comment="&nbsp;";
			}
			$createtime=$row[5];
			$gpid=$row[6];
			$gpname="&nbsp";
			$ipaddr=$row[7];
			if ($ipaddr=="") {
			   $ipaddr="&nbsp";
			}
			$rs1=mysql_query("select gpname from groups where gpid=".strval($gpid),$db);
		    if ($row1 = mysql_fetch_array($rs1)) {
		       $gpname=$row1["gpname"];
		    }
			mysql_free_result($rs1);
			$timelength=$row[8];
			$datalength=$row[9];
			$userdept=$row[10];
			$daytime=$row[11];
			$daydata=$row[12];
			$mac=$row[13];
		}
		mysql_free_result($rs);
		$tmpband=0;
		$rs = mysql_query( "select bandwidth from userband where loginname='".$loginname."'",$db );
		if ($row = mysql_fetch_array($rs)) {
			$tmpband=$row["bandwidth"];
		}
		mysql_free_result($rs);
		if ($tmpband>0) {
			$bandname[1]="64K";
			$bandname[2]="128K";
			$bandname[3]="256K";
			$bandname[4]="512K";
			$bandname[5]="1M";
			$bandname[6]="2M";
			$bandname[7]="4M";
			$bandname[8]="8M";
			$bandname[9]="16M";
			$bandname[10]="32M";
			$bandname[11]="64M";
			$band=$bandname[$tmpband];
		}
		mysql_close($db);
	}
?>

<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 6.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">
  <table border="1" width="584" bordercolor="#008080" cellspacing="0" cellpadding="0">
    <tr>
      <td width="249" align="center" height="50">用户ID</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $loginname; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">用户密码</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $password; ?></p>
        </td>
    </tr>
        <tr>
      <td width="249" align="center" height="50">用户组别</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $gpname; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">用户名称</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $username; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">联系方式</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $usertel; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">用户部门</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $userdept; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">备注说明</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $comment; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">使用IP地址</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $ipaddr; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">使用MAC地址</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $mac; ?>&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">注册时间</td>
      <td width="642" align="left" height="50">
          <p align="center"><?php echo $createtime; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">每月时间限制</td>
      <td width="407" align="left" height="50">
       <p align="center"><?php echo $timelength; ?>小时</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">每月流量限制</td>
      <td width="642" align="left" height="50">
      <p align="center"><?php echo $datalength; ?>M</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">每天时间限制</td>
      <td width="407" align="left" height="50">
       <p align="center"><?php echo $daytime; ?>小时</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">每天流量限制</td>
      <td width="642" align="left" height="50">
      <p align="center"><?php echo $daydata; ?>M</p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">最大带宽</td>
      <td width="642" align="left" height="50">
      <p align="center"><?php echo $band; ?></p>
        </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">实际上网情况</td>
      <td width="642" align="center" height="50">
      <p align="center"><a href=queryhistory_result.php?userid=<?php echo $userid; ?> target=_blank>上网清单</a></p>
      </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">用户上网范围控制</td>
      <td width="642" align="center" height="50">
      <p align="center"><a href=useracl1.php?userid=<?php echo $userid; ?> target=_blank>上网范围</a></p>
      </td>
    </tr>
    <tr>
      <td width="249" align="center" height="50">用户每天允许上网时间</td>
      <td width="642" align="center" height="50">
      <p align="center"><a href=userallowtime1.php?userid=<?php echo $userid; ?> target=_blank>允许时间</a></p>
      </td>
    </tr>
  </table>
</div>

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

</body>

</html>











