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

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);

$ca = isset($_GET['ca']) ? $_GET['ca'] : '';
?>

<style>
    #container_title {display: none;}
</style>

<div class="rb_prof">
    <ul class="rb_prof_info">
        <li class="rb_prof_info_img"><?php echo get_member_profile_img($mb['mb_id']); ?></li>
        <li class="rb_prof_info_txt"><!--구독자 549명 · -->게시물 <?php echo number_format(wr_cnt($mb['mb_id'], "w")); ?>개 · 댓글 <?php echo number_format(wr_cnt($mb['mb_id'], "c")); ?>개</li>
        <li class="rb_prof_info_nick font-B"><?php echo $mb['mb_nick'] ?> <span><?php echo $mb['mb_level'] ?> Lv</span></li>
        <?php if($mb_profile) { ?>
        <li class="rb_prof_info_txt"><?php echo $mb_profile ?></li>
        <?php } ?>
    </ul>
    <ul class="rb_prof_btn">
        <div id="bo_v_share">
        	<ul class="copy_urls">
                <li>

                    
                    
                    
                    <a href="javascript:void(0);" id="data-copy">
                       <img src="<?php echo $member_skin_url ?>/img/ico_sha.png" alt="공유링크 복사" width="32">
                    </a>
                    <!--
                    <a class="fl_btns" href="<?php echo G5_BBS_URL ?>/memo_form.php?me_recv_mb_id=<?php echo $mb['mb_id'] ?>" onclick="win_memo(this.href); return false;">쪽지</a>
                    -->
                    <?php if($mb['mb_id'] == $member['mb_id']) { ?>
                        <a class="fl_btns gd_btn" href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=<?php echo G5_BBS_URL ?>/register_form.php">정보수정</a>
                        <a class="fl_btns gd_btn" href="javascript:member_leave();">탈퇴</a>
                    <?php } else { ?>
                        <a class="fl_btns gd_btn" href="<?php echo G5_BBS_URL ?>/memo_form.php?me_recv_mb_id=<?php echo $mb['mb_id'] ?>" onclick="win_memo(this.href); return false;">쪽지보내기</a>
                    <!-- 
                        <a class="fl_btns gd_btn" href="javascript:void(0);">구독하기</a>
                    -->
                    <?php } ?>
                    
        	    </li>
        	    <?php
                $currents_url = G5_URL.$_SERVER['REQUEST_URI'];
                ?>
        	    <input type="hidden" id="data-area" class="data-area" value="<?php echo $currents_url ?>">
        	    <script>
        	        $(document).ready(function() {

        	            $('#data-copy').click(function() {
        	                $('#data-area').attr('type', 'text'); // 화면에서 hidden 처리한 input box type을 text로 일시 변환
        	                $('#data-area').select(); // input에 담긴 데이터를 선택
        	                var copy = document.execCommand('copy'); // clipboard에 데이터 복사
        	                $('#data-area').attr('type', 'hidden'); // input box를 다시 hidden 처리
        	                if (copy) {
        	                    alert("미니홈 링크가 복사 되었습니다."); // 사용자 알림
        	                }
        	            });

        	        });
        	    </script>
        	</ul>
	    </div>
    </ul>
    <div class="cb"></div>
    
</div>

