daum 주소 api 적용

This commit is contained in:
thisgun
2014-08-13 16:12:13 +09:00
parent ec8f2368da
commit 80a52d8c3c
9 changed files with 114 additions and 348 deletions

View File

@ -125,6 +125,7 @@ if(!isset($mb['mb_dupinfo'])) {
sql_query(" ALTER TABLE {$g5['member_table']} ADD `mb_dupinfo` varchar(255) NOT NULL DEFAULT '' AFTER `mb_adult` ", false);
}
$juso_addr3_view = $mb['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '';
if ($mb['mb_intercept_date']) $g5['title'] = "차단된 ";
else $g5['title'] .= "";
$g5['title'] .= '회원 '.$html_title;
@ -219,11 +220,13 @@ include_once('./admin.head.php');
<input type="text" name="mb_addr1" value="<?php echo $mb['mb_addr1'] ?>" id="mb_addr1" class="frm_input readonly" size="60">
<label for="mb_addr1">기본주소</label><br>
<input type="text" name="mb_addr2" value="<?php echo $mb['mb_addr2'] ?>" id="mb_addr2" class="frm_input" size="60">
<label for="mb_addr2">상세주소</label><br>
<input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60">
<label for="mb_addr3">참고항목</label>
<label for="mb_addr2">상세주소</label>
<span <?php echo $juso_addr3_view;?>>
<br>
<input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60">
<label for="mb_addr3">참고항목</label>
</span>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br>
<span id="mb_addr_jibeon">지번주소 : <?php echo $mb['mb_addr_jibeon']; ?></span>
</td>
</tr>
<tr>

View File

@ -67,6 +67,12 @@ if ($addr1)
$g5['title'] = '우편번호 검색';
include_once(G5_PATH.'/head.sub.php');
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신
$g5['daum_juso_js'] = "<script src=\"https://spi.maps.daum.net/imap/map_js_init/postcode.js\"></script>";
} else { //http 통신
$g5['daum_juso_js'] = "<script src=\"http://dmaps.daum.net/map_js_init/postcode.js\"></script>";
}
include_once($member_skin_path.'/zip.skin.php');
include_once(G5_PATH.'/tail.sub.php');

View File

