ÿØÿà JFIF ` ` ÿþ
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 : |
<?php header("Content-Type: application/json"); $g4_path = ".."; include "common.php"; // API Common include "../admin/_common.php"; // Admin Common /*******************************************************************/ // 최대 예약가능인원 변경 // // 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'); } if(DEV_MODE) echo ("===== TKPLACE - ZIPLINE : TIMETABLE MAXIMUM UPDATE START =====\n"); Log::save(sprintf("%s(%d) %s", __FILE__, __LINE__, "API START"), '', 'tk/'.date('Ym')); // 호출하는 곳 : 일일예약현황(팝업 - 시간별) //$mode = $_POST['mode']; $branch = $_POST['branch']; // branch 코드 mg, yi, ad $ti_date = $_POST['ti_date']; $ti_time = $_POST['ti_time']; $maximum = $_POST['maximum_count']; if(DEV_MODE){ p($_POST); } Log::save(sprintf("%s(%d) ti_date %s ti_time %s", __FILE__, __LINE__, $ti_date, $ti_time), '', 'tk/'.date('Ym')); Log::save(sprintf("%s(%d) %s", __FILE__, __LINE__, "API CALL"), '', 'tk/'.date('Ym')); // 주문조회 쿼리 $path = "/zipline/event-maximum-update/"; $call_data = array( "site_id" => $branch, "start_date" => date('Y-m-d', strtotime($ti_date)), "event_name" => $ti_time, "event_maximum" => $maximum, ); $result = call($path, $call_data); $data = array(); if($result['status'] == 200){ Log::save(sprintf("%s(%d) %s", __FILE__, __LINE__, "Update Success"), '', 'tk/'.date('Ym')); $nowdate = date('Y-m-d H:i:s'); $ipaddr = $_SERVER['REMOTE_ADDR']; $sql = "select * from g4_write_timetable where ti_site = '".$branch."' AND ti_date = '".$ti_date."' AND ti_time = '".$ti_time."' ORDER BY ti_id DESC LIMIT 1"; $row_res = sql_fetch($sql); // 타임테이블 업데이트 if($row_res['ti_id']){ // 데이터 있을 경우 Update $sql = "update g4_write_timetable set ti_maximum = '".$maximum."', ti_datetime = '".$nowdate."', ti_write_ipaddr = '".$ipaddr."' WHERE ti_id = '".$row_res['ti_id']."' LIMIT 1"; if(DEV_MODE){ p($sql); } // DB 처리 if(DEV_MODE == 0){ if(DEV_MODE){ p("DB Process..."); } Log::save(sprintf("%s(%d) DB Update/Insert Process : %s", __FILE__, __LINE__, $sql), '', 'tk/'.date('Ym')); sql_query($sql); } } } else { } echo json_encode($result); ?>