update header

This commit is contained in:
avene 2018-06-23 22:15:27 +08:00
parent 1ccf42d4a2
commit 7ad5f05e2e
1 changed files with 12 additions and 19 deletions

View File

@ -44,26 +44,19 @@
<a href="/about">关于我们</a>
</li>
</ul>
<?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
echo '<a href="/account" id="register">'.$user->username.'</a>';
if ($user->usertype=="administrator") echo '<li><a href="/admin"><i class="icon-cog"></i>后台</a></li> ';
echo '<li><a href="/data/order"><i class="icon-shopping-cart"></i>数据篮</a></li> <li><a href="/account/logout">注销</a></li>';
} else {
echo '<li><a href="/account/login"><i class="icon-user"></i>登录</a></li> <li><a href="/account/register">注册</a></li>';
} ?>
<!-- --><?php
// $auth = Zend_Auth::getInstance();
// if ($auth->hasIdentity()) {
// echo '<a href="/data/order" id="register">数据篮</a></li>';
// } else {
// echo '<a href="/account/login" id="login">登录</a>';
// } ?>
<!---->
<ul class="nav navbar-nav navbar-right">
<?php
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$user = $auth->getIdentity();
echo '<li><a href="/account">' . $user->username . '</a></li>';
if ($user->usertype == "administrator") echo '<li><a href="/admin"><i class="icon-cog"></i>后台</a></li> ';
echo '<li><a href="/data/order"><i class="icon-shopping-cart"></i>数据篮</a></li> <li><a href="/account/logout">注销</a></li>';
} else {
echo '<a href="/account/register" id="register">注册</a><a href="/account/login" id="login">登录</a>';
} ?>
</ul>
</div>
</div>
</nav>