@ -377,7 +377,7 @@ var win_homepage = function(href) {
* 우편번호 창
**/
var win_zip = function(href) {
var new_win = window.open(href, 'win_zip', 'width=616, height=760, scrollbars=1');
var new_win = window.open(href, 'win_zip', 'width=483, height=600, scrollbars=1');
new_win.focus();
}

View File

@ -3,6 +3,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
$juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '';
?>
<div class="mbskin">
@ -150,11 +151,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<label for="reg_mb_addr1" class="sound_only">주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label>
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50"><br>
<label for="reg_mb_addr2" class="sound_only">상세주소</label>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50"><br>
<label for="reg_mb_addr3" class="sound_only">참고항목</label>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>"><br>
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
<span <?php echo $juso_addr3_view;?>>
<br>
<label for="reg_mb_addr3" class="sound_only">참고항목</label>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50">
</span>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
</td>
</tr>
<?php } ?>
@ -262,7 +265,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script>
$(function() {
$("#reg_zip_find").css("display", "inline-block");
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
// 아이핀인증

View File

@ -190,22 +190,6 @@
#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px}
/* 우편번호 검색 */
#post_code #code_sel {margin:0 20px 20px}
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
#post_code p {margin:0 0 10px}
#post_code #zip_search_frm {margin:0 20px}
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
#post_code #code_sch .frm_input {height:22px}
#post_code #code_sch .btn_submit {padding:0 8px;height:24px}
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
#post_code #result .result_msg {padding:15px 0}
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
#post_code #result li div {margin:4px 0 0;color:#738D94}
#post_code #result li div {color:#738D94}
#post_code #result li div:before {content:"▶ "}
#post_code #zip_direct_frm {display:none;margin:0 20px}
#post_code #zip_direct_frm .frm_input {margin:0 0 5px}
#post_code #zip_direct_frm .frm_addr {width:99%}
#post_code #zip_direct_frm #sch_dq {padding:10px 0 20px;text-align:center}
#daum_juso_wrap{width:100%;height:100%}
#daum_juso_wrap.pos_abs{position:absolute;top:0;left:0;}
html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden}

View File

@ -3,160 +3,53 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
$daum_add_class="";
if( !is_mobile() ){
$daum_add_class = "pos_abs";
}
echo $g5['daum_juso_js'].PHP_EOL;
?>
<!-- 우편번호 찾기 시작 { -->
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
<div id="post_code" class="new_win mbskin">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<div id="code_sel">
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
<label for="sch_sel_1">주소검색</label>
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
<label for="sch_sel_0">직접입력</label>
</div>
<div id="zip_search_frm" class="zip_frm">
<p>
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
(검색결과는 최대 1,000건만 표시됩니다.)
</p>
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
<!-- 검색어 입력 시작 { -->
<div id="code_sch">
<label for="sido" class="sound_only">시도선택</label>
<select name="sido" id="sido">
<option value="">- 시도 선택 -</option>
</select>
<label for="gugun" class="sound_only">시군구</label>
<select name="gugun" id="gugun">
<option value="">- 시군구 선택 -</option>
</select>
<div id="sch_q">
<label for="q" class="sound_only">검색어</label>
<input type="text" name="q" value="" id="q" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</div>
</div>
<!-- } 검색어 입력 끝 -->
</form>
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
</div>
<div id="zip_direct_frm" class="zip_frm">
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
<form name="fzip2">
우편번호
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
<label for="frm_addr1" class="sound_only">기본주소</label>
<input type="text" name="frm_addr1" placeholder="기본주소" id="frm_addr1" class="required frm_input frm_addr"><br>
<label for="frm_addr2" class="sound_only">상세주소</label>
<input type="text" name="frm_addr2" placeholder="상세주소" id="frm_addr2" class="frm_input frm_addr"><br>
<label for="frm_addr3" class="sound_only">참고항목</label>
<input type="text" name="frm_addr3" placeholder="참고항목" id="frm_addr3" class="frm_input frm_addr"><br>
<label for="frm_jibeon" class="sound_only">지번주소</label>
<input type="text" name="frm_jibeon" placeholder="지번주소" id="frm_jibeon" class="frm_input frm_addr">
<div id="sch_dq">
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
</div>
</form>
</div>
<div class="win_btn">
<button type="button" onclick="window.close();">창닫기</button>
</div>
</div>
<div id="daum_juso_wrap" class="daum_juso_wrap <?php echo $daum_add_class;?>"></div>
<script>
$(function() {
$("input[name='sch_sel']").click(function() {
var val = $(this).val();
jQuery(function($){
$("html, body").addClass("daum_juso_body");
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
$(".zip_frm").hide();
$("#zip_"+val+"_frm").show();
});
var msg_alert = true;
$("input#q").bind("focusin", function() {
if(!msg_alert) {
return false;
} else {
alert("정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.\n\n입력예1) 강남대로37길 24-6\n입력예2) 서초동 1362-19\n입력예3) 서초2동 1362-19");
msg_alert = false;
if(jibeon == "N"){
of.<?php echo $frm_addr3; ?>.parentNode.style.display="none";
} else if (jibeon == "R"){
of.<?php echo $frm_addr3; ?>.parentNode.style.display="";
}
});
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
$("#put_addr").click(function() {
var zip1 = $.trim($("#frm_zip1").val());
var zip2 = $.trim($("#frm_zip2").val());
var addr1 = $.trim($("#frm_addr1").val());
var addr2 = $.trim($("#frm_addr2").val());
var addr3 = $.trim($("#frm_addr3").val());
var jibeon = $.trim($("#frm_jibeon").val());
if(zip1.length < 1) {
alert("우편번호 앞자리를 입력해 주십시오.");
return false;
if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
}
of.<?php echo $frm_addr3; ?>.focus();
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
if(zip2.length < 1) {
alert("우편번호 뒷자리를 입력해 주십시오.");
return false;
}
if(addr1.length < 1) {
alert("기본주소를 입력해 주십시오.");
return false;
}
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
});
var el_id = document.getElementById('daum_juso_wrap');
new daum.Postcode({
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
},
width : '100%',
height : '100%'
}).embed(el_id);
});
function put_data(zip1, zip2, addr1, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = "";
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
window.close();
}
</script>
<!-- } 우편번호 찾기 끝 -->
</script>

View File

@ -3,6 +3,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
$juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '';
?>
<!-- 회원정보 입력/수정 시작 { -->
@ -155,11 +156,13 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50">
<label for="reg_mb_addr1">기본주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label><br>
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
<label for="reg_mb_addr2">상세주소</label><br>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
<label for="reg_mb_addr3">참고항목</label><br>
<label for="reg_mb_addr2">상세주소</label>
<span <?php echo $juso_addr3_view;?>>
<br>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50">
<label for="reg_mb_addr3">참고항목</label>
</span>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
</td>
</tr>
<?php } ?>
@ -270,7 +273,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<script>
$(function() {
$("#reg_zip_find").css("display", "inline-block");
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
// 아이핀인증

View File

@ -173,20 +173,5 @@
#profile h2 {margin:0}
/* 우편번호 검색 */
#post_code #code_sel {margin:0 20px 20px}
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
#post_code p {margin:0 0 10px}
#post_code .btn_submit {padding:0 8px;height:24px}
#post_code #zip_search_frm {margin:0 20px}
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
#post_code #code_sch #q_info {display:none;z-index:2;position:absolute;top:33px;left:0;padding:5px;background:#e4eaec}
#post_code #code_sch #q_info span {position:absolute;top:-6px;left:5px;width:11px;height:6px;background:url('img/zip_ico_up.gif')}
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
#post_code #result .result_msg {padding:15px 0}
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
#post_code #result li div {margin:4px 0 0;color:#738D94}
#post_code #result li div:before {content:"▶ "}
#post_code #zip_direct_frm {display:none;margin:0 20px}
#post_code #zip_direct_frm .frm_input, #post_code #zip_direct_frm .btn_submit {margin:0 0 5px}
#daum_juso_wrap{position:absolute;left:0;top:0;width:100%;height:100%}
html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden}

View File

@ -3,157 +3,48 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
echo $g5['daum_juso_js'].PHP_EOL;
?>
<!-- 우편번호 찾기 시작 { -->
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
<div id="post_code" class="new_win mbskin">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<div id="code_sel">
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
<label for="sch_sel_1">주소검색</label>
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
<label for="sch_sel_0">직접입력</label>
</div>
<div id="zip_search_frm" class="zip_frm">
<p>
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
(검색결과는 최대 1,000건만 표시됩니다.)
</p>
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
<!-- 검색어 입력 시작 { -->
<div id="code_sch">
<label for="sido" class="sound_only">시도선택</label>
<select name="sido" id="sido">
<option value="">- 시도 선택 -</option>
</select>
<label for="gugun" class="sound_only">시군구</label>
<select name="gugun" id="gugun">
<option value="">- 시군구 선택 -</option>
</select>
<div id="sch_q">
<div id="q_info"><span></span>정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.<br><br>입력예1) 강남대로37길 24-6<br>입력예2) 서초동 1362-19<br>입력예3) 서초2동 1362-19</div>
<label for="q" class="sound_only">검색어</label>
<input type="text" name="q" value="" id="q" required class="required frm_input">
<input type="submit" value="검색" class="btn_submit">
</div>
</div>
<!-- } 검색어 입력 끝 -->
</form>
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
</div>
<div id="zip_direct_frm" class="zip_frm">
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
<form name="fzip2">
우편번호
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
<label for="frm_addr1">기본주소</label>
<input type="text" name="frm_addr1" id="frm_addr1" class="required frm_input" size="70"><br>
<label for="frm_addr2">상세주소</label>
<input type="text" name="frm_addr2" id="frm_addr2" class="frm_input" size="70"><br>
<label for="frm_addr3">참고항목</label>
<input type="text" name="frm_addr3" id="frm_addr3" class="frm_input" size="70"><br>
<label for="frm_jibeon">지번주소</label>
<input type="text" name="frm_jibeon" id="frm_jibeon" class="frm_input" size="70">
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
</form>
</div>
<div class="win_btn">
<button type="button" onclick="window.close();">창닫기</button>
</div>
</div>
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script>
$(function() {
$("input[name='sch_sel']").click(function() {
var val = $(this).val();
$(".zip_frm").hide();
$("#zip_"+val+"_frm").show();
});
$("input#q").bind("focusin", function() {
$("#q_info").fadeIn(200);
});
$("input#q").bind("focusout", function() {
$("#q_info").fadeOut(200);
});
$("#put_addr").click(function() {
var zip1 = $.trim($("#frm_zip1").val());
var zip2 = $.trim($("#frm_zip2").val());
var addr1 = $.trim($("#frm_addr1").val());
var addr2 = $.trim($("#frm_addr2").val());
var addr3 = $.trim($("#frm_addr3").val());
var jibeon = $.trim($("#frm_jibeon").val());
if(zip1.length < 1) {
alert("우편번호 앞자리를 입력해 주십시오.");
return false;
jQuery(function($){
$("html, body").addClass("daum_juso_body");
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
if(jibeon == "N"){
of.<?php echo $frm_addr3; ?>.parentNode.style.display="none";
} else if (jibeon == "R"){
of.<?php echo $frm_addr3; ?>.parentNode.style.display="";
}
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
if(zip2.length < 1) {
alert("우편번호 뒷자리를 입력해 주십시오.");
return false;
if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
}
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
if(addr1.length < 1) {
alert("기본주소를 입력해 주십시오.");
return false;
}
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
});
var el_id = document.getElementById('daum_juso_wrap');
new daum.Postcode({
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
},
width : '100%',
height : '100%'
}).embed(el_id);
});
function put_data(zip1, zip2, addr1, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = "";
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
if(of.<?php echo $frm_jibeon; ?> !== undefined)
of.<?php echo $frm_jibeon; ?>.value = jibeon;
window.close();
}
</script>
<!-- } 우편번호 찾기 끝 -->
</script>