<div class="rb_prof_tab">
    
    <div>
        
        <nav id="bo_cate" class="swiper-container swiper-container-category">
            <ul id="bo_cate_ul" class="swiper-wrapper swiper-wrapper-category">
                <li class="swiper-slide swiper-slide-category"><a href="<?php echo G5_URL ?>/rb/home.php?mb_id=<?php echo $mb['mb_id'] ?>" <?php if($ca == "") { ?>id="bo_cate_on"<?php } ?>>홈</a></li>
                <li class="swiper-slide swiper-slide-category"><a href="<?php echo G5_URL ?>/rb/home.php?mb_id=<?php echo $mb['mb_id'] ?>&ca=bbs" <?php if($ca == "bbs") { ?>id="bo_cate_on"<?php } ?>>새글</a></li>
                <!--
                <?php if($is_yc) { ?>
                <li><a href="#">상품</a></li>
                <?php } ?>
                <li><a href="#">구독</a></li>
                <li><a href="#">추천인</a></li>
                -->
            </ul>
        </nav>

        <script>
            $(document).ready(function(){
                $("#bo_cate_ul li").addClass("swiper-slide swiper-slide-category");
            });

            var swiper = new Swiper('.swiper-container-category', {
                slidesPerView: 'auto', //가로갯수
                spaceBetween: 0, // 간격
                //slidesOffsetBefore: 40, //좌측여백
                //slidesOffsetAfter: 40, // 우측여백
                observer: true, //리셋
                observeParents: true, //리셋
                touchRatio: 1, // 드래그 가능여부

            });

        </script>

        
    </div>

        
        <?php if($ca == "") { ?>
        <div>
            <ul class="cont_info_wrap">
                <li class="cont_info_wrap_l">
                    <dd>닉네임</dd>
                    <dd><?php echo $mb['mb_nick'] ?> <!--<span>@<?php echo $mb['mb_id'] ?></span>--></dd>
                </li>
                <li class="cont_info_wrap_r">
                    <dd>회원레벨</dd>
                    <dd><?php echo $mb['mb_level'] ?>레벨</dd>
                </li>
                <div class="cb"></div>
            </ul>
            <ul class="cont_info_wrap">
                <li class="cont_info_wrap_l">
                    <dd>포인트</dd>
                    <dd><?php echo number_format($mb['mb_point']) ?>P</dd>
                </li>
                <li class="cont_info_wrap_r">
                    <dd>가입일</dd>
                    <dd><?php echo ($member['mb_level'] >= $mb['mb_level']) ?  substr($mb['mb_datetime'],0,10) ." (+".number_format($mb_reg_after)."일)" : "알 수 없음";  ?></dd>
                </li>
                <div class="cb"></div>
            </ul>
            <ul class="cont_info_wrap">
                <li class="cont_info_wrap_l">
                    <dd>운영채널</dd>
                    <dd>
                    <?php if($mb_homepage) { ?>
                    <a href="<?php echo $mb_homepage ?>" target="_blank"><?php echo $mb_homepage ?></a>
                    <?php } else { ?>
                    -
                    <?php } ?>
                    </dd>
                </li>
                <li class="cont_info_wrap_r">
                    <dd>최종접속</dd>
                    <dd><?php echo ($member['mb_level'] >= $mb['mb_level']) ? $mb['mb_today_login'] : "알 수 없음"; ?></dd>
                </li>
                <div class="cb"></div>
            </ul>
        </div>
        <?php } ?>

        <div>

            <ul class="cont_info_wrap cont_info_wrap_mmt" <?php if($ca == "bbs") { ?>style="padding-top:0px;"<?php } ?>>
                <?php /* array('notice') 제외할 게시판 */ ?>
                <?php if($ca == "bbs") { ?>
                    <?php echo rb_latest_all("theme/rb.latest.thumb_right", "새글", "home", 10, 999, array(''), 1, $mb['mb_id']); // 전체게시판 ?>
                <?php } else { ?>
                    <?php echo rb_latest_all("theme/rb.latest.thumb_right", "새글", "home", 3, 999, array(''), 1, $mb['mb_id']); // 전체게시판 ?>
                <?php } ?>
            </ul>
            <!--
            <ul class="cont_info_wrap cont_info_wrap_mmt">
                <h2>상품</h2>

            </ul>
            -->

        </div>

    

    
    
</div>


<div class="cb"></div>

<script>
function member_leave() {  // 회원 탈퇴
    if (confirm("탈퇴시 보유하신 포인트 및 기타 혜택, 개인정보 등\n모든 정보가 삭제 되며 동일 아이디로 재가입이 불가능합니다.\n\n정말 탈퇴 하시겠습니까?"))
        location.href = '<?php echo G5_BBS_URL ?>/member_confirm.php?url=member_leave.php';
}
</script>
