Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
egg.eemo.co.kr
/
public_html
/
super5
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/egg.eemo.co.kr/public_html/super5/paper_install_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)); } 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; } } $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') { echo "<script>alert('주소지 정보가 올바르지 않습니다.');history.back();</script>"; 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); $arr_rst['rst']=1; $arr_rst['sido']=urlencode($sido); $arr_rst['sigungu']=urlencode($sigungu); $arr_rst['lat']=urlencode($lat); $arr_rst['lon']=urlencode($lon); $arr_rst['zipcode']=urlencode($zipcode); if($geyak_money_perc > 0) { $total_money=ceil(($geyak_money*100)/$geyak_money_perc); } $jan_money_perc2=100-$geyak_money_perc; $jan_money=$total_money-$geyak_money; $query="update farm_install_paper set sangho='$sangho', name='$name', addr='$addr', addr2='$addr2', tel='$tel', fax='$fax', sido='$sido', sigungu='$sigungu', lat='$lat', lon='$lon', total_money='$total_money', geyak_money_perc='$geyak_money_perc', geyak_money='$geyak_money', jan_money_perc='$jan_money_perc2', jan_money='$jan_money', jan_chk='$jan_chk', as_gigan_type='$as_gigan_type', bangmun_req_date='$bangmun_req_date', jj_lpr_su='$jj_lpr_su', jj_cam_su='$jj_cam_su', jj_chadan_su='$jj_chadan_su', jj_temp_sensor_su='$jj_temp_sensor_su', jj_monitor_su='$jj_monitor_su', jj_tablet_su='$jj_tablet_su' where no='$no' "; mysql_query($query) or die(mysql_error()); mysql_query("delete from farm_install_paper_dong where paper_no='$no' ") or die(); for($n=1;$n<=20;$n++) { $dong_name=${"dong_name_".$n}; $horize_size=${"horize_size_".$n}; $vertical_size=${"vertical_size_".$n}; $height_size=${"height_size_".$n}; $gesa_type=${"gesa_type_".$n}; $cam_su=${"cam_su_".$n}; $temp_sensor_su=${"temp_sensor_su_".$n}; if($dong_name) { $query="insert into farm_install_paper_dong set paper_no='$no', dong_name='$dong_name', horize_size='$horize_size', vertical_size='$vertical_size', height_size='$height_size', gesa_type='$gesa_type', cam_su='$cam_su', temp_sensor_su='$temp_sensor_su', regdate=now() "; mysql_query($query) or die(mysql_error()); } } } echo "<meta http-equiv='refresh' content='0;url=paper_install.php'>"; ?>