Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltms.eemo.co.kr
/
public_html
/
super
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ltms.eemo.co.kr/public_html/super/feed_company_mody_do.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $arr_rst=array(); function request($path, $query, $content_type = 'json') { $api_server = 'https://dapi.kakao.com'; $headers = array('Authorization: KakaoAK d4e624e15429967d2a33af07ba75f8f3 '); $opts = array( CURLOPT_URL => $api_server . $path . '.' . $content_type . '?' . $query, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSLVERSION => 1, CURLOPT_HEADER => false, CURLOPT_HTTPHEADER => $headers ); $curl_session = curl_init(); curl_setopt_array($curl_session, $opts); $return_data = curl_exec($curl_session); if (curl_errno($curl_session)) { throw new Exception(curl_error($curl_session)); } else { //print_r(curl_getinfo($curl_session)); curl_close($curl_session); return $return_data; } } $name=${"frm".$no."_name"}; $addr=${"frm".$no."_addr"}; $addr2=${"frm".$no."_addr2"}; $tel=${"frm".$no."_tel"}; $magam_time=${"frm".$no."_magamtime"}; $bigo=${"frm".$no."_bigo"}; $path = '/v2/local/search/address'; $content_type = 'json'; // json or xml $params = http_build_query(array( 'query' => $addr )); $res = request($path, $params, $content_type); $json=json_decode($res); $arr_rst=array(); if($json->meta->total_count=='0') { $arr_rst['rst']='wrong_addr'; echo json_encode($arr_rst); exit; } else { $zipcode=$json->documents[0]->address->zip_code; $sido=($json->documents[0]->road_address->region_1depth_name ? $json->documents[0]->road_address->region_1depth_name : $json->documents[0]->address->region_1depth_name); $sigungu=($json->documents[0]->road_address->region_2depth_name ? $json->documents[0]->road_address->region_2depth_name : $json->documents[0]->address->region_2depth_name); $lon=($json->documents[0]->road_address->x ? $json->documents[0]->road_address->x : $json->documents[0]->address->x); $lat=($json->documents[0]->road_address->y ? $json->documents[0]->road_address->y : $json->documents[0]->address->y); if($lat==0) { $arr_rst['rst']='wrong_addr2'; echo json_encode($arr_rst); exit; } $query="update feed_company set name='$name', gubun='$gubun', lat='$lat', lon='$lon', addr='$addr', addr2='$addr2', sido='$sido', sigungu='$sigungu', tel='$tel', bigo='$bigo', magam_time='$magam_time', company_no='{$_COOKIE[ucompany_no]}', regdate=now() where no='$no' "; mysql_query($query) or die(mysql_error()); $arr_rst['rst']='1'; echo json_encode($arr_rst); } ?>