<?php

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

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

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

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

  작업날짜 : 2024년 04월 01일 월요일 오후 13시 42분 / 맑음, 19.0, 일교차 주의, 18, 3, 0%, 0%, 3.4ms / 보통, 46, 15

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

=====================================================================
 피리 카페 심플 > 관리자 > 프로그램 > 피리 카페 관리 > 설정 정보 저장하기
=====================================================================

*/

  $sub_menu = "770099";

  define('PIREE__CONFIG', $sub_menu);

  include_once('./_common.php' );

  auth_check($auth[$sub_menu], 'w');

  include_once( piree__path($sub_menu, 'p770099.config.var.php') );

/*

  $log_install_base_a = array();

  $nett_member_install_base_a = array();

  $cafe_member_install_base_a = array();

  $cafe_member_install_list_a = array();

  $code_english_install_base_a = array();

  $ip_install_base_a = array();

  $ip_install_list_a = array();

  $ip_use_install_base_a = array();

  $ip_use_install_list_a = array();

*/

  $get__p770000_conf = 1;

  $get__p770099 = 1;

  $prog_config_page = 1;

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

  $is_save = $p770099__prog_c != "" ? 1 : 0;

  $go_url_s = "./__config.form.php";

  $profile_image_width_n = (int)$_POST['profile_image_width_n'];

  $profile_image_height_n = (int)$_POST['profile_image_height_n'];

  $cafe_skin_basic_pc_c = $_POST['cafe_skin_basic_pc_c'];

  $cafe_skin_basic_mo_c = $_POST['cafe_skin_basic_mo_c'];

  $cafe_skin_manage_pc_c = $_POST['cafe_skin_manage_pc_c'];

  $cafe_skin_manage_mo_c = $_POST['cafe_skin_manage_mo_c'];

  $prog_top_include_n = $piree_prog_a[770095]['top_include_n'];

  $prog_head_include_n = $piree_prog_a[770095]['head_include_n'];

  $prog_body_include_n = $piree_prog_a[770095]['body_include_n'];

  IF ( $piree_prog_a[770095]['include_use_n'] == 1 )
  {

      $prog_top_include_n = (int)$_POST['prog_top_include_n'];
      IF ( $prog_top_include_n != 1 && $prog_top_include_n != 11 )
      {
          $prog_top_include_n = 0;
      }

      $prog_head_include_n = (int)$_POST['prog_head_include_n'];
      IF ( $prog_head_include_n != 1 && $prog_head_include_n != 11 )
      {
          $prog_head_include_n = 0;
      }

      $prog_body_include_n = (int)$_POST['prog_body_include_n'];
      IF ( $prog_body_include_n != 1 && $prog_body_include_n != 11 )
      {
          $prog_body_include_n = 0;
      }

  }

  IF ( !$profile_image_width_n || $profile_image_width_n == 0 || $profile_image_width_n < 20 )
  {
    $profile_image_width_n = $defa_prog_a[$piree_prog_a[770099]['num']]['profile_image_width_n'];
  }

  IF ( !$profile_image_height_n || $profile_image_height_n == 0 || $profile_image_height_n < 20 )
  {
    $profile_image_height_n = $defa_prog_a[$piree_prog_a[770099]['num']]['profile_image_height_n'];
  }

  include_once( piree__admin_path($piree_prog_a[770000]['num'], 'program.lib.php') );

  save_piree__program_info($sub_menu);

    $sql_common  = "`pgs_prog_s`    = '". $piree_prog_a[$sub_menu]['name'] ."', ";
    $sql_common .= "`pgs_skin_pc_c` = '". $skin_pc_c ."', ";
    $sql_common .= "`pgs_skin_mo_c` = '". $skin_mo_c ."', ";

    $sql_common .= "`pgs_top_include_n` = '". $prog_top_include_n ."', ";

    $sql_common .= "`pgs_head_include_n` = '". $prog_head_include_n ."', ";

    $sql_common .= "`pgs_body_include_n` = '". $prog_body_include_n ."', ";

    $sql_common .= "`pgs_cf_2_s` = '". $cafe_skin_basic_pc_c ."', ";

    $sql_common .= "`pgs_cf_3_s` = '". $cafe_skin_basic_mo_c ."', ";

    $sql_common .= "`pgs_cf_4_s` = '". $cafe_skin_manage_pc_c ."', ";

    $sql_common .= "`pgs_cf_5_s` = '". $cafe_skin_manage_mo_c ."', ";

    $sql_common .= "`pgs_cf_7_n` = '". $profile_image_width_n ."', ";

    $sql_common .= "`pgs_cf_8_n` = '". $profile_image_height_n ."', ";

    $sql_update  = "UPDATE `". $piree['program_sam'] ."` SET ";
    $sql_update .= $sql_common;
    $sql_update .= "`pgs_modi_time_n`  = '". G5_SERVER_TIME  ."' ";
    $sql_update .= "WHERE `pgs_prog_n` = '". $sub_menu ."'";

    IF ( !sql_query($sql_update))
    {

        alert("[ ". $piree_prog_a[770099]['name'] ." ] 설정 정보를 수정하지 못했습니다.", $go_url_s);

    }

  include_once( piree__admin_path($piree_prog_a[770099]['num'], 'piree_web_prog.save.inc.php') );

  $go_url_s = piree__admin_url($sub_menu, '__config.form.php' );

  alert ('[ p'. $piree_prog_a[$sub_menu]['num'] .' - '. $piree_prog_a[$sub_menu]['name'] .' ] 설정 정보를 저장 하였습니다.', $go_url_s, 0);
  EXIT;

  go_url($go_url_s, 0);

?>