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

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


$_GET['username'] = strtolower(trim($_GET['username']));
$_GET['username'] = str_replace('.', '&#46;', $_GET['username']);
$text_top = '暂无记录';
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);

    //取10条
    $result = @mysql_query('SELECT username,company FROM `'.$sql['pref'].''.$sql['data']['承载成员档案的表名'].'` WHERE company<>"" AND check_reg="0" ORDER BY id DESC LIMIT 15', $db);
    if (@mysql_num_rows($result) > 0) {
      $text_top = '<ul>';
      while ($row_top = @mysql_fetch_assoc($result)) {
        $text_top .= '<li><a href="user.php?get=company&username='.urlencode($row_top['username']).'" target="_blank">'.$row_top['company'].'</a></li>';
        unset($row_top);
      }
      $text_top .= '</ul>';
    }
    @mysql_free_result($result);

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

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

endif;
?>

<?php
if (empty($err)) {
?>
<h4><?php echo $row['company'] != '' ? $row['company'] : '<span class="grayword">未登记商号</span>'; ?></h4>
<div class="text"><?php echo $row['company_description'] != '' ? $row['company_description'] : '<span class="grayword">暂无公司简介</span>'; ?><?php @include ('inc/css/'.$web['sitemode'].'/ad_article_text_bottom.txt'); ?>
</div>
<?php
} else {
  echo '<div class="text"><div class="output">'.$err.'</div></div>';
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td><div class="column aline"><a href="user.php?get=card&username=<?php echo urlencode($row['username']); ?>"><strong>联系方式</strong></a></div></td>
    <td width="10">&nbsp;</td>
    <td><div class="column aline"><a href="list_company.php" target="_blank"><strong>更多商号</strong></a><br />
<?php echo $text_top; ?>
</div></td>
  </tr>
</table>



















