<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

$is_lnb_shop_mode = !empty($is_lnb_shop_mode);
$g5_lnb_now_total = isset($stats['now_total']) ? (int)$stats['now_total'] : 0;
$g5_lnb_thema = defined('THEMA') ? THEMA : 'Basic';
?>
<div class="pull-right" id="g5-lnb-right" data-g5-lnb-shop="<?php echo $is_lnb_shop_mode ? '1' : '0'; ?>" data-g5-lnb-thema="<?php echo get_text($g5_lnb_thema); ?>">
	<ul>
		<li style="padding:0 4px;">
			<button class="site-darkmode-btn" id="lnb-darkmode-btn" aria-label="다크/라이트 모드 전환" title="다크/라이트 모드 전환">
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"/></svg>
			</button>
		</li>
		<?php if($is_member) { // 로그인 상태 ?>
			<li><a href="javascript:;" onclick="sidebar_open('sidebar-user');"><b><?php echo $member['mb_nick'];?></b></a></li>
			<li class="lnb-logout-item"><a href="<?php echo $at_href['logout'];?>" class="lnb-logout-icon" title="로그아웃" aria-label="로그아웃" onclick="return lnbOpenLogoutConfirm(event, this.href);"><i class="fa fa-sign-out"></i></a></li>
			<?php if($member['admin']) {?>
				<li><a href="<?php echo G5_ADMIN_URL;?>">관리</a></li>
			<?php } ?>
			<?php if($member['partner']) { ?>
				<li><a href="<?php echo $at_href['myshop'];?>">판매자센터</a></li>
				<?php if(IS_SELLER) { ?>
					<li>
						<a href="<?php echo G5_SHOP_URL;?>/myshop.php?id=<?php echo urlencode($member['mb_id']);?>">마이샵</a>
					</li>
				<?php } ?>
			<?php } else { ?>
				<li><a href="<?php echo $at_href['myshop'];?>">판매자센터신규가입</a></li>
			<?php } ?>
			<li><a href="<?php echo $at_href['mypage'];?>">마이페이지</a></li>
			<?php if($is_lnb_shop_mode) { ?>
				<li class="tnb_cart"><a href="<?php echo $at_href['cart'];?>">장바구니 <b class="blue"><?php echo number_format($member['cart']);?></b></a></li>
				<?php if ($is_admin) { ?>
					<li><a href="<?php echo $at_href['connect'];?>">접속 <b class="blue"><?php echo number_format($g5_lnb_now_total); ?></b></a></li>
				<?php } ?>
			<?php } ?>
		<?php } else { // 로그아웃 상태 ?>
			<li><a href="<?php echo $at_href['login'];?>" onclick="sidebar_open('sidebar-user'); return false;">로그인</a></li>
			<li><a href="<?php echo $at_href['reg'];?>">회원가입</a></li>
			<li><a href="<?php echo $at_href['lost'];?>" class="win_password_lost">아이디/비밀번호 찾기	</a></li>
		<?php } ?>
		<?php if(IS_YC) { // 영카트 사용하면 ?>
			<li class="lnb-point-actions"><a href="<?php echo $at_href['point'];?>" target="_blank" class="win_point">보유포인트 <b class="blue"><?php echo number_format($member['mb_point']);?></b></a><a href="" onclick="redirectToPage('charge'); return false;" class="btn-g12a">충전</a><a href="" onclick="redirectToPage('withdraw'); return false;" class='btn-b12a'>출금</a></li>
		<?php } ?>
		<?php if($is_lnb_shop_mode) { ?>
			<?php if ($is_admin && !$is_member) { ?>
				<li><a href="<?php echo $at_href['connect'];?>">접속 <b class="blue"><?php echo number_format($g5_lnb_now_total); ?></b></a></li>
			<?php } ?>
		<?php } else { ?>
			<?php if ($is_admin) { ?>
				<li><a href="<?php echo $at_href['connect'];?>">접속 <b class="blue"><?php echo number_format($g5_lnb_now_total); ?></b></a></li>
			<?php } ?>
		<?php } ?>
	</ul>
</div>