<?php
require("../../class/connect.php");
include("../../class/config.php");
include("../../class/q_functions.php");
include("../../class/db_sql.php");
include("../../class/user.php");
include("../../class/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
if($public_r['showinfolevel'])
{
	$user=islogin();
	if($level_r[$user[groupid]]['level']<$level_r[$public_r[showinfolevel]]['level'])
	{
		printerror("NotLevelShowInfo","",1);
	}
}
$userid=(int)$_GET['userid'];
if($userid)
{
	$where=$user_userid."='$userid'";
}
else
{
	$username=RepPostVar($_GET['username']);
	if(empty($username))
	{
		printerror("NotUsername","",1);
	}
	$utfusername=doUtfAndGbk($username,0);
	$where=$user_username."='$utfusername'";
}
$r=$empire->fetch1("select ".$user_userid.",".$user_username.",".$user_email.",".$user_group.",".$user_userfen.",".$user_userdate.",".$user_registertime." from ".$user_tablename." where ".$where." limit 1");
if(empty($r[$user_userid]))
{
	printerror("NotUsername","",1);
}
if(empty($username))
{
	$username=doUtfAndGbk($r[$user_username],1);
}
$email=doUtfAndGbk($r[$user_email],1);
$addr=$empire->fetch1("select truename,oicq,msn,`call`,phone,address,zip from {$dbtbpre}enewsmemberadd where userid='".$r[$user_userid]."' limit 1");
if($user_register)
{
	$registertime=date("Y-m-d H:i:s",$r[$user_registertime]);
}
else
{
	$registertime=$r[$user_registertime];
}
//oicq
if($addr['oicq'])
{
	$addr['oicq']="<a href='http://wpa.qq.com/msgrd?V=1&amp;Uin=".$addr['oicq']."&amp;Site=".$public_r['sitename']."&amp;Menu=yes' target='_blank'><img src='http://wpa.qq.com/pa?p=1:".$addr['oicq'].":4'  border='0' alt='QQ' />".$addr['oicq']."</a>";
}
db_close();
$empire=null;
$url="<a href=../../../>首页</a>&nbsp;>&nbsp;<a href=../cp>控制面板</a>&nbsp;>&nbsp;查看会员资料";
include("../../data/template/cp_1.php");
?>
<table width='100%' border='0' align='center' cellpadding='3' cellspacing='1' class="tableborder">
  <tr class="header"> 
    <td height="25" colspan="2">查看 
      <?=$username?>
      的会员资料</td>
  </tr>
  <tr>
    <td height="25" bgcolor="#FFFFFF">&nbsp;</td>
    <td height="25" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="3" cellspacing="1">
        <tr>
          <td> [ <a href="../msg/AddMsg?username=<?=$username?>" target="_blank">发短消息</a> 
            ] [ <a href="../friend/add?fname=<?=$username?>" target="_blank">加为好友</a> 
            ] [ <a href="javascript:history.go(-1);">返回上一页</a> ] </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td width='17%' height="25" bgcolor="#FFFFFF"> <div align='left'>用户名 </div></td>
    <td width='83%' height="25" bgcolor="#FFFFFF"> 
      <?=$username?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">会员等级</td>
    <td height="25" bgcolor="#FFFFFF">
      <?=$level_r[$r[$user_group]]['groupname']?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">注册时间</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$registertime?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF"> <div align='left'>邮箱</div></td>
    <td height="25" bgcolor="#FFFFFF"> <a href="mailto:<?=$email?>"> 
      <?=$email?>
      </a></td>
  </tr>
  <tr> 
    <td width="17%" height="25" bgcolor="#FFFFFF">姓名</td>
    <td width="83%" height="25" bgcolor="#FFFFFF"> 
      <?=$addr[truename]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">OICQ</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[oicq]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">MSN</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[msn]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">固定电话</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[call]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">移动电话</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[phone]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">联系地址</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[address]?>
    </td>
  </tr>
  <tr> 
    <td height="25" bgcolor="#FFFFFF">邮编</td>
    <td height="25" bgcolor="#FFFFFF"> 
      <?=$addr[zip]?>
    </td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td height="25"> <input type='button' name='Submit2' value='返回' onclick='history.go(-1)'></td>
  </tr>
</table>
<?
include("../../data/template/cp_2.php");
?>