<?php

/*
=====================================================================

  프로젝트 이름 : 피리 카페 For 그누보드5.5 순정

  만든사람 : 피리 PIREE ( tosports@naver.com )

  홈페이지 : https://piree.kr/nett_dev

  작성날짜 : 2024년 04월 03일 수요일 오후 20시 01분 / 흐림, 13.9, 쾌적, 17, 11, 38%, 11.4mm, 20%, 1.7ms / 양호, 33, 17

  저 작 권 : Copyright ⓒ 2024 피리 piree.kr All right reserved
              그누보드 외에 추가된 소스는~
              만든사람의 허락없이 무단으로 사용할수 없습니다.
              사용하고자 할 경우 만든사람의 허락을 받아야 합니다.
              http://www.piree.kr 에 문의해 주세요.

=====================================================================
 피리 카페 For 그누보드5.5 순정 > 프로그램 > 피리 카페 관리 > 내 카페 > 관리 > 스킨 > LAYOUT > PC > HEAD > SKIN
=====================================================================

*/

  IF ( !defined('_GNUBOARD_') )                             EXIT;

?>

<!-- 상단 시작 { -->
<div id="hd">

    <div id="hd_wrapper">
        <div id="hd_top_logo">
            <a href="<?php echo G5_URL ?>"><img src="<?php echo $p770100__cafe_logo_url_s; ?>" height="30" alt="<?php echo $piree_cafe_name_s; ?>"></a>
        </div>

        <div id="hd_top_title">
            <a href="<?php echo get_piree_cafe_main($piree_cafe_n, $piree_cafe_c); ?>" class="str_222_bold_15"><?php echo $piree_cafe_name_s; ?></a>
        </div>

        <div id="hd_top_manage">
            <a href="<?php echo PIREE_CAFE_MANAGE_URL .'/?piree_cafe_n='. $piree_cafe_n; ?>" class="str_3334dd_12">피리 카페 관리</a>
        </div>

        <!-- 시작 => 좌측_메뉴_영역 -->
        <ul class="hd_top_menu">
<?php

        IF ( $member['mb_id'] )
        {

?>
          <li>
            <a href="<?php echo get_piree_cafe_domain(0, $piree_prog_a[790000]['num'], 'my.page.php' ); ?>" class="str_3334dd_bold_12"><?php echo $member['mb_nick']; ?></a> 
            <a href="<?php echo get_piree_cafe_domain(0, $piree_prog_a[790000]['num'], 'my.page.php' ); ?>" class="str_666_bold_10"> (<?php echo $member['mb_id']; ?>)님</a> &nbsp;
            <span class="font_6799ff_10">[ <?php echo $cafe_member_a['cafe_mem_level_s']; ?> ]</span>
          </li>
          <li><a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'section.index.php'); ?>" class="str_555_10">모두의 카페</a></li>
          <li><a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'my.cafe.php'); ?>" class="str_555_10">내 카페</a></li>
          <li><a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'section.cafe.make.php'); ?>" class="str_555_10">카페 만들기</a></li>
          <li><a href="<?php echo G5_BBS_URL ?>/logout.php" class="str_555_10">로그아웃</a></li>
<?php

        }
        ELSE
        {

?>
          <li><a href="<?php echo G5_BBS_URL ?>/login.php" class="str_555_10">로그인</a></li>
          <li><a href="<?php echo G5_BBS_URL ?>/register.php" class="str_555_10">회원가입</a></li>
<?php

        }

?>
        </ul>
        <!-- 끝 => 좌측_메뉴_영역 -->
    </div>

    <nav id="gnb">
      <h2>메인메뉴</h2>
      <div class="gnb_wrap">
        <ul id="gnb_1dul">
<?php

/*
          <li class="gnb_1dli gnb_mnal"><button type="button" class="gnb_menu_btn" title="전체메뉴"><i class="fa fa-bars" aria-hidden="true"></i><span class="sound_only">전체메뉴열기</span></button></li>
*/

        IF ( count($piree_cafe_manage_menu_a) > 0 )
        {

          $menu_datas = get_menu_db(0, true);

          $gnb_zindex = 999;

          $loop_out_n = 0;

          FOREACH ( $piree_cafe_manage_menu_a AS $pm_menu_a )
          {

            IF ( empty($pm_menu_a) )
            {
              continue;
            }

            $add_class = 'gnb_al_li_plus';

?>
            <li class="gnb_1dli <?php echo $add_class; ?>" style="z-index:<?php echo $gnb_zindex--; ?>">
              <a href="<?php echo $pm_menu_a['url']; ?>" class="gnb_1da"><?php echo $pm_menu_a['name_s'] ?></a>
<?php

/*
              <a href="<?php echo $pm_menu_a['me_link']; ?>" target="_blank" class="gnb_1da"><?php echo $pm_menu_a['name_s'] ?></a>
*/

              $k = 0;
              foreach( (array) $pm_menu_a['sub'] as $row2 ){

                  IF ( empty($row2) ) continue; 

                  IF ($k == 0)
                      echo '<span class="bg">하위분류</span><div class="gnb_2dul"><ul class="gnb_2dul_box">'.PHP_EOL;
?>
                  <li class="gnb_2dli"><a href="<?php echo $row2['me_link']; ?>" class="gnb_2da"><?php echo $row2['me_name'] ?></a></li>
<?php

              $k++;

              }//end foreach $row2

              IF ( $k > 0 )
                  echo '</ul></div>'.PHP_EOL;
?>
            </li>
<?php

            $loop_out_n++;

          }

        }
        ELSE
        {

?>
            <li class="gnb_empty">
              피리 카페 관리 메뉴가 없습니다.
            </li>
<?php
        }

?>
        </ul>
        <div id="gnb_all">
          <h2>전체메뉴</h2>
          <ul class="gnb_al_ul">
              <?php
              
              $i = 0;
              foreach( $menu_datas as $row ){
              ?>
              <li class="gnb_al_li">
                  <a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>" class="gnb_al_a"><?php echo $row['me_name'] ?></a>
                  <?php
                  $k = 0;
                  foreach( (array) $row['sub'] as $row2 ){
                      IF ($k == 0)
                          echo '<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>'.PHP_EOL;
                  ?>
              </li>
              <?php
              $i++;
              }//end foreach $row

              if ($i == 0) {  ?>
                  <li class="gnb_empty">메뉴 준비 중입니다.<?php if (piree_cafe_auth_get()) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하실 수 있습니다.<?php } ?></li>
              <?php } ?>
          </ul>
          <button type="button" class="gnb_close_btn"><i class="fa fa-times" aria-hidden="true"></i></button>
        </div>
        <div id="gnb_all_bg"></div>
      </div>
    </nav>

    <script>

      $(function(){
        $(".gnb_menu_btn").click(function(){
          $("#gnb_all, #gnb_all_bg").show();
        });
        $(".gnb_close_btn, #gnb_all_bg").click(function(){
          $("#gnb_all, #gnb_all_bg").hide();
        });
      });

    </script>

</div>
<!-- } 상단 끝 -->

<hr>

<!-- 콘텐츠 시작 { -->
<div id="wrapper">
    <div id="container_wr">
<?php

  IF ( PIREE_IS_DEMO_N == 1 )
  {
?>
    <div class="cl_bo line_h_2_4" style="margin:10px; border:3px solid #ff9966; padding:10px;">
      <p>
        <a href="http://piree.cc/0RWj" class="str_ff4444_13" target="_blank">[ 피리 카페 ] 정보 보기 & 구입하기! 여기를 터치.클릭 하세요.</a>
      </p>
    </div>
<?php
  }

?>

    <div id="container">
