<?php if($d['layout']['dsp_side_login']):?>
<?php if(is_file($g['path_module'].'social/var/var.php')) include_once $g['path_module'].'social/var/var.php'?>
<?php if($my['uid']):?>

<?php if($d['layout']['dsp_side_menu']):?>
<?php if($d['layout']['dsp_topmenu']):?>

<?php $_MENUS2=getDbSelect($table['s_menu'],'site='.$s.' and parent='.(int)$g['nowFMemnu'].' and hidden=0 and depth=2 order by gid asc','*')?>
<?php $_MENUSN=db_num_rows($_MENUS2)?>
<?php if($_MENUN || (!$d['layout']['dsp_side_menuhide']&&$_CA[0])):?>
<?php $_SIDEPARENT=getDbData($table['s_menu'],'uid='.(int)$g['nowFMemnu'],'uid,name')?>
<div class="submenu-card">
	<div class="submenu-title"><span class="submenu-title-icon" aria-hidden="true">&#8599;</span><strong><?php echo htmlspecialchars($_SIDEPARENT['name']?$_SIDEPARENT['name']:'메뉴',ENT_QUOTES,'UTF-8')?></strong></div>
<ul class="submenu">
<?php $_i=0;while($_M2=db_fetch_array($_MENUS2)):$_i++?>
<li class="<?php if($_M2['id']==$_CA[0]):$g['nowSMemnu']=$_M2['uid']?>open<?php endif?><?php if($_MENUSN==$_i):?> _last<?php endif?>"><a href="<?php echo RW('c='.$_CA[0].'/'.$_M2['id'])?>" target="<?php echo $_M2['target']?>"<?php if($_M2['id']==$_CA[1]):?> class="on"<?php endif?>><?php echo $_M2['name']?></a>
<?php if(($_HM['uid']==$_M2['uid']||$_HM['parent']==$_M2['uid'])&&$_M2['isson']):?>
<ul>
<?php $_MENUS3=getDbSelect($table['s_menu'],'site='.$s.' and parent='.$_M2['uid'].' and hidden=0 and depth=3 order by gid asc','*')?>
<?php while($_M3=db_fetch_array($_MENUS3)):?>
<li><a href="<?php echo RW('c='.$_CA[0].'/'.$_CA[1].'/'.$_M3['id'])?>" target="<?php echo $_M3['target']?>"<?php if($_M3['uid']==$_HM['uid']):?> class="on"<?php endif?>><?php echo $_M3['name']?></a></li>
<?php endwhile?>
</ul>
<?php endif?>
</li>
<?php endwhile?>
<?php if(!$_MENUSN):?>
<li class="_last none">서브메뉴가 없습니다.</li>
<?php endif?>
</ul>
</div>
<?php endif?>
<?php else:?>

<?php $_MENUS2=getDbSelect($table['s_menu'],'site='.$s.' and hidden=0 and depth=1 order by gid asc','*')?>
<?php $_MENUSN=db_num_rows($_MENUS2)?>
<div class="submenu-card">
	<div class="submenu-title"><span class="submenu-title-icon" aria-hidden="true">&#8599;</span><strong><?php echo htmlspecialchars($_HS['name']?$_HS['name']:'전체메뉴',ENT_QUOTES,'UTF-8')?></strong></div>
<ul class="submenu">
<?php $_i=0;while($_M2=db_fetch_array($_MENUS2)):$_i++?>
<li class="<?php if($_M2['id']==$_CA[0]):$g['nowSMemnu']=$_M2['uid']?>open<?php endif?><?php if($_MENUSN==$_i):?> _last<?php endif?>"><a href="<?php echo RW('c='.$_M2['id'])?>" target="<?php echo $_M2['target']?>"<?php if($_M2['id']==$_CA[0]):?> class="on"<?php endif?>><?php echo $_M2['name']?></a>
<?php if(($_HM['uid']==$_M2['uid']||$_HM['parent']==$_M2['uid'])&&$_M2['isson']):?>
<ul>
<?php $_MENUS3=getDbSelect($table['s_menu'],'site='.$s.' and parent='.$_M2['uid'].' and hidden=0 and depth=2 order by gid asc','*')?>
<?php while($_M3=db_fetch_array($_MENUS3)):?>
<li><a href="<?php echo RW('c='.$_CA[0].'/'.$_M3['id'])?>" target="<?php echo $_M3['target']?>"<?php if($_M3['uid']==$_HM['uid']):?> class="on"<?php endif?>><?php echo $_M3['name']?></a></li>
<?php endwhile?>
</ul>
<?php endif?>
</li>
<?php endwhile?>
<?php if(!$_MENUSN):?>
<li class="_last none">메뉴가 등록되지 않았습니다.</li>
<?php endif?>
</ul>
</div>
<?php endif?>
<?php endif?>


