<?php

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

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

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

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

  작성날짜 : 2024년 04월 09일 화요일 오후 15시 35분 / 맑음, 18.0, 건조주의보, 18, 8, 1%, 0%, 2.5ms / 양호, 35, 15

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

=======================================================================
 피리 카페 심플 > 피리 카페 관리 > 게시판 게시판 분류 추가 > 처리하기
=======================================================================

*/

  include_once('./_common.php');

/*
  * PIREE_SOSS
  * 피리 PIREE ( piree1977@gmail.com )
  * Ver 2.0.0
*/

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

  include_once( piree__path($piree_prog_a[770000]['num'], 'cafe.board.category.smallint.2.lib.php') );

  $board_cafe_n      = (int)$_POST['board_cafe_n'];
  $board_cate_n      = (int)$_POST['board_cate_n'];
  $board_cate_name_l_s = save__str($_POST['board_cate_name_l_s']);

  IF ( !$piree_cafe_n )
  {
    alert("[ 피리 카페 ]를 선택해 주세요.");
  }

  SWITCH ($cate_work_c)
  {

    CASE 'default' :

      $board_cate_n = 0;

      $board_cate_name_l_s = "게시글 전체보기";

    BREAK;

    DEFAULT :

      IF ( !$board_cate_name_l_s )
      {
        alert("[ 게시판 분류 이름 ]을 입력해 주세요.");
      }

    BREAK;

  }

  include_once( "./_CAFE.MANAGE.INFO.CHECK.inc.php" );

/*

  $sql_delete = "DELETE FROM `". $piree['cafe_board'] ."`";

// $sql_delete ." <<================ SQL_DELETE > 1 > 1 <br>\n";

  IF ( !sql_query($sql_delete) )
  {

    echo "#ERROR:단어를 BASE ROW를 삭제하지 못했습니다.";

  }

  $sql_delete = "DELETE FROM `". $piree['cafe_board'] ."`";
  $sql_delete .= "WHERE `bca_row_n` > '10'";

// $sql_delete ." <<================ SQL_DELETE > 1 > 1 <br>\n";

  IF ( !sql_query($sql_delete) )
  {

    echo "#ERROR:단어를 BASE ROW를 삭제하지 못했습니다.";
    exit;

  }

*/

  $board_cate_1_s = '';
  $board_cate_2_s = '';
  $board_cate_s_p = '';

  $category_save_a = array();

  $sql_common_s_a = array();

  $board_cate_parent_n = 0;

  $board_cate_depth_n = 1;

  $board_cate_n_p = '';

  $board_cate_1_n = 0;
  $board_cate_2_n = 0;

  $board_cate_sub_t = 0;

  $board_cate_member_t = 0;

