<?php
require ('authentication_user.php');
?>
<?php

/* 取：用户名片 */
/* 162100源码 - 162100.com */


$_GET['username'] = strtolower(trim($_GET['username']));
$_GET['username'] = str_replace('.', '&#46;', $_GET['username']);
if (!preg_match('/^([^\x00-\x7f]|\w|&#46;){3,45}$/', $_GET['username'])) :
  $err .= '用户名不合法！';
else :

  if (!isset($sql['db_err'])) {
    db_conn();
  }

  if ($sql['db_err'] == '') {

    $result = @mysql_query('SELECT * FROM '.$sql['pref'].''.$sql['data']['承载成员档案的表名'].' WHERE username="'.$_GET['username'].'" LIMIT 1', $db);
    if (!$row = @mysql_fetch_assoc($result)) {
      $err = '查不到用户'.$_GET['username'].'的信息！';
	} else {
      if ($row['check_reg'] == '1') {
        $err = '用户'.$_GET['username'].'尚在注册审核中！';
      }
      if ($row['check_reg'] == '2') {
        $err = '用户'.$_GET['username'].'已经被置入黑名单！';
      }
    }
    @mysql_free_result($result);

  } else {
    $err .= $sql['db_err'];
  }

  require ('inc/function/add_online.php'); //在线
  @mysql_close();

endif;

if (empty($err)) {
?>
<br />
<br />

<style type="text/css">
<!--
#card { width:454px }
#card_top { width:432px; min-height:252px; padding:10px; border:1px #666666 solid; background:#FFFFFF url(inc/images/about_card.png) 1px 1px no-repeat; }
h4 { margin:5px; font-size:150%; font-family:"黑体"; }
-->
</style>
<center>

    
<table width="459" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5" rowspan="2" id="card"><div id="card_top">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="120" align="left">&nbsp;</td>
          <td align="right"><h4><?php echo $row['company'] != '' ? '<a href="user.php?get=company&username='.urlencode($_GET['username']).'">'.$row['company'].'</a>' : '未留下公司名'; ?></h4></td>
        </tr>
        <tr>
          <td width="120" align="left">&nbsp;</td>
          <td align="right"><h4><?php echo $row['realname'] != '' ? $row['realname'] : '未留下姓名'; ?> <?php echo '（'.($row['sex'] != '' ? $row['sex'] : '未留下性别').'）'; ?></h4></td>
        </tr>
        <tr valign="top">
          <td width="120" align="left"><?php
      //$web['img_name_b'] = '162100userface_'.urlencode($_GET['username']);
      require ('inc/set/set_userface.php');
      echo '<span class="iface_s"><img src="obj.php?title=face-'.urlencode($_GET['username']).'.'.$web['img_up_format'].'" width="'.$web['img_w_b'].'" height="'.$web['img_h_b'].'" /></span>'; ?></td>
          <td align="left">邮箱：<?php echo POWER >= 1 ? $row['email'] : '<font color="#999999">该信息不对访客公开</font>'; ?><br />
            地址：<?php echo $row['address']; ?><br />
            邮编：<?php echo $row['zip']; ?><br />
            办公电话：<?php echo $row['hometel'] != '' ? (POWER >= 1 ? $row['hometel'] : '<font color="#999999">该信息不对访客公开</font>') : ''; ?><br />
            移动电话：<?php echo $row['handtel'] != '' ? (POWER >= 1 ? $row['handtel'] : '<font color="#999999">该信息不对访客公开</font>') : ''; ?><br />
            QQ：<?php echo $row['qq']; ?><br />
            网址：<?php echo !empty($row['sign']) ? '<a href="'.$row['sign'].'" target="_blank">'.$row['sign'].'</a>' : ''; ?></td>
        </tr>
      </table>
    </div></td>
    <td width="5" height="5"></td>
  </tr>
  <tr>
    <td width="5" height="267" bgcolor="#CCCCCC"></td>
  </tr>
</table>
<table width="459" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="5" height="5"></td>
    <td height="5" bgcolor="#CCCCCC"></td>
  </tr>
</table>
</center>
<?php
} else {
  echo $err;
}
?>