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

if (G5_IS_MOBILE) {
    include_once(G5_THEME_MOBILE_PATH.'/tail.php');
    return;
}

if(G5_COMMUNITY_USE === false) {
    include_once(G5_THEME_SHOP_PATH.'/shop.tail.php');
    return;
}
?>
        </section>
    </div>
    
    <footer>
        <div class="footer_gnb">
            <div class="inner" style="width:<?php echo $rb_core['tb_width'] ?>px;">
                <ul class="footer_gnb_ul1 pc">
                    <a href="<?php echo get_pretty_url('content', 'provision'); ?>">서비스 이용약관</a>
                    <a href="<?php echo get_pretty_url('content', 'privacy'); ?>">개인정보 처리방침</a>
                </ul>
                <ul class="footer_gnb_ul2">
                    <a href="<?php echo G5_BBS_URL ?>/qalist.php">1:1 문의</a>
                    <a href="<?php echo G5_BBS_URL ?>/faq.php">FAQ</a>
                    <a href="<?php echo G5_BBS_URL ?>/new.php?view=w">새글</a>
                    <a href="<?php echo G5_BBS_URL ?>/current_connect.php">현재접속 <?php echo connect("theme/rb.connect"); ?></a>
                </ul>
                <div class="cb"></div>
            </div>
        </div>
        <div class="footer_copy">
            <div class="inner" style="width:<?php echo $rb_core['tb_width'] ?>px;">
                <ul class="footer_copy_ul1">
                    <li class="footer_copy_ul1_li1">
                       
                        <?php if (!empty($rb_builder['bu_logo_pc_w'])) { ?>
                            <a href="#"><img src="<?php echo G5_URL ?>/data/logos/pc_w?ver=<?php echo G5_SERVER_TIME ?>"></a>
                        <?php } else { ?>
                            <a href="#"><img src="<?php echo G5_THEME_URL ?>/rb.img/logos/pc_w.png?ver=<?php echo G5_SERVER_TIME ?>"></a>
                        <?php } ?>
                        
                        <div class="mobile">
                            <a href="<?php echo get_pretty_url('content', 'provision'); ?>">서비스 이용약관</a>
                            <a href="<?php echo get_pretty_url('content', 'privacy'); ?>">개인정보 처리방침</a>
                        </div>

                    </li>
                    <li class="footer_copy_ul1_li2 pc">

                        <?php if (!empty($rb_builder['bu_1'])) { ?><?php echo $rb_builder['bu_1'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_2'])) { ?>　대표자 : <?php echo $rb_builder['bu_2'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_3'])) { ?>　대표전화 : <?php echo $rb_builder['bu_3'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_4'])) { ?>　팩스 : <?php echo $rb_builder['bu_4'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_5'])) { ?>사업자등록번호 : <?php echo $rb_builder['bu_5'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_6'])) { ?>　통신판매업신고번호 : <?php echo $rb_builder['bu_6'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_7'])) { ?>　부가통신사업자번호 : <?php echo $rb_builder['bu_7'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_8'])) { ?>　<?php echo $rb_builder['bu_8'] ?><?php } ?>
                        <br>
                        
                        <?php if (!empty($rb_builder['bu_10'])) { ?>주소 : <?php if (!empty($rb_builder['bu_9'])) { ?>(<?php echo $rb_builder['bu_9'] ?>) <?php } ?> <?php echo $rb_builder['bu_10'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_11'])) { ?>개인정보책임자(이메일) : <?php echo $rb_builder['bu_11'] ?><?php } ?>
                    </li>
                    <li class="footer_copy_ul1_li2 mobile">
                        <?php if (!empty($rb_builder['bu_1'])) { ?><?php echo $rb_builder['bu_1'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_2'])) { ?>　대표자 : <?php echo $rb_builder['bu_2'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_3'])) { ?>대표전화 : <?php echo $rb_builder['bu_3'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_4'])) { ?>　팩스 : <?php echo $rb_builder['bu_4'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_5'])) { ?>사업자등록번호 : <?php echo $rb_builder['bu_5'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_6'])) { ?>　통신판매업신고번호 : <?php echo $rb_builder['bu_6'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_7'])) { ?>부가통신사업자번호 : <?php echo $rb_builder['bu_7'] ?><?php } ?>
                        <?php if (!empty($rb_builder['bu_8'])) { ?>　<?php echo $rb_builder['bu_8'] ?><?php } ?>
                        
                        <?php if (!empty($rb_builder['bu_7']) || !empty($rb_builder['bu_8'])) { ?><br><?php } ?>
                        
                        
                        <?php if (!empty($rb_builder['bu_10'])) { ?>주소 : <?php if (!empty($rb_builder['bu_9'])) { ?>(<?php echo $rb_builder['bu_9'] ?>) <?php } ?><?php echo $rb_builder['bu_10'] ?><?php } ?>
                        <br>
                        <?php if (!empty($rb_builder['bu_11'])) { ?>개인정보책임자(이메일) : <?php echo $rb_builder['bu_11'] ?><?php } ?>
                    </li>
                    
                    <?php if (!empty($rb_builder['bu_12'])) { ?>
                    <li class="footer_copy_ul1_li3">
                       <?php echo $rb_builder['bu_12'] ?>
                    </li>
                    <?php } ?>
                    
                </ul>
                <ul class="footer_copy_ul2">
                   
                    <?php if (!empty($rb_builder['bu_sns1'])) { ?><a href="<?php echo $rb_builder['bu_sns1'] ?>" target="_blank" class="footer_sns_ico" title="카카오 공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_kakaoch.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns2'])) { ?><a href="<?php echo $rb_builder['bu_sns2'] ?>" target="_blank" class="footer_sns_ico" title="카카오 채팅상담"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_kakaoch_chat.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns3'])) { ?><a href="<?php echo $rb_builder['bu_sns3'] ?>" target="_blank" class="footer_sns_ico" title="유튜브 공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_youtube.png"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns4'])) { ?><a href="<?php echo $rb_builder['bu_sns4'] ?>" target="_blank" class="footer_sns_ico" title="인스타그램 공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_telegram.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns5'])) { ?><a href="<?php echo $rb_builder['bu_sns5'] ?>" target="_blank" class="footer_sns_ico" title="페이스북 공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_facebook.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns6'])) { ?><a href="<?php echo $rb_builder['bu_sns6'] ?>" target="_blank" class="footer_sns_ico" title="트위터 공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_twitter.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns7'])) { ?><a href="<?php echo $rb_builder['bu_sns7'] ?>" target="_blank" class="footer_sns_ico" title="네이버블로그 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_naverblog.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns8'])) { ?><a href="<?php echo $rb_builder['bu_sns8'] ?>" target="_blank" class="footer_sns_ico" title="텔레그램 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_telegram.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns9'])) { ?><a href="<?php echo $rb_builder['bu_sns9'] ?>" target="_blank" class="footer_sns_ico" title="SIR 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_sir.svg"></a><?php } ?>
                    <?php if (!empty($rb_builder['bu_sns10'])) { ?><a href="<?php echo $rb_builder['bu_sns10'] ?>" target="_blank" class="footer_sns_ico" title="공식채널 바로가기"><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/sns_g/g_links.svg"></a><?php } ?>

                    <!-- 임시주석 {
                    <button type="button" class="footer_btn">
                        <i><img src="<?php echo G5_THEME_URL ?>/rb.img/icon/icon_android.svg"></i>
                        <span>안드로이드 전용앱 다운로드</span>
                        <div class="cb"></div>
                    </button>
                    } -->
                </ul>
                <div class="cb"></div>
            </div>
        </div>
    </footer>



                <!-- 전체메뉴 { -->
                <nav id="cbp-hrmenu-btm" class="cbp-hrmenu cbp-hrmenu-btm mobile">
                   
                    <div class="user_prof_bg">
                        <?php if($is_member) { ?>
                            <li class="user_prof_bg_info font-B"><?php echo $member['mb_nick'] ?></li>
                            <li class="user_prof_bg_info font-B"><span><?php echo $member['mb_level'] ?> Lv</span> <a href="<?php echo G5_BBS_URL; ?>/point.php" target="_blank" class="win_point font-B"><span><?php echo number_format($member['mb_point']); ?> P</span></a></li>
                        <?php } else { ?>
                            <li class="user_prof_bg_info font-B">Guest</li>
                        <?php } ?>
                    </div>
                    <div class="user_prof">
                        <?php if($is_member) { ?>
                        <a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=<?php echo G5_BBS_URL ?>/register_form.php" class="font-B"><?php echo get_member_profile_img($member['mb_id']); ?></a>
                        <?php } else { ?>
                        <?php echo get_member_profile_img($member['mb_id']); ?>
                        <?php } ?>
                    </div>
                    <div class="user_prof_btns">
                        <li class="">
                            <?php if($is_member) { ?>
                            <button type="button" alt="로그아웃" class="btn_round" onclick="location.href='<?php echo G5_BBS_URL ?>/logout.php';">로그아웃</button>
                            <button type="button" alt="마이페이지" class="btn_round arr_bg font-B" onclick="location.href='<?php echo G5_URL; ?>/rb/home.php?mb_id=<?php echo $member['mb_id']; ?>';">My</button>
                            <?php } else { ?>
                            <button type="button" alt="로그인" class="btn_round" onclick="location.href='<?php echo G5_BBS_URL ?>/login.php';">로그인</button>
                            <button type="button" alt="회원가입" class="btn_round arr_bg font-B" onclick="location.href='<?php echo G5_BBS_URL ?>/register.php';">회원가입</button>
                            <?php } ?>
                        </li>
                    </div>
                    
                    
                    <ul>
                    <?php
                    $menu_datas = get_menu_db(0, true);
                    $gnb_zindex = 999; // gnb_1dli z-index 값 설정용
                    $i = 0;
                    foreach( $menu_datas as $row ){
                        if( empty($row) ) continue;
                    ?>
                    <li>
                        <a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>" class="font-B"><?php echo $row['me_name'] ?></a>
                        <?php
                        $k = 0;
                        foreach( (array) $row['sub'] as $row2 ){

                            if( empty($row2) ) continue; 
                            
                            if($k == 0)
                                echo '<div class="cbp-hrsub"><div class="cbp-hrsub-inner"><div><!--<h4 class="font-B">그룹</h4>--><ul>'.PHP_EOL;
                            
                        ?>
                            <li><a href="<?php echo $row2['me_link']; ?>" target="_<?php echo $row2['me_target']; ?>"><?php echo $row2['me_name'] ?></a></li>
                        <?php
                        $k++;
                        }   //end foreach $row2

                        if($k > 0)
                            echo '</ul></div></div></div>'.PHP_EOL;
                        ?>
                    </li>
                    <?php
                    $i++;
                    }   //end foreach $row
                    ?>
                    </ul>
                </nav>
                <!-- } -->



<button type="button" id="m_gnb_close_btn" class="mobile">
    <img src="<?php echo G5_URL ?>/rb/rb.config/image/icon_close.svg">
</button>

<script>
    $(document).ready(function() {
        $('#m_gnb_close_btn').click(function() {
            $('#cbp-hrmenu-btm').removeClass('active');
            $('#m_gnb_close_btn').removeClass('active');
            $('main').removeClass('moves');
            $('header').removeClass('moves');
        });
    });
</script>


<script src="<?php echo G5_THEME_URL ?>/rb.js/cbpHorizontalMenu.min.js"></script>
<script>
    $(function() {
        cbpHorizontalMenu.init();
        cbpHorizontalMenu_btm.init();
    });
</script>
<!-- } -->

<?php
    //리빌드세팅
    if($is_admin) {
        include_once(G5_PATH.'/rb/rb.config/right.php'); //환경설정
    }

?>


<?php
if(G5_DEVICE_BUTTON_DISPLAY && !G5_IS_MOBILE) { ?>
<?php
}

if ($config['cf_analytics']) {
    echo $config['cf_analytics'];
}
?>

<!-- } 하단 끝 -->

<script>
$(function() {
    // 폰트 리사이즈 쿠키있으면 실행
    font_resize("container", get_cookie("ck_font_resize_rmv_class"), get_cookie("ck_font_resize_add_class"));
});
</script>

<?php
include_once(G5_THEME_PATH."/tail.sub.php");