주소입력관련 자바스크립트 코드 수정

This commit is contained in:
chicpro
2014-08-19 11:49:15 +09:00
parent 09f68b767c
commit 426004e795
6 changed files with 22 additions and 100 deletions

View File

@ -125,7 +125,6 @@ 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;
@ -221,11 +220,9 @@ include_once('./admin.head.php');
<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>
<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>
<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>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br>
</td>
</tr>

View File

@ -1,76 +1,13 @@
<?php
include_once('./_common.php');
// 메모리를 많이 잡아먹어서 아래의 코드로 대체
//ini_set('memory_limit', '20M');
//$zipfile = file("./zip.db");
/*
$zipfile = array();
$fp = fopen('./zip.db', 'r');
while(!feof($fp)) {
$zipfile[] = fgets($fp, 4096);
}
fclose($fp);
$search_count = 0;
if ($addr1)
{
while ($zipcode = each($zipfile))
{
if(strstr(substr($zipcode[1],9,512), $addr1))
{
$list[$search_count][zip1] = substr($zipcode[1],0,3);
$list[$search_count][zip2] = substr($zipcode[1],4,3);
$addr = explode(" ", substr($zipcode[1],8));
if ($addr[sizeof($addr)-1])
{
$list[$search_count][addr] = str_replace($addr[sizeof($addr)-1], "", substr($zipcode[1],8));
$list[$search_count][bunji] = trim($addr[sizeof($addr)-1]);
}
else
$list[$search_count][addr] = substr($zipcode[1],8);
$list[$search_count][encode_addr] = urlencode($list[$search_count][addr]);
$search_count++;
}
}
if (!$search_count) alert('찾으시는 주소가 없습니다.');
}
*/
/* 기존의 DB에서 불러오는 방식
if ($addr1)
{
//$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_id ";
$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_sido, zp_gugun, zp_dong ";
$result = sql_query($sql);
$search_count = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$list[$i][zip1] = substr($row[zp_code], 0, 3);
$list[$i][zip2] = substr($row[zp_code], 3, 3);
$list[$i][addr] = "$row[zp_sido] $row[zp_gugun] $row[zp_dong]";
$list[$i][bunji] = $row[zp_bunji];
$list[$i][encode_addr] = urlencode($list[$i][addr]);
$search_count++;
}
if (!$search_count)
alert("찾으시는 주소가 없습니다.");
}
*/
$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>";
echo '<script src="https://spi.maps.daum.net/imap/map_js_init/postcode.js"></script>';
} else { //http 통신
echo '<script src="http://dmaps.daum.net/map_js_init/postcode.js"></script>';
}
include_once($member_skin_path.'/zip.skin.php');

View File

@ -3,7 +3,6 @@ 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">
@ -152,11 +151,9 @@ $juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '
<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">
<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>
<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" readonly="readonly">
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
</td>
</tr>

View File

@ -3,24 +3,21 @@ 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;
?>
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script>
jQuery(function($){
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(!is_chrome){ //모바일 크롬에서 먹통되는 현상이 있음
if(!is_chrome) { //모바일 크롬에서 먹통되는 현상이 있음
$("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;
@ -42,7 +39,7 @@ jQuery(function($){
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);

View File

@ -3,7 +3,6 @@ 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"' : '';
?>
<!-- 회원정보 입력/수정 시작 { -->
@ -157,11 +156,9 @@ $juso_addr3_view = $member['mb_addr_jibeon'] == 'N' ? 'style="display:none"' : '
<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>
<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>
<br>
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50" readonly="readonly">
<label for="reg_mb_addr3">참고항목</label>
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
</td>
</tr>

View File

@ -3,21 +3,18 @@ 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;
?>
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script>
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;
@ -38,7 +35,7 @@ jQuery(function($){
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);