<?php

/* 用户信息页 */
/* 162100源码 - 162100.com - download.162100.com */


@ require ('inc/set/set.php');
@ require ('inc/set/set_sql.php');
@ require ('inc/function/confirm_power.php');
//身份验证
define('POWER', confirm_power());
$userface = user_class(POWER, $session[3]);

function get_li_mode($area_index) {
  global $web;
  if (!isset($area_index) || empty($area_index)) {
    return $web['sitemode'];
  } elseif (strstr($area_index, $web['sitemode'])) {
    return $web['sitemode'];
  } else {
    $sitemode = false;
    foreach (@explode('|', $area_index) as $mode) {
      if (file_exists('inc/css/'.$mode.'/index.php') && file_exists('inc/css/'.$mode.'/list.php') && file_exists('inc/css/'.$mode.'/article.php')) {
        $sitemode = $mode == $web['sitemode'] ? $web['sitemode'] : $mode;
        break;
      }
    }
    return $sitemode ? $sitemode : $web['sitemode'];
  }
}

$_GET['username'] = @ $_GET['username'];
$power_url = array(
  'card'       => '成员 &gt; '.$_GET['username'].'的名片',
  'company'    => '商号 &gt; ',
  'list'       => '成员 &gt; '.$_GET['username'].'发布的信息',
  'reply'      => '成员 &gt; '.$_GET['username'].'发布的回复',
  'credit'     => '成员 &gt; '.$_GET['username'].'的信誉值',
  'door'       => '',
);

if ($_GET['username'] == '') {
  die('&#29992;&#25143;&#21442;&#25968;&#32570;&#22833;&#25110;&#20986;&#38169;&#65292;&#35831;&#20174;<a href="./">&#39318;&#39029;</a>&#20174;&#26032;&#24320;&#22987;');
}
if (! @$_GET['get']) {
  $_GET['get'] = 'door';
} else {
  if (!isset($power_url[$_GET['get']])) {
    die('&#26080;&#27492;&#21629;&#20196;&#65281;');
  }
}

$title = $power_url[$_GET['get']];

$row = array();
if (!isset($sql['db_err'])) {
  db_conn();
}
if ($sql['db_err'] == '') {
  if ($_GET['get'] == 'company') { //单独处理商号
    $result = @mysql_query('SELECT * FROM '.$sql['pref'].''.$sql['data']['承载成员档案的表名'].' WHERE username="'.$_GET['username'].'" LIMIT 1', $db);
    $row = @mysql_fetch_assoc($result);
    @mysql_free_result($result);
    $title .= !empty($row['company']) ? $row['company'] : $row['username'].'尚未登记';
  }
  @ require ('inc/function/add_online.php'); //在线
}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title, $web['code_author']; ?></title>
<link id="my_style" rel="stylesheet" type="text/css" href="inc/css/<?php echo $web['sitemode']; ?>/style.css">
<script language="javascript" src="inc/js/main.js" type="text/javascript"></script>
</head>
<body>
<div id="session" class="session">
<button type="button" onclick="window.open('write.php?mode=<?php echo $web['sitemode']; ?>','_blank');" title="发布文章"><b><div class="send_write"></div></b></button>
<?php
if ($_GET['username'] == 'admin') {
  $_GET['username'] = $web['manager'];
}

@ include ('inc/require/head.txt');
?>
  &nbsp;
</div>
<?php
if ($web['siteclose'] > 1) {
  @include ('inc/require/siteclose_why.txt');
}
?>
<div id="logo"><a href="<?php echo $web['path']; ?>"><img src="<?php echo $web['sitelogo']; ?>" /></a></div>
<div id="banner"> <a href="./">首页</a> <a href="list_company.php">商号</a> <a href="list_member.php" class="column_is">成员</a> <a href="list_online.php">在线</a> <a href="help.php">帮助</a>
    <?php @include ('inc/css/'.$web['sitemode'].'/banner.txt'); ?>
</div>
<div class="column">
  <h5><a href="./">首页</a> &gt; <?php echo $title; ?></h5>
</div>
<table width="100%" height="400" border="0" cellspacing="0" cellpadding="0" id="menu">
  <tr>
    <td valign="top" id="leftmenu" class="leftmenu"><strong>成员资料</strong>
        <ul>
          <li><a id="bar-card" href="user.php?get=card&username=<?php echo urlencode($_GET['username']); ?>"><?php echo $_GET['username']; ?>的名片</a></li>
          <li><a id="bar-company" href="user.php?get=company&username=<?php echo urlencode($_GET['username']); ?>"><?php echo $_GET['username']; ?>的商号</a></li>
        </ul>
      <strong>成员发表</strong>
        <ul>
          <li><a id="bar-list" href="user.php?get=list&username=<?php echo urlencode($_GET['username']); ?>"><?php echo $_GET['username']; ?>发布的文章</a></li>
          <li><a id="bar-reply" href="user.php?get=reply&username=<?php echo urlencode($_GET['username']); ?>"><?php echo $_GET['username']; ?>发布的回复</a></li>
        </ul>
      <strong>成员信息</strong>
        <ul>
          <li><a id="bar-credit" href="user.php?get=credit&username=<?php echo urlencode($_GET['username']); ?>"><?php echo $_GET['username']; ?>的信誉值</a></li>
          <li><a id="bar-mess" href="member.php?get=mess&username=<?php echo urlencode($_GET['username']); ?>">给<?php echo $_GET['username']; ?>发送短信</a></li>
        </ul>

</td>
    <td valign="top" class="rightmenu"><?php
      //<!-- require -->

      if (file_exists('inc/run/get_user_'.$_GET['get'].'.php')) {
        require ('inc/run/get_user_'.$_GET['get'].'.php');
        echo '<script> try { if ($("bar_id_") != null) { $("bar_id_").id = ""; } $("bar-'.$_GET['get'].'").parentNode.id = "bar_id_"; } catch (err) {} </script>';
      } else {
        echo '<img src="inc/images/i.gif" /> 对应命令'.$_GET['get'].'的文件不见了！请<a href="javascript:window.history.back();">返回</a>。';
      }

      //<!-- /require -->

      ?>
    </td>
  </tr>
</table>
<div id="foot">
  <?php @include ('inc/css/'.$web['sitemode'].'/foot.txt'); ?>
</div>
<?php
//检测数据库连接
if (isset($sql['db_err']) && $sql['db_err'] != '') {
  echo '<div id="submit_safe" class="filter"><table width="100%" height="100%"><tr><td><div id="submit_safe_in">'.$sql['db_err'].'</div></td></tr></table></div>';
}
?>

</body>
</html>