<?php

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

  프로젝트 이름 : 피리 카페 심플

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

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

  작업날짜 : 2023년 06월 24일 토요일 오전 00시 44분 / 맑음, 20.9, 0%, 1.4ms, 29, 19, 5% / 양호, 25, 18

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

=====================================================================
 피리 NETT > 관리자 > 프로그램 > 피리 NETT 피리 카페 회원 관리 > 피리 카페 회원 목록
=====================================================================

*/

  include_once('./_common.php' );

  auth_check_menu($auth, $sub_menu, 'w');

  include_once( piree__path($piree_prog_a[770000]['num'], 'action.lib.php') );

  include_once( piree__path($piree_prog_a[770000]['num'], 'form.lib.php') );

  include_once( piree__path($piree_prog_a[770099]['num'], '__config.php') );

  $get__p770000_conf = 1;

  $get__p770099 = 1;

  $prog_config_page = 1;

  include_once( piree__path($sub_menu, 'config') );

  $cafe_member_all_t = 0;

  $cafe_member_view_t = 0;

  $cafe_member_row_a = array();

  $list_table_a = array();

  $list_sites_member_a = array();

  $site_list_a = array();

  $sql_select = "SELECT COUNT(*) FROM `". $piree['member_sites'] ."`";
  $cafe_member_all_t = (int)sql_efv($sql_select);

  IF ( $cafe_member_all_t > 0 )
  {

    $scale_n = $piree_prog_a[$sub_menu]['admin_list_scale_n'] > 0 ? $piree_prog_a[$sub_menu]['admin_list_scale_n'] : 50;

    $total_page = ceil($cafe_member_all_t/$scale_n);

    IF ( !$page_n )                              $page_n = $total_page;

    $start_n = ($total_page-$page_n)*$scale_n;

    $page_url_s = "cafe.member.list.php?";

    $page_navi_s = page_navi_get(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page_n, $total_page, $page_url_s);

    IF ( $cafe_member_all_t > 0 )
    {

      $sql_select  = "SELECT * FROM `". $piree['member_sites'] ."` ";
      $sql_select .= "ORDER BY `smeb_row_n` DESC LIMIT ". $start_n .", ". $scale_n;
      $result_base = sql_query($sql_select);

      WHILE ( $row_base = sql_fetch_array($result_base) )
      {

        $base_sites_member_n = $row_base['smeb_row_n'];

        $cafe_member_row_a[$base_sites_member_n] = $row_base;

        $base_table_a = sites_member_table_get($base_sites_member_n);

        $list_table_a[$base_table_a['table_n']] = $base_table_a['table_c'];

        $list_sites_member_a[$base_table_a['table_n']][] = $base_sites_member_n;

        $cafe_member_view_t++;

      }

      IF ( count($list_table_a) > 0 )
      {

        WHILE ( list($key_table, $val_table) = each($list_table_a) )
        {

          IF ( $key_table > 0 )
          {

            IF ( $val_table )
            {

              $loop_list_table_n = $key_table;

              $loop_list_table_c = $val_table;

              IF ( count($list_sites_member_a[$loop_list_table_n]) > 0 )
              {

                $sql_where_s  = "`smel_row_n` = '". implode("' OR `smel_row_n` = '", $list_sites_member_a[$loop_list_table_n]) ."'";

                IF ( $sql_where_s )
                {

                  $sql_select  = "SELECT * FROM `". $loop_list_table_c ."` ";
                  $sql_select .= "WHERE ". $sql_where_s ." ORDER BY `smel_row_n` ASC";
                  $result_list = sql_query($sql_select);

                  WHILE ( $row_list = sql_fetch_array($result_list) )
                  {

                    $list_sites_member_n = $row_list['smel_row_n'];

                    $cafe_member_row_a[$list_sites_member_n] = array_merge($cafe_member_row_a[$list_sites_member_n], $row_list);

                    IF ( $cafe_member_row_a[$list_sites_member_n]['smel_site_n'] != $site_list_a[$list_sites_member_n] )
                    {

                      $site_list_a[$list_sites_member_n] = $cafe_member_row_a[$list_sites_member_n]['smel_site_n'];

                    }

                  }

                }

              }

            }

          }

        }

      }

    }

  }

  IF ( count($site_list_a) > 0 )
  {

    cafe_multi_get($site_list_a);

  }

  $g5['title'] = '프로그램 > '. $piree_prog_a[$sub_menu]['name'] ." > 피리 카페 회원 목록";

  include_once( G5_ADMIN_PATH .'/admin.head.php' );

  $top_menu = 'cafe.member.list';
  include_once( piree__admin_path($sub_menu, 'top.menu.inc.php') );

  $page_form_name = "p". $sub_menu ."_sites_member_list_form";

  $form_action_u = https_url_get(piree__admin_url($sub_menu, 'sites_member.list.update.php'), 'https');