<div class="mbrinfo">
	<div class="symbol tooltip"><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;mod=mypage&amp;page=simbol"><img src="<?php echo $g['s']?>/_var/simbol/<?php echo $my['photo']?$my['photo']:'0.gif'?>" alt="" /></a>
	<span class="<?php if($d['layout']['dsp_side']=='left'):?>_right _r150<?php else:?>_left _l150<?php endif?> _w150">클릭하시면 회원님의 사진을 등록하실 수 있습니다.<i></i></span>
	</div>
	<div class="name">
		<div class="namel"><?php echo $my[$_HS['nametype']]?>님</div>
		<div class="namer">
			<?php if($d['layout']['sns_hide']):?>
			<a href="<?php echo RW('mod=mypage')?>"><img src="<?php echo $g['img_layout']?>/btn_config.gif" alt="" /></a>
			<?php else:?>
			<a href="#." onclick="getLayerBox('<?php echo $g['s']?>/?r=<?php echo $r?>&m=social&page=account','소셜계정',600,650,event,true,'<?php echo $d['layout']['dsp_side']=='left'?'r':'l'?>');"><img src="<?php echo $g['img_layout']?>/btn_config1.gif" alt="" /></a>
			<?php endif?>
			<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;a=logout"><img src="<?php echo $g['img_layout']?>/btn_logout.gif" alt="" /></a>
		</div>
	</div>
	<div class="clear"></div>
	<div class="score">
		<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;mod=mypage&amp;page=point">포인트 <?php echo number_format($my['point'])?>P</a> / 가입 <?php echo getDateFormat($my['d_regis'],'Y.m.d')?>
	</div>
</div>
<?php getWidget('_acc/biorhythm',array())?>
<?php else:?>
<div class="logout">
	<div class="tabbox">
		<?php if($d['layout']['sns_hide']):?>
		<div class="np">회원 로그인</div>
		<?php else:?>
		<div class="tp vline on" onclick="tabCheck(1,this);">일반 로그인</div>
		<div class="tp" onclick="tabCheck(2,this);">소셜 로그인</div>
		<div class="clear"></div>
		<?php endif?>
	</div>
	<div id="nlogLayer" class="nlog">
		<form name="LayoutLogForm" action="<?php echo $g['s']?>/" method="post" onsubmit="return layoutLogCheck(this);">
		<input type="hidden" name="r" value="<?php echo $r?>" />
		<input type="hidden" name="a" value="login" />
		<div class="i1 tooltip">
		<input type="text" name="id" value="<?php echo getArrayCookie($_COOKIE['svshop'],'|',0)?>" class="input" title="아이디" />
		<input type="checkbox" name="idpwsave" value="checked" class="checkbox"<?php if($_COOKIE['svshop']):?> checked="checked"<?php endif?> /> 정보기억
		<span class="<?php if($d['layout']['dsp_side']=='left'):?>_right _r150<?php else:?>_left _l150<?php endif?> _w150">정보기억에 체크할 경우 다음접속시 아이디와 패스워드를 입력하지 않으셔도 됩니다.<br />그러나, 개인PC가 아닐 경우 타인이 로그인할 수 있습니다.<br />PC를 여러사람이 사용하는 공공장소에서는 체크하지 마세요.<i></i></span>
		<div class="clear"></div>
		</div>
		<div class="i1">
		<input type="password" name="pw" value="<?php echo getArrayCookie($_COOKIE['svshop'],'|',1)?>" class="input" title="패스워드" />
		<button type="submit" class="submit">로그인</button>
		<div class="clear"></div>
		</div>
		</form>
		<div class="rbtm">
			<a href="<?php echo RW('mod=join')?>" class="b">회원가입</a> <span>|</span>
			<a href="<?php echo $g['s']?>/?r=<?php echo $r?>&amp;mod=login&amp;page=idpwsearch" class="ipc">아이디/패스워드찾기</a>
		</div>
	</div>
		<div id="slogLayer" class="slog hide">
			<div class="icon">
			<?php foreach(array('naver'=>'N','google'=>'G','facebook'=>'f','x'=>'X') as $_socialKey=>$_socialMark):?>
			<?php if(!empty($d['social']['use_'.$_socialKey])):?><button type="button" title="<?php echo $_socialKey?> 로그인" style="width:36px;height:36px;margin:2px;border:0;border-radius:5px;cursor:pointer;font-weight:bold;" onclick="window.open('<?php echo $g['s']?>/?r=<?php echo $r?>&amp;m=social&amp;page=oauth&amp;provider=<?php echo $_socialKey?>','jusq_social_login','width=620,height=720,scrollbars=yes');"><?php echo $_socialMark?></button><?php endif?>
			<?php endforeach?>
			</div>
			<div class="guide">
				네이버, 구글, 페이스북 또는 X 계정으로 로그인할 수 있습니다.
			</div>
	</div>
