추가배송비 우편번호 검색 juso.sir.co.kr 이용하도록 수정
This commit is contained in:
@ -140,8 +140,12 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
|||||||
$(function() {
|
$(function() {
|
||||||
$(".sch_zipcode").click(function() {
|
$(".sch_zipcode").click(function() {
|
||||||
var idx = $(".sch_zipcode").index($(this));
|
var idx = $(".sch_zipcode").index($(this));
|
||||||
var url = "./sendcostzipcode.php?no="+(idx+1);
|
var no = idx + 1;
|
||||||
var opt = "left=50,top=50,width=500,height=400";
|
var sort = "asc";
|
||||||
|
if(no == 2)
|
||||||
|
sort = "desc";
|
||||||
|
var url = "./sendcostzipcode.php?no="+no+"&sort="+sort;
|
||||||
|
var opt = "left=50,top=50,width=600,height=700";
|
||||||
window.open(url, "win_zipcode", opt);
|
window.open(url, "win_zipcode", opt);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,107 +4,82 @@ include_once('./_common.php');
|
|||||||
|
|
||||||
auth_check($auth[$sub_menu], "r");
|
auth_check($auth[$sub_menu], "r");
|
||||||
|
|
||||||
$addr = trim($_GET['addr']);
|
|
||||||
$no = trim($_GET['no']);
|
|
||||||
|
|
||||||
if($addr) {
|
|
||||||
$option_list = '';
|
|
||||||
$zipfile = array();
|
|
||||||
$fp = fopen(G5_BBS_PATH."/zip.db", "r");
|
|
||||||
while(!feof($fp)) {
|
|
||||||
$zipfile[] = fgets($fp, 4096);
|
|
||||||
}
|
|
||||||
fclose($fp);
|
|
||||||
|
|
||||||
$search_count = 0;
|
|
||||||
|
|
||||||
while ($zipcode = each($zipfile))
|
|
||||||
{
|
|
||||||
if(strstr(substr($zipcode[1],8,512), $addr))
|
|
||||||
{
|
|
||||||
$address = trim($zipcode[1]);
|
|
||||||
|
|
||||||
$list[$search_count] = $address;
|
|
||||||
|
|
||||||
$search_count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($search_count) {
|
|
||||||
natsort($list);
|
|
||||||
if($no == 2)
|
|
||||||
$list = array_reverse($list);
|
|
||||||
|
|
||||||
$result = array();
|
|
||||||
|
|
||||||
foreach($list as $value) {
|
|
||||||
$code = substr($value, 0, 7);
|
|
||||||
$result[] = '<input type="hidden" name="code[]" value="'.$code.'">'.$value.' <button type="button" class="select_btn btn_frmline">선택</button>'.PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$g5['title'] = "우편번호 찾기";
|
$g5['title'] = "우편번호 찾기";
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
|
||||||
|
|
||||||
<div id="sendcost_postal_win" class="new_win">
|
<div id="post_code" class="new_win mbskin">
|
||||||
<h1><?php echo $g5['title']; ?></h1>
|
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
주소지의 시도를 선택해주세요.<br>
|
||||||
|
검색결과가 많은 경우 시/군/구를 지정하시됩니다.<br>
|
||||||
|
(검색결과는 최대 1,000건만 표시됩니다.)
|
||||||
|
</p>
|
||||||
|
|
||||||
<form name="fzipcode" id="fzipcode" method="get">
|
<form name="fzip" method="get" onsubmit="zipcode_call(); return false;" autocomplete="off">
|
||||||
<input type="hidden" name="no" value="<?php echo $no; ?>">
|
<!-- 검색어 입력 시작 { -->
|
||||||
|
<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">
|
||||||
|
<input type="submit" value="검색" class="btn_submit">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- } 검색어 입력 끝 -->
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="local_desc01 local_desc">
|
<div id="result"><span id="result_b4">시도를 선택 후 검색해주세요.</span></div>
|
||||||
<p>주소지의 시/군을 입력하세요.</p>
|
|
||||||
|
|
||||||
<fieldset>
|
<div class="win_btn">
|
||||||
<label for="addr">주소</label>
|
<button type="button" onclick="window.close();">창닫기</button>
|
||||||
<input type="text" name="addr" value="<?php echo stripslashes($addr); ?>" id="addr" class="frm_input" size="20">
|
|
||||||
<input type="submit" value=" 검색 " class="btn_frmline">
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php if($search_count) { ?>
|
|
||||||
<strong>검색결과</strong>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
for($i=0; $i<$search_count; $i++) {
|
|
||||||
?>
|
|
||||||
<li><?php echo $result[$i]; ?></li>
|
|
||||||
<?php } ?>
|
|
||||||
</ul>
|
|
||||||
<?php } else { ?>
|
|
||||||
<p>검색된 결과가 없습니다.</p>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn_win01 btn_win">
|
|
||||||
<a href="javascript:window.close();">창닫기</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
function zipcode_call(page)
|
||||||
$("#fzipcode").submit(function() {
|
{
|
||||||
if($.trim($("input[name=addr]").val()) == "") {
|
var sido = $("#sido").val();
|
||||||
alert("주소를 입력해 주십시오.");
|
var gugun = $("#gugun").val();
|
||||||
return false;
|
|
||||||
|
if(sido.length < 1) {
|
||||||
|
alert("시도를 선택해 주세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!page)
|
||||||
|
page = 1;
|
||||||
|
|
||||||
|
$.getJSON("//juso.sir.co.kr/zipcode.php?sido="+sido+"&gugun="+gugun+"&sort=<?php echo $sort; ?>&page="+page+"&callback=?",
|
||||||
|
function(data) {
|
||||||
|
$("#result").empty();
|
||||||
|
|
||||||
|
if(data.error) {
|
||||||
|
alert(data.error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#result").html(data.juso);
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
function put_data(zipcode)
|
||||||
});
|
{
|
||||||
|
var of = window.opener.document.fsendcost2;
|
||||||
|
|
||||||
$(".select_btn").click(function() {
|
of.sc_zip<?php echo $no; ?>.value = zipcode;
|
||||||
var code = $(this).closest("li").find("input[name='code[]']").val();
|
window.close();
|
||||||
var $opener = window.opener;
|
}
|
||||||
|
|
||||||
$opener.$("input[name=sc_zip<?php echo $no; ?>]").val(code);
|
|
||||||
window.close();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user