?>

  <div class="local_ov01 local_ov">
    <?php echo $listall ?>
    <span class="btn_ov01" style="margin-right:10px;">
      <span class="ov_txt">전체</span><span class="ov_num"> <?php echo number_format($cafe_member_all_t) ?>개</span>
    </span>
    <span class="btn_ov01" style="margin-right:10px;">
      <span class="ov_txt">보임</span><span class="ov_num"> <?php echo number_format($cafe_member_view_t) ?>개</span>
    </span>
  </div>

<?php

  ob_start();

?>
  <form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
  <div class="cl_bo ov_hi" style="margin:0; padding:0; height:32px;">

    <div class="cl_bo fl_left" style="margin:0; padding:0;">
      <label for="sfl" class="sound_only">검색대상</label>
      <select name="sfl" id="sfl">
        <option value="bo_table"<?php echo get_selected($_GET['sfl'], "bo_table", true); ?>>TABLE</option>
        <option value="bo_subject"<?php echo get_selected($_GET['sfl'], "bo_subject"); ?>>제목</option>
        <option value="a.gr_id"<?php echo get_selected($_GET['sfl'], "a.gr_id"); ?>>그룹ID</option>
      </select>
      <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
      <input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
      <input type="submit" value="검색" class="btn_submit">
    </div>

    <div class="fl_right" style="margin:0; padding:0;">
      <?php echo $page_navi_s; ?>
    </div>

  </div>
  </form>
<?php

  $area_search_pagenavi_s = ob_get_contents();
  ob_end_flush();

?>

  <form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
  <input type="hidden" name="sst" value="<?php echo $sst ?>">
  <input type="hidden" name="sod" value="<?php echo $sod ?>">
  <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
  <input type="hidden" name="stx" value="<?php echo $stx ?>">
  <input type="hidden" name="page" value="<?php echo $page ?>">
  <input type="hidden" name="token" value="<?php echo $token ?>">

  <div class="tbl_head01 tbl_wrap">
    <table>
    <caption><?php echo $g5['title']; ?> 목록</caption>
    <thead>
    <tr>
      <th scope="col" rowspan="2">
        <label for="chkall" class="sound_only">피리 카페 회원 전체</label>
        <input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
      </th>
      <th scope="col">가맹번호<?php //# smel_row_n ?></th>
      <th scope="col">가맹 아이디<?php //#smel_sites_id ?></th>
      <th scope="col">가맹 이름<?php //#smel_sites_name ?></th>
      <th scope="col">가맹 닉네임<?php //#smel_sites_nick ?></th>
      <th scope="col">가맹 레벨<?php //#smel_sites_level_n ?></th>
      <th scope="col">성별<?php //#smel_sex ?></th>
      <th scope="col">카페 코드<?php //# smel_code_c ?></th>
      <th scope="col">가입일시<?php //#smel_join_time_n ?></th>
    </tr>

    <tr>
      <th scope="col">허브번호<?php //#smel_nett_mem_n ?></th>
      <th scope="col">상태<?php //# smel_status_c ?></th>
      <th scope="col">허브 아이디<?php //#smel_sites_id ?></th>
      <th scope="col">허브 이름<?php //#smel_sites_name ?></th>
      <th scope="col">허브 닉네임<?php //#smel_sites_nick ?></th>
      <th scope="col">허브 레벨<?php //#smel_sites_level_n ?></th>
      <th scope="col">생년월일<?php //#smel_birth ?></th>
      <th scope="col">이메일<?php //#smel_email ?></th>
      <th scope="col">피리 등록 일시<?php //#smel_regi_time_n ?></th>
    </tr>

    </thead>
    <tbody>
