Exemple #1
0
 function action_login_as()
 {
     $request = \PtLib\http_request("uid");
     $uid = $request['uid'];
     $user = \PtLib\db_select_row("select n.* from users as u left join new_users as n on n.id = u.app_uid where n.id = ?", $uid);
     $user_info = array("nick_name" => $user['nickname'] ? $user['nickname'] : ($user['mobile'] ? $user['mobile'] : $user['email']), "mobile" => $user['mobile'], "email" => $user['email'], "uid" => $user['id']);
     Model_User_Auth::set_login($user_info);
     \PtLib\location("/user/index");
 }
Exemple #2
0
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand site-logo" href="/">易衫网</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">


            <ul class="nav navbar-nav">
                <li><a href="/design" class="design">开始设计</a></li>
                <!--<li><a href="/invite">邀请朋友</a></li>-->
            </ul>
            <?php 
if (Model_User_Auth::is_logined()) {
    $uid = Model_User_Abstract::get_uid();
    $user = \PtLib\db_select_row("select * from users where id = ?", $uid);
    ?>
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="/user/order/index">我的订单</a></li>
                    <li><a href="/user/activity/index">我的活动</a></li>
                    <li class="dropdown  pull-right">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">你好,<?php 
    echo $user['nick_name'];
    ?>
 <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="/user/setting/profile">账户设置</a></li>
                            <li class="divider"></li>
                            <li><a href="/api?model=user/auth&action=logout">注销</a></li>
                        </ul>
                    </li>
Exemple #3
0
 /**
  * @param $id
  * @return array
  */
 static function detail($id)
 {
     $table = self::$table;
     $row = PtLib\db_select_row("select * from {$table} where id = ?", $id);
     return $row;
 }
Exemple #4
0
<!-- Navigation -->
<aside id="menu">
    <div id="navigation">
        <div class="profile-picture">
            <?php 
$uid = Model_User_Abstract::get_uid();
$user = PtLib\db_select_row("select u.id,u.app_uid,u.nick_name,n.photo from users as u left join new_users as n on n.id = u.app_uid where u.id = ?", $uid);
?>
            <a href="/user/index">
                <img style="width: 50px;height:50px" src="<?php 
echo empty($user['photo']) ? "/static/images/no-photo.png" : $user['photo'];
?>
" class="img-circle m-b" alt="logo">
            </a>

            <div class="stats-label text-color">
                <span class="font-extra-bold"><?php 
echo $user['nick_name'];
?>
</span>
                <div class="dropdown" style="margin-top: 10px;">
                    <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                        <small class="text-muted">注册用户 <b class="caret"></b></small>
                    </a>
                    <ul class="dropdown-menu animated fadeInLeft m-t-xs">
                        <li><a href="/user/setting/profile">个人资料</a></li>
                        <li><a href="/user/setting/address">收货地址</a></li>
                       <li class="divider"></li>
                        <li><a href="/api?model=user/auth&action=logout">退出</a></li>
                    </ul>
                </div>