westdc-zf1/application/default/views/scripts/header.phtml

49 lines
2.0 KiB
PHTML
Executable File

<div class="header clear">
<div class="banner"></div>
<div class="nav">
<div class="search">
<span id="user"><?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
echo '<a href="/account/edit">'.$user->username.'</a> ';
if ($user->usertype=="administrator") echo '<a href="/admin">后台管理</a> ';
echo '<a href="/data/order">数据篮</a> <a href="/account/logout">注销</a>';
} else {
echo '<a href="/account/login">登录</a> <a href="/account/register">注册</a>';
}
?></span>
<span id="search">
<form id="search" enctype="application/x-www-form-urlencoded" action="/data/search" method="post">
<input type="text" name="q" id="q" class="keywords" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);">
<button type="submit" class="btn submit" onclick="">搜索</button>
<script>
function myfocus(element) {
if (element.value == '回车搜索标题和摘要') {
element.value = '';
}
}
function myblur(element) {
if (element.value == '') {
element.value = '回车搜索标题和摘要';
}
}
</script>
</form>
</span>
</div>
<div class="main" id="divNavi">
<ul>
<li><a href="/about"><span>关于本站</span></a></li>
<li><a href="/news"><span>工作动态</span></a></li>
<li><a href="/author"><span>数据管理</span></a></li>
<li><a href="/submit"><span>数据汇交</span></a></li>
<li><a href="/data"><span>数据与服务</span></a></li>
<li><a href="/"><span>首页</span></a></li>
</ul>
</div>
</div>
</div>