<?php

  IF ( $cafe_member_view_t > 0 )
  {

    WHILE ( list($key, $val) = each($cafe_member_row_a) )
    {

      $loop_sites_member_n = (int)$key;

      $bg = 'bg'.($loop_sites_member_n%2);

      $nett_member_nick = nett_member_view($val['smel_nett_id'], get_text($val['smel_nett_nick']));

      $loop_site_view_url = piree__url($sub_menu, 'site.info.view.php') ."?site_n=". $val['smel_sites_n'];

?>
      <tr class="<?php echo $bg; ?>">
        <td class="cell_center width_30" rowspan="3">
          <label for="chk_<?php echo $loop_sites_member_n; ?>" class="sound_only"><?php echo $val['smel_row_n'] ?></label>
          <input type="checkbox" name="chk[]" value="<?php echo $loop_sites_member_n; ?>" id="chk_<?php echo $loop_sites_member_n; ?>">
        </td>
        <td class="cell_right width_60">
          <span class="sound_only">가맹번호</span>
          <strong><?php echo $val['smel_row_n']; ?></strong>
        </td>
        <td class="td_left_90">
          <span class="sound_only">가맹 아이디</span>
          <strong><?php echo $val['smel_sites_id']; ?></strong>
        </td>
        <td class="td_left_90">
          <span class="sound_only">가맹 이름</span>
          <strong><?php echo $val['smel_sites_name']; ?></strong>
        </td>
        <td class="td_left_120">
          <span class="sound_only">가맹 닉네임</span>
          <strong><?php echo $val['smel_sites_nick']; ?></strong>
        </td>
        <td class="cell_center width_60">
          <span class="sound_only">가맹 레벨</span>
          <?php echo $val['smel_sites_level_n']; ?>
        </td>
        <td class="cell_center width_50">
          <span class="sound_only">성별</span>
          <?php echo $val['smel_sex']; ?>
        </td>
        <td class="td_left">
          <span class="sound_only">카페 코드</span>
          <?php echo $val['smel_code_c']; ?>
        </td>
        <td class="cell_center width_100">
          <span class="sound_only">가입일시</span>
          <?php echo date('Y-m-d H:i', $val['smel_join_time_n']); ?>
        </td>
      </tr>

      <tr class="<?php echo $bg; ?>">
        <td class="cell_right width_60">
          <span class="sound_only">허브번호</span>
          <?php echo $val['smel_nett_mem_n']; ?>
        </td>
        <td class="cell_center width_60">
          <span class="sound_only">상태</span>
          <?php echo $nett_data_status_a[$val['smel_status_c']]['name']; ?>
        </td>
        <td class="td_left_90">
          <span class="sound_only">허브 아이디</span>
          <?php echo $val['smel_nett_id']; ?>
        </td>
        <td class="td_left_90">
          <span class="sound_only">허브 이름</span>
          <?php echo $val['smel_nett_name']; ?>
        </td>
        <td class="td_left_100">
          <span class="sound_only">허브 닉네임</span>
          <?php echo $nett_member_nick; ?>
        </td>
        <td class="cell_center width_60">
          <span class="sound_only">허브 레벨</span>
          <?php echo $val['smel_nett_level_n']; ?>
        </td>
        <td class="cell_center width_90">
          <span class="sound_only">생년월일</span>
          <?php echo $val['smel_birth']; ?>
        </td>
        <td class="td_left_80">
          <span class="sound_only">이메일</span>
          <?php echo $val['smel_email']; ?>
        </td>
        <td class="cell_center width_100">
          <span class="sound_only">피리 등록 일시</span>
          <?php echo date('Y-m-d H:i', $val['smel_regi_time_n']); ?>
        </td>
      </tr>

      <tr class="<?php echo $bg; ?>">
        <td class="td_left line_h_2_4" colspan="9">
          <div class="fl_left cl_bo td_left_100"><span class="font_999 str_09">가입 피리 카페</span></div>
          <div class="fl_left"><span class="font_37b44a str_09"><?php echo get_text($glo_cafe_a[$val['smel_site_n']}

  }
  ELSE
  {

?>
    <tr>
      <td colspan="16" class="empty_table">자료가 없습니다.</td>
    </tr>
<?php

  }

?>
    </tbody>
    </table>
  </div>

  <div class="btn_fixed_top">
    <input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value" class="btn_02 btn">
    <?php if ($is_admin == 'super') { ?>
    <input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn_02 btn">
    <?php } ?>
    <?php if ($is_admin == 'super') { ?>
    <a href="./board_form.php" id="bo_add" class="btn_01 btn">게시판 추가</a>
    <?php } ?>
  </div>

  </form>

<?php

  IF ( $cafe_member_view_t > 9 )
  {

    echo $area_search_pagenavi_s;

  }

?>

  <script>

  </script>

<?php

  include_once( G5_ADMIN_PATH .'/admin.tail.php' );

?>