</div>
<?php endif?>
<?php endif?>





<?php if($d['layout']['adtype']):?>
<div class="banner">
<?php if($d['layout']['adtype']==1):?><a href="<?php echo $d['layout']['ad_imglink']?>" target="<?php echo $d['layout']['ad_imgtarget']?>"><img src="<?php echo $g['url_layout'].'/_var/'.$d['layout']['ad_img']?>" width="220" style="width:220px;height:auto;max-width:100%;" alt="" /></a><?php endif?>
<?php if($d['layout']['adtype']==2):?><embed src="<?php echo $g['url_layout'].'/_var/'.$d['layout']['ad_swf']?>" width="220"></embed><?php endif?>
<?php if($d['layout']['adtype']==3) include $g['path_layout'].$d['layout']['dir'].'/_var/_ad.txt'?>
</div>
<?php endif?>
<div class="banner">
<?php getWidget('_acc/weather',array())?>
</div>
<!-- <div class="banner">
<?php getWidget('_acc/tag01',array('title'=>'태그','limit'=>'25','term'=>'14',))?>
</div> -->
<div class="banner">
<?php getWidget('_acc/hotkeyword',array(
    'title'=>'인기 검색어',
    'subtitle'=>'지금 많이 찾는 키워드',
    'limit'=>'10',
    'term'=>'7'
))?>
</div>
<?php if($d['layout']['dsp_side_hot']):?>
<div class="hotbox">
	<div class="tabbox">
		<div class="tp vline on" onclick="tabCheck_s(1,this,'_myHOTlayer_','<?php echo $d['layout']['dsp_side_hotnum']?>');">많이 본 글</div>
		<div class="tp" onclick="tabCheck_s(2,this,'_myHOTlayer_','<?php echo $d['layout']['dsp_side_hotnum']?>');">댓글 많은 글</div>
		<div class="clear"></div>
	</div>
	<div id="_myHOTlayer_" class="hbody">
		<ul>
		<?php $_date=date('YmdHis',mktime(0,0,0,substr($date['today'],4,2),substr($date['today'],6,2)-30,$date['year']))?>
		<?php $_RCD=getDbArray($table['bbsdata'],'site='.$s.' and display=1 and d_regis > '.$_date,'*','hit','desc',$d['layout']['dsp_side_hotnum'],1);?>
		<?php $_i=0;while($_R=db_fetch_array($_RCD)):$_i++?>
		<li><i<?php if($_i<4):?> class="emp"<?php endif?>><?php echo $_i?></i><a href="<?php echo getPostLink($_R)?>"><?php echo $_R['subject']?></a><?php if($_R['comment']+$_R['oneline']):?><span>(<?php echo $_R['comment']+$_R['oneline']?>)</span><?php endif?></li>
		<?php endwhile?>
		</ul>
	</div>
</div>
<?php endif?>
