<?php if(isset($user) && is_array($user)) { ?>

<a class="user-head-dropdown aa toogle" data-toggle="dropdown" >
	<img src="{$user['headimage']}" class="img-responsive img-circle headimage pull-left" width="30"><span class="login-txt">{lang('membercenter')}</span>
	<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-user">
	<?php if(count(pay::getInstance()->getrows())>1 ||
	(count(pay::getInstance()->getrows())==1 && count(pay::getInstance()->getrows('pay_code="nopay"'))==0) ){ ?>
	<li>
		<a rel="external nofollow" href="{url('manage/orderslist/manage/orders')}" target="_blank" class="top-reg">
			<i class="icon-list"></i> {lang('order')}
		</a>
	</li>
	<li>
		<a rel="external nofollow" href="{url('manage/consumptionlist/manage/consumption')}" target="_blank" class="top-reg">
			<i class="icon-wallet"></i> {lang('finance')}
		</a>
		<a href="{url('archive/consumption')}" class="paycheck">
			{lang('recharge')}
		</a>

	</li>
	<li>
		<a href="{url('archive/orders')}">
			<i class="icon-basket"></i> {lang('shoppingcart')}
		</a>
	</li>
	<?php } ?>
	<li>
		<a rel="external nofollow" href="{url('manage/collectlist/manage/user')}" target="_blank" class="top-reg">
			<i class="icon-heart"></i> {lang('collection')}
		</a>
	</li>
	<li>
		<a href="{url('user/index')}">
			<i class="icon-user"></i> {lang('membercenter')}
		</a>
	</li>
	{if $user['groupid']=='2'}<li>
	<a rel="external nofollow" href="{$admin_url}" target="_blank" class="top-login">
		<i class="icon-grid"></i> {lang('admin_login')}
	</a>
	</li>{/if}
	<li class="line"></li>
	<li>
		<a href="{url('user/edit/table/user')}">
			<i class="icon-note"></i> {lang('edituserinfo')}
		</a>
	</li>
	<li>
		<a href="{url('user/logout')}">
			<i class="icon-logout"></i> {lang('logout')}
		</a>
	</li>
</ul>


<?php }else{ ?>
<div class="user-panel">
	<a rel="external nofollow" title="{lang('login')}" href="{url('user/login/loginurl/1')}" class="top-login">{lang('login')}</a>
	<a class="top-reg" rel="external nofollow" title="{lang('register')}" href="{url('user/register')}">{lang('register')}</a>
</div>
<?php } ?>