/*

  $board_cate = array();

  IF ( $piree_cafe_n > 0 && $board_cate_n > 0 )
  {

    $sql_select = "SELECT * FROM `". $piree['cafe_board'] ."` ";
    $sql_select .= "WHERE `bca_cafe_n` = '". $piree_cafe_n ."' AND `bca_cate_n` = '". $board_cate_n ."'";
    $board_cate_a = sql_fetch($sql_select);

    IF ( $piree_cafe_n != $board_cate_list_a[$board_cate_n]['bca_cafe_n'] || $board_cate_n != $board_cate_list_a[$board_cate_n]['bca_cate_n'] )
    {

      alert("선택된 [ 게시판 분류 ]의  정보가 없습니다.");

    }

    $board_cate_1_n = $board_cate_list_a[$board_cate_n]['bca_1_n'];
    $board_cate_2_n = $board_cate_list_a[$board_cate_n]['bca_2_n'];

    $board_cate_1_s = $board_cate_list_a[$board_cate_n]['bca_1_s'];
    $board_cate_2_s = $board_cate_list_a[$board_cate_n]['bca_2_s'];

    $board_cate_depth_n = $board_cate_list_a[$board_cate_n]['bca_depth_n'];

    $board_cate_parent_n = $board_cate_list_a[$board_cate_n]['bca_parent_n'];
    $board_cate_sub_t    = $board_cate_list_a[$board_cate_n]['bca_sub_t'];

  }

*/

  $board_cate = array();

  IF ( $mode_c == 'modify' || ( $mode_c == 'regist' && $board_cate_n > 0 ) )
  {

    $sql_select = "SELECT * FROM `". $piree['cafe_board'] ."` ";
    $sql_select .= "WHERE `bca_cafe_n` = '". $piree_cafe_n ."' AND `bca_cate_n` = '". $board_cate_n ."'";
    $board_cate_a = sql_fetch($sql_select);

    IF ( $piree_cafe_n != $board_cate_list_a[$board_cate_n]['bca_cafe_n'] || $board_cate_n != $board_cate_list_a[$board_cate_n]['bca_cate_n'] )
    {

      alert("선택된 [ 게시판 분류 ]의  정보가 없습니다.");

    }

    $board_cate_1_n = $board_cate_list_a[$board_cate_n]['bca_1_n'];
    $board_cate_2_n = $board_cate_list_a[$board_cate_n]['bca_2_n'];

    $board_cate_1_s = $board_cate_list_a[$board_cate_n]['bca_1_s'];
    $board_cate_2_s = $board_cate_list_a[$board_cate_n]['bca_2_s'];

    $board_cate_depth_n = $board_cate_list_a[$board_cate_n]['bca_depth_n'];

    $board_cate_parent_n = $board_cate_list_a[$board_cate_n]['bca_parent_n'];
    $board_cate_sub_t    = $board_cate_list_a[$board_cate_n]['bca_sub_t'];

  }

  $bca_include_head          = isset($_POST['bca_include_head'])          ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bca_include_head'], 0, 255)) : '';
  $bca_include_tail          = isset($_POST['bca_include_tail'])          ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bca_include_tail'], 0, 255)) : '';
  $bca_use_sideview          = isset($_POST['bca_use_sideview'])          ? (int) $_POST['bca_use_sideview']                                                                    : 0;
  $bca_use_dhtml_editor      = isset($_POST['bca_use_dhtml_editor'])      ? (int) $_POST['bca_use_dhtml_editor']                                                                : 0;
  $bca_use_good              = isset($_POST['bca_use_good'])              ? (int) $_POST['bca_use_good']                                                                        : 0;
  $bca_use_nogood            = isset($_POST['bca_use_nogood'])            ? (int) $_POST['bca_use_nogood']                                                                      : 0;
  $bca_use_name              = isset($_POST['bca_use_name'])              ? (int) $_POST['bca_use_name']                                                                        : 0;
  $bca_use_signature         = isset($_POST['bca_use_signature'])         ? (int) $_POST['bca_use_signature']                                                                   : 0;
  $bca_use_ip_view           = isset($_POST['bca_use_ip_view'])           ? (int) $_POST['bca_use_ip_view']                                                                     : 0;
  $bca_use_list_view         = isset($_POST['bca_use_list_view'])         ? (int) $_POST['bca_use_list_view']                                                                   : 0;
  $bca_use_list_file         = isset($_POST['bca_use_list_file'])         ? (int) $_POST['bca_use_list_file']                                                                   : 0;
  $bca_use_list_content      = isset($_POST['bca_use_list_content'])      ? (int) $_POST['bca_use_list_content']                                                                : 0;
  $bca_use_email             = isset($_POST['bca_use_email'])             ? (int) $_POST['bca_use_email']                                                                       : 0;
  $bca_use_sns               = isset($_POST['bca_use_sns'])               ? (int) $_POST['bca_use_sns']                                                                         : 0;
  $bca_use_captcha           = isset($_POST['bca_use_captcha'])           ? (int) $_POST['bca_use_captcha']                                                                     : 0;
  $bca_table_width           = isset($_POST['bca_table_width'])           ? (int) $_POST['bca_table_width']                                                                     : 0;
  $bca_subject_len           = isset($_POST['bca_subject_len'])           ? (int) $_POST['bca_subject_len']                                                                     : 0;
  $bca_mo_subject_len        = isset($_POST['bca_mo_subject_len'])        ? (int) $_POST['bca_mo_subject_len']                                                                  : 0;
  $bca_pc_page_rows          = isset($_POST['bca_pc_page_rows'])          ? (int) $_POST['bca_pc_page_rows']                                                                    : 0;
  $bca_mo_page_rows          = isset($_POST['bca_mo_page_rows'])          ? (int) $_POST['bca_mo_page_rows']                                                                    : 0;
  $bca_use_rss_view          = isset($_POST['bca_use_rss_view'])          ? (int) $_POST['bca_use_rss_view']                                                                    : 0;
  $bca_use_secret            = isset($_POST['bca_use_secret'])            ? (int) $_POST['bca_use_secret']                                                                      : 0;
  $bca_use_file_content      = isset($_POST['bca_use_file_content'])      ? (int) $_POST['bca_use_file_content']                                                                : 0;
  $bca_new                   = isset($_POST['bca_new'])                   ? (int) $_POST['bca_new']                                                                             : 0;
  $bca_hot                   = isset($_POST['bca_hot'])                   ? (int) $_POST['bca_hot']                                                                             : 0;
  $bca_image_width           = isset($_POST['bca_image_width'])           ? (int) $_POST['bca_image_width']                                                                     : 0;
  $bca_use_search            = isset($_POST['bca_use_search'])            ? (int) $_POST['bca_use_search']                                                                      : 0;
  $bca_use_cert              = isset($_POST['bca_use_cert'])              ? preg_replace('/[^0-9a-z_]/i', '', $_POST['bca_use_cert'])                                           : '';
  $bca_device                = isset($_POST['bca_device'])                ? clean_xss_tags($_POST['bca_device'], 1, 1)                                                          : '';
  $bca_list_level            = isset($_POST['bca_list_level'])            ? (int) $_POST['bca_list_level']                                                                      : 0;
  $bca_read_level            = isset($_POST['bca_read_level'])            ? (int) $_POST['bca_read_level']                                                                      : 0;
  $bca_write_level           = isset($_POST['bca_write_level'])           ? (int) $_POST['bca_write_level']                                                                     : 0;
  $bca_reply_level           = isset($_POST['bca_reply_level'])           ? (int) $_POST['bca_reply_level']                                                                     : 0;
  $bca_comment_level         = isset($_POST['bca_comment_level'])         ? (int) $_POST['bca_comment_level']                                                                   : 0;
  $bca_html_level            = isset($_POST['bca_html_level'])            ? (int) $_POST['bca_html_level']                                                                      : 0;
  $bca_link_level            = isset($_POST['bca_link_level'])            ? (int) $_POST['bca_link_level']                                                                      : 0;
  $bca_count_modify          = isset($_POST['bca_count_modify'])          ? (int) $_POST['bca_count_modify']                                                                    : 0;
  $bca_count_delete          = isset($_POST['bca_count_delete'])          ? (int) $_POST['bca_count_delete']                                                                    : 0;
  $bca_upload_level          = isset($_POST['bca_upload_level'])          ? (int) $_POST['bca_upload_level']                                                                    : 0;
  $bca_download_level        = isset($_POST['bca_download_level'])        ? (int) $_POST['bca_download_level']                                                                  : 0;
  $bca_read_point            = isset($_POST['bca_read_point'])            ? (int) $_POST['bca_read_point']                                                                      : 0;
  $bca_write_point           = isset($_POST['bca_write_point'])           ? (int) $_POST['bca_write_point']                                                                     : 0;
  $bca_comment_point         = isset($_POST['bca_comment_point'])         ? (int) $_POST['bca_comment_point']                                                                   : 0;
  $bca_download_point        = isset($_POST['bca_download_point'])        ? (int) $_POST['bca_download_point']                                                                  : 0;
  $bca_select_editor         = isset($_POST['bca_select_editor'])         ? clean_xss_tags($_POST['bca_select_editor'], 1, 1)                                                   : '';
  $bca_pc_skin               = isset($_POST['bca_pc_skin'])               ? clean_xss_tags($_POST['bca_pc_skin'], 1, 1)                                                         : '';
  $bca_mo_skin               = isset($_POST['bca_mo_skin'])               ? clean_xss_tags($_POST['bca_mo_skin'], 1, 1)                                                         : '';
  $bca_pc_content_head       = isset($_POST['bca_pc_content_head'])       ? $_POST['bca_pc_content_head']                                                                          : '';
  $bca_pc_content_tail       = isset($_POST['bca_pc_content_tail'])       ? $_POST['bca_pc_content_tail']                                                                       : '';
  $bca_mo_content_head       = isset($_POST['bca_mo_content_head'])       ? $_POST['bca_mo_content_head']                                                                       : '';
  $bca_mo_content_tail       = isset($_POST['bca_mo_content_tail'])       ? $_POST['bca_mo_content_tail']                                                                       : '';
  $bca_insert_content        = isset($_POST['bca_insert_content'])        ? $_POST['bca_insert_content']                                                                        : '';
  $bca_gallery_cols          = isset($_POST['bca_gallery_cols'])          ? (int) $_POST['bca_gallery_cols']                                                                    : 0;
  $bca_pc_gallery_width      = isset($_POST['bca_pc_gallery_width'])      ? (int) $_POST['bca_pc_gallery_width']                                                                : 0;
  $bca_pc_gallery_height     = isset($_POST['bca_pc_gallery_height'])     ? (int) $_POST['bca_pc_gallery_height']                                                               : 0;
  $bca_mo_gallery_width      = isset($_POST['bca_mo_gallery_width'])      ? (int) $_POST['bca_mo_gallery_width']                                                                : 0;
  $bca_mo_gallery_height     = isset($_POST['bca_mo_gallery_height'])     ? (int) $_POST['bca_mo_gallery_height']                                                               : 0;
  $bca_upload_count          = isset($_POST['bca_upload_count'])          ? (int) $_POST['bca_upload_count']                                                                    : 0;
  $bca_upload_size           = isset($_POST['bca_upload_size'])           ? (int) $_POST['bca_upload_size']                                                                     : 0;
  $bca_reply_order           = isset($_POST['bca_reply_order'])           ? (int) $_POST['bca_reply_order']                                                                     : 0;
  $bca_order                 = isset($_POST['bca_order'])                 ? (int) $_POST['bca_order']                                                                           : 0;
  $bca_write_min             = isset($_POST['bca_write_min'])             ? (int) $_POST['bca_write_min']                                                                       : 0;
  $bca_write_max             = isset($_POST['bca_write_max'])             ? (int) $_POST['bca_write_max']                                                                       : 0;
  $bca_comment_min           = isset($_POST['bca_comment_min'])           ? (int) $_POST['bca_comment_min']                                                                     : 0;
  $bca_comment_max           = isset($_POST['bca_comment_max'])           ? (int) $_POST['bca_comment_max']                                                                     : 0;
  $bca_sort_field            = isset($_POST['bca_sort_field'])            ? clean_xss_tags($_POST['bca_sort_field'], 1, 1)                                                      : '';

  $sql_common_s .= "`bca_cate_s`                = '". $board_cate_name_l_s ."', ";

  $sql_common_s .= "`bca_sub_t`                 = '". $board_cate_sub_t ."', ";
  $sql_common_s .= "`bca_row_t`                 = '0', ";
  $sql_common_s .= "`bca_article_t`             = '0', ";

  $sql_common_s .= "`bca_device`                = '". $bca_device ."', ";
  $sql_common_s .= "`bca_list_level`            = '". $bca_list_level ."', ";
  $sql_common_s .= "`bca_read_level`            = '". $bca_read_level ."', ";
  $sql_common_s .= "`bca_write_level`           = '". $bca_write_level ."', ";
  $sql_common_s .= "`bca_reply_level`           = '". $bca_reply_level ."', ";
  $sql_common_s .= "`bca_comment_level`         = '". $bca_comment_level ."', ";
  $sql_common_s .= "`bca_upload_level`          = '". $bca_upload_level ."', ";
  $sql_common_s .= "`bca_download_level`        = '". $bca_download_level ."', ";

  $sql_common_s .= "`bca_html_level`            = '". $bca_html_level ."', ";
  $sql_common_s .= "`bca_link_level`            = '". $bca_link_level ."', ";
  $sql_common_s .= "`bca_count_delete`          = '". $bca_count_delete ."', ";
  $sql_common_s .= "`bca_count_modify`          = '". $bca_count_modify ."', ";

  $sql_common_s .= "`bca_read_point`            = '". $bca_read_point ."', ";
  $sql_common_s .= "`bca_write_point`           = '". $bca_write_point ."', ";
  $sql_common_s .= "`bca_comment_point`         = '". $bca_comment_point ."', ";
  $sql_common_s .= "`bca_download_point`        = '". $bca_download_point ."', ";
  $sql_common_s .= "`bca_use_sideview`          = '". $bca_use_sideview ."', ";

  $sql_common_s .= "`bca_use_file_content`      = '". $bca_use_file_content ."', ";
  $sql_common_s .= "`bca_use_secret`            = '". $bca_use_secret ."', ";
  $sql_common_s .= "`bca_use_dhtml_editor`      = '". $bca_use_dhtml_editor ."', ";
  $sql_common_s .= "`bca_select_editor`         = '". $bca_select_editor ."', ";
  $sql_common_s .= "`bca_use_rss_view`          = '". $bca_use_rss_view ."', ";
  $sql_common_s .= "`bca_use_good`              = '". $bca_use_good ."', ";
  $sql_common_s .= "`bca_use_nogood`            = '". $bca_use_nogood ."', ";
  $sql_common_s .= "`bca_use_name`              = '". $bca_use_name ."', ";
  $sql_common_s .= "`bca_use_signature`         = '". $bca_use_signature ."', ";

  $sql_common_s .= "`bca_use_ip_view`           = '". $bca_use_ip_view ."', ";
  $sql_common_s .= "`bca_use_list_view`         = '". $bca_use_list_view ."', ";
  $sql_common_s .= "`bca_use_list_file`         = '". $bca_use_list_file ."', ";
  $sql_common_s .= "`bca_use_list_content`      = '". $bca_use_list_content ."', ";
  $sql_common_s .= "`bca_table_width`           = '". $bca_table_width ."', ";
  $sql_common_s .= "`bca_pc_subject_len`        = '". $bca_pc_subject_len ."', ";
  $sql_common_s .= "`bca_mo_subject_len`        = '". $bca_mo_subject_len ."', ";
  $sql_common_s .= "`bca_pc_page_rows`          = '". $bca_pc_page_rows ."', ";

  $sql_common_s .= "`bca_mo_page_rows`          = '". $bca_mo_page_rows ."', ";
  $sql_common_s .= "`bca_new`                   = '". $bca_new ."', ";
  $sql_common_s .= "`bca_hot`                   = '". $bca_hot ."', ";
  $sql_common_s .= "`bca_image_width`           = '". $bca_image_width ."', ";
  $sql_common_s .= "`bca_pc_skin`               = '". $bca_pc_skin ."', ";
  $sql_common_s .= "`bca_mo_skin`               = '". $bca_mo_skin ."', ";
  $sql_common_s .= "`bca_include_head`          = '". $bca_include_head ."', ";
  $sql_common_s .= "`bca_include_tail`          = '". $bca_include_tail ."', ";
  $sql_common_s .= "`bca_pc_content_head`       = '". $bca_pc_content_head ."', ";
  $sql_common_s .= "`bca_pc_content_tail`       = '". $bca_pc_content_tail ."', ";
  $sql_common_s .= "`bca_mo_content_head`       = '". $bca_mo_content_head ."', ";
  $sql_common_s .= "`bca_mo_content_tail`       = '". $bca_mo_content_tail ."', ";
  $sql_common_s .= "`bca_insert_content`        = '". $bca_insert_content ."', ";
  $sql_common_s .= "`bca_gallery_cols`          = '". $bca_gallery_cols ."', ";
  $sql_common_s .= "`bca_pc_gallery_width`      = '". $bca_pc_gallery_width ."', ";
  $sql_common_s .= "`bca_pc_gallery_height`     = '". $bca_pc_gallery_height ."', ";
  $sql_common_s .= "`bca_mo_gallery_width`      = '". $bca_mo_gallery_width ."', ";
  $sql_common_s .= "`bca_mo_gallery_height`     = '". $bca_mo_gallery_height ."', ";
  $sql_common_s .= "`bca_upload_size`           = '". $bca_upload_size ."', ";

  $sql_common_s .= "`bca_reply_order`           = '". $bca_reply_order ."', ";
  $sql_common_s .= "`bca_use_search`            = '". $bca_use_search ."', ";
  $sql_common_s .= "`bca_order`                 = '". $bca_order ."', ";
  $sql_common_s .= "`bca_write_min`             = '". $bca_write_min ."', ";
  $sql_common_s .= "`bca_write_max`             = '". $bca_write_max ."', ";

  $sql_common_s .= "`bca_comment_min`           = '". $bca_comment_min ."', ";
  $sql_common_s .= "`bca_comment_max`           = '". $bca_comment_max ."', ";
  $sql_common_s .= "`bca_notice`                = '', ";
  $sql_common_s .= "`bca_upload_count`          = '". $bca_upload_count ."', ";
  $sql_common_s .= "`bca_use_email`             = '". $bca_use_email ."', ";
  $sql_common_s .= "`bca_use_cert`              = '". $bca_use_cert ."', ";
  $sql_common_s .= "`bca_use_sns`               = '". $bca_use_sns ."', ";
  $sql_common_s .= "`bca_use_captcha`           = '". $bca_use_captcha ."', ";
  $sql_common_s .= "`bca_sort_field`            = '". $bca_sort_field ."'";

    SWITCH ( $mode_c )
    {

      CASE 'regist' :

        IF ( $board_cate_list_a[$board_cate_n]['bca_depth_n'] > 2 )
        {
          alert("3단계 이상의 게시판 분류를 등록할수 없습니다.");
        }

        IF ( $board_cate_n > 0 )
        {

          IF ( $board_cate_n == $board_cate_list_a[$board_cate_n]['bca_cate_n'] )
          {

            $board_cate_parent_n = $board_cate_list_a[$board_cate_n]['bca_cate_n'];

            $board_cate_depth_n++;

            IF ( $board_cate_depth_n > 2 )
            {

              alert("선택된 [ 게시판 분류 정보 ]가 없습니다.");
            }

          }

        }

        $sql_select  = "SELECT COUNT(*) FROM `". $piree['cafe_board'] ."` ";
        $sql_select .= "WHERE `bca_cafe_n` = '". $piree_cafe_n ."' AND `bca_cate_s` = '". $board_cate_name_l_s ."' AND `bca_depth_n` = '". $board_cate_depth_n ."' AND `bca_parent_n` = '". $board_cate_parent_n ."'";
        $exist_t = sql_efv($sql_select);

        include_once( PIREE_CAFE_MANAGE_PATH .'/board.category.regist.update.inc.php');

        $sql_insert  = "INSERT INTO `". $piree['cafe_board'] ."` SET ";
        $sql_insert .= "`bca_cafe_n`      = '". $piree_cafe_n ."', ";
        $sql_insert .= "`bca_cafe_c`      = '". $piree_cafe_code_c ."', ";
        $sql_insert .= "`bca_cafe_s`      = '". $piree_cafe_name_s ."', ";
        $sql_insert .= "`bca_cate_n`      = '". $board_cate_n ."', ";
        $sql_insert .= "`bca_1_n`         = '". $board_cate_1_n ."', ";
        $sql_insert .= "`bca_2_n`         = '". $board_cate_2_n ."', ";
        $sql_insert .= "`bca_cate_n_p`    = '". $board_cate_n_p ."', ";
        $sql_insert .= "`bca_1_s`         = '". $board_cate_1_s ."', ";
        $sql_insert .= "`bca_2_s`         = '". $board_cate_2_s ."', ";
        $sql_insert .= "`bca_s_p`         = '". $board_cate_s_p ."', ";
        $sql_insert .= "`bca_depth_n`     = '". $board_cate_depth_n ."', ";
        $sql_insert .= "`bca_parent_n`    = '". $board_cate_parent_n ."', ";
        $sql_insert .= "`bca_regi_time_n` = '". G5_SERVER_TIME ."', ";
        $sql_insert .= $sql_common_s;

        IF ( !sql_query($sql_insert) )
        {

          alert("[ ". $piree_cafe_name_s ." ] 카페의\\n\\n[ ". $board_cate_name_l_s ." ] 게시판 분류를 입력하지 못했습니다.");

        }

        $category_i_a = get_category_upper_smallint2_cafe_board($board_cate_n);

        get_sub_category_count_depth_smallint2_cafe_board($category_i_a, $board_cate_n);

      BREAK;

      CASE 'modify' :

        IF ( !$board_cate_name_l_s )
        {
          alert("[ 게시판 분류 이름 ]을 입력해 주세요.");
        }

        $sql_select  = "SELECT COUNT(*) FROM `". $piree['cafe_board'] ."` ";
        $sql_select .= "WHERE `bca_cafe_n` = '". $piree_cafe_n ."' AND `bca_cate_s` = '". $board_cate_name_l_s ."' AND `bca_depth_n` = '". $board_cate_depth_n ."' AND `bca_parent_n` = '". $board_cate_parent_n ."' AND `bca_cate_n` != '". $board_cate_n ."'";
        $exist_t = sql_efv($sql_select);

        IF ( $exist_t > 0 )
        {
            alert("같은 위치에 게시판 분류 [". $board_cate_name_l_s ."] 이(가) 이미 있습니다.");
        }

        include_once( PIREE_CAFE_MANAGE_PATH .'/board.category.regist.update.inc.php');

        $sql_select = $sql_select_cafe_all ." AND ". get_piree_cafe_article_count($board_cate_n, $board_cate_list_a[$board_cate_n]['bca_depth_n'], 'wr_pi_board_cate_n');
        $artilce_cate_t = (int)sql_efv($sql_select);

        $sql_common_s .= ", ";
        $sql_common_s .= "`bca_count_write` = '". $artilce_cate_t ."' ";

        $sql_update  = "UPDATE `". $piree['cafe_board'] ."` SET ";
        $sql_update .= "`bca_1_n`         = '". $board_cate_1_n ."', ";
        $sql_update .= "`bca_2_n`         = '". $board_cate_2_n ."', ";
        $sql_update .= "`bca_cate_n_p`    = '". $board_cate_n_p ."', ";
        $sql_update .= "`bca_1_s`         = '". $board_cate_1_s ."', ";
        $sql_update .= "`bca_2_s`         = '". $board_cate_2_s ."', ";
        $sql_update .= "`bca_s_p`         = '". $board_cate_s_p ."', ";
        $sql_update .= "`bca_sub_t`       = '". $board_cate_name_l_sub_t ."', ";
        $sql_update .= "`bca_relo_time_n` = '". G5_SERVER_TIME ."', ";
        $sql_update .= $sql_common_s;
        $sql_update .= "WHERE `bca_cafe_n` = '". $piree_cafe_n ."' AND `bca_cate_n` = '". $board_cate_n ."'";

        IF ( !sql_query($sql_update) )
        {

          alert("[ ". $piree_cafe_name_s ." ] 카페의 [ ". $board_cate_name_l_s ." ] 게시판 분류를 수정하지 못했습니다.");

        }

        get_sub_category_count_depth_smallint2_cafe_board($category_i_a, $board_cate_n);

      BREAK;

    }

  $go_url_s = "board.category.regist.form.php?piree_cafe_n=". $piree_cafe_n ."&board_cate_n=". $board_cate_n .'&mode_c=modify';

  goto_url($go_url_s);
  EXIT;

?>