모바일 배송지목록 기능 추가
This commit is contained in:
@ -3,15 +3,23 @@ include_once('./_common.php');
|
|||||||
|
|
||||||
$g5['title'] = '배송지 목록';
|
$g5['title'] = '배송지 목록';
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="new_win">
|
$order_action_url = G5_HTTPS_SHOP_URL.'/orderaddressupdate.php';
|
||||||
<h1 id="new_win_title"><?php echo $g5['title']; ?></h1>
|
|
||||||
|
?>
|
||||||
|
<form name="forderaddress" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
|
||||||
|
<div id="sod_addr_list" class="new_win">
|
||||||
|
|
||||||
|
<h1 id="new_win_title">배송지 목록</h1>
|
||||||
|
|
||||||
<table class="basic_tbl">
|
<table class="basic_tbl">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th scope="col">
|
||||||
|
<label for="chk_all" class="sound_only">전체선택</label><input type="checkbox" name="chk_all" id="chk_all">
|
||||||
|
</th>
|
||||||
<th scope="col">배송지명</th>
|
<th scope="col">배송지명</th>
|
||||||
|
<th scope="col">기본<br>배송지</th>
|
||||||
<th scope="col">이름</th>
|
<th scope="col">이름</th>
|
||||||
<th scope="col">전화번호</th>
|
<th scope="col">전화번호</th>
|
||||||
<th scope="col">주소</th>
|
<th scope="col">주소</th>
|
||||||
@ -25,13 +33,18 @@ include_once(G5_PATH.'/head.sub.php');
|
|||||||
$addr = $row['ad_name'].$sep.$row['ad_tel'].$sep.$row['ad_hp'].$sep.$row['ad_zip1'].$sep.$row['ad_zip2'].$sep.$row['ad_addr1'].$sep.$row['ad_addr2'].$sep.$row['ad_subject'];
|
$addr = $row['ad_name'].$sep.$row['ad_tel'].$sep.$row['ad_hp'].$sep.$row['ad_zip1'].$sep.$row['ad_zip2'].$sep.$row['ad_addr1'].$sep.$row['ad_addr2'].$sep.$row['ad_subject'];
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="td_name"><?php echo $row['ad_subject']; ?></td>
|
<td class="td_chk"><label for="chk_<?php echo $i;?>" class="sound_only">배송지선택</label>
|
||||||
|
<input type="hidden" name="ad_id[<?php echo $i; ?>]" value="<?php echo $row['ad_id'];?>">
|
||||||
|
<input type="checkbox" name="chk[]" value="<?php echo $i;?>" id="chk_<?php echo $i;?>">
|
||||||
|
</td>
|
||||||
|
<td class="td_name"><input type="text" name="ad_subject[<?php echo $i; ?>]" id="ad_subject" class="frm_input" size="12" maxlength="20" value="<?php echo $row['ad_subject']; ?>"></td>
|
||||||
|
<td class="td_default"><label for="ad_default<?php echo $i;?>" class="sound_only">기본배송지</label><input type="radio" name="ad_default" value="<?php echo $row['ad_id'];?>" id="ad_default<?php echo $i;?>" <?php if($row['ad_default']) echo 'checked="checked"';?>></td>
|
||||||
<td class="td_smallname"><?php echo $row['ad_name']; ?></td>
|
<td class="td_smallname"><?php echo $row['ad_name']; ?></td>
|
||||||
<td class="td_bignum"><?php echo $row['ad_tel']; ?><br><?php echo $row['ad_hp']; ?></td>
|
<td class="td_bignum"><?php echo $row['ad_tel']; ?><br><?php echo $row['ad_hp']; ?></td>
|
||||||
<td><?php echo sprintf('%s %s', $row['ad_addr1'], $row['ad_addr2']); ?></td>
|
<td><?php echo sprintf('%s %s', $row['ad_addr1'], $row['ad_addr2']); ?></td>
|
||||||
<td class="td_mng">
|
<td class="td_mng">
|
||||||
<input type="hidden" value="<?php echo $addr; ?>">
|
<input type="hidden" value="<?php echo $addr; ?>">
|
||||||
<button type="button" class="sel_address">선택</button>
|
<button type="button" class="sel_address btn_frmline">선택</button>
|
||||||
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?w=d&ad_id=<?php echo $row['ad_id']; ?>" class="del_address">삭제</a>
|
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?w=d&ad_id=<?php echo $row['ad_id']; ?>" class="del_address">삭제</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -40,7 +53,13 @@ include_once(G5_PATH.'/head.sub.php');
|
|||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="btn_list">
|
||||||
|
<input type="submit" name="act_button" value="선택수정" id="btn_submit">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page="); ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -75,6 +94,23 @@ $(function() {
|
|||||||
$(".del_address").on("click", function() {
|
$(".del_address").on("click", function() {
|
||||||
return confirm("배송지 목록을 삭제하시겠습니까?");
|
return confirm("배송지 목록을 삭제하시겠습니까?");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 전체선택 부분
|
||||||
|
$("#chk_all").on("click", function() {
|
||||||
|
if($(this).is(":checked")) {
|
||||||
|
$("input[name^='chk[']").attr("checked", true);
|
||||||
|
} else {
|
||||||
|
$("input[name^='chk[']").attr("checked", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#btn_submit").on("click", function() {
|
||||||
|
if($("input[name^='chk[']:checked").length==0 ){
|
||||||
|
alert("수정하실 항목을 하나 이상 선택하세요.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -431,6 +431,11 @@ ob_end_clean();
|
|||||||
// 배송지 이력
|
// 배송지 이력
|
||||||
$addr_list = '';
|
$addr_list = '';
|
||||||
$sep = chr(30);
|
$sep = chr(30);
|
||||||
|
|
||||||
|
// 주문자와 동일
|
||||||
|
$addr_list .= '<input type="radio" name="ad_sel_addr" value="same" id="ad_sel_addr_same">'.PHP_EOL;
|
||||||
|
$addr_list .= '<label for="ad_sel_addr_same">주문자와 동일</label>'.PHP_EOL;
|
||||||
|
|
||||||
// 기본배송지
|
// 기본배송지
|
||||||
$sql = " select *
|
$sql = " select *
|
||||||
from {$g5['g5_shop_order_address_table']}
|
from {$g5['g5_shop_order_address_table']}
|
||||||
@ -447,6 +452,7 @@ ob_end_clean();
|
|||||||
$sql = " select *
|
$sql = " select *
|
||||||
from {$g5['g5_shop_order_address_table']}
|
from {$g5['g5_shop_order_address_table']}
|
||||||
where mb_id = '{$member['mb_id']}'
|
where mb_id = '{$member['mb_id']}'
|
||||||
|
and ad_default = '0'
|
||||||
order by ad_id desc
|
order by ad_id desc
|
||||||
limit 2 ";
|
limit 2 ";
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
@ -468,7 +474,11 @@ ob_end_clean();
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="ad_subject">배송지명</label></th>
|
<th scope="row"><label for="ad_subject">배송지명</label></th>
|
||||||
<td><input type="text" name="ad_subject" id="ad_subject" class="frm_input" maxlength="20"></td>
|
<td>
|
||||||
|
<input type="text" name="ad_subject" id="ad_subject" class="frm_input" maxlength="20">
|
||||||
|
<input type="checkbox" name="ad_default" id="ad_default" value="1">
|
||||||
|
<label for="ad_default">기본배송지로 설정</label>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -1052,31 +1062,35 @@ $(function() {
|
|||||||
$("input[name=ad_sel_addr]").on("click", function() {
|
$("input[name=ad_sel_addr]").on("click", function() {
|
||||||
var addr = $(this).val().split(String.fromCharCode(30));
|
var addr = $(this).val().split(String.fromCharCode(30));
|
||||||
|
|
||||||
if(addr[0] == "new") {
|
if (addr[0] == "same") {
|
||||||
for(i=0; i<8; i++) {
|
gumae2baesong();
|
||||||
addr[i] = "";
|
} else {
|
||||||
|
if(addr[0] == "new") {
|
||||||
|
for(i=0; i<8; i++) {
|
||||||
|
addr[i] = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var f = document.forderform;
|
var f = document.forderform;
|
||||||
f.od_b_name.value = addr[0];
|
f.od_b_name.value = addr[0];
|
||||||
f.od_b_tel.value = addr[1];
|
f.od_b_tel.value = addr[1];
|
||||||
f.od_b_hp.value = addr[2];
|
f.od_b_hp.value = addr[2];
|
||||||
f.od_b_zip1.value = addr[3];
|
f.od_b_zip1.value = addr[3];
|
||||||
f.od_b_zip2.value = addr[4];
|
f.od_b_zip2.value = addr[4];
|
||||||
f.od_b_addr1.value = addr[5];
|
f.od_b_addr1.value = addr[5];
|
||||||
f.od_b_addr2.value = addr[6];
|
f.od_b_addr2.value = addr[6];
|
||||||
f.ad_subject.value = addr[7];
|
f.ad_subject.value = addr[7];
|
||||||
|
|
||||||
var zip1 = addr[3].replace(/[^0-9]/g, "");
|
var zip1 = addr[3].replace(/[^0-9]/g, "");
|
||||||
var zip2 = addr[4].replace(/[^0-9]/g, "");
|
var zip2 = addr[4].replace(/[^0-9]/g, "");
|
||||||
|
|
||||||
if(zip1 != "" && zip2 != "") {
|
if(zip1 != "" && zip2 != "") {
|
||||||
var code = String(zip1) + String(zip2);
|
var code = String(zip1) + String(zip2);
|
||||||
|
|
||||||
if(zipcode != code) {
|
if(zipcode != code) {
|
||||||
zipcode = code;
|
zipcode = code;
|
||||||
calculate_sendcost(code);
|
calculate_sendcost(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1469,8 +1483,10 @@ function payment_check(f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 구매자 정보와 동일합니다.
|
// 구매자 정보와 동일합니다.
|
||||||
function gumae2baesong(f)
|
function gumae2baesong()
|
||||||
{
|
{
|
||||||
|
var f = document.forderform;
|
||||||
|
|
||||||
f.od_b_name.value = f.od_name.value;
|
f.od_b_name.value = f.od_name.value;
|
||||||
f.od_b_tel.value = f.od_tel.value;
|
f.od_b_tel.value = f.od_tel.value;
|
||||||
f.od_b_hp.value = f.od_hp.value;
|
f.od_b_hp.value = f.od_hp.value;
|
||||||
|
|||||||
@ -581,21 +581,19 @@ if (get_session('ss_direct'))
|
|||||||
set_session('ss_cart_direct', '');
|
set_session('ss_cart_direct', '');
|
||||||
|
|
||||||
// 배송지처리
|
// 배송지처리
|
||||||
if($is_member && ($add_address || $ad_default)) {
|
if($is_member) {
|
||||||
$ad_zip1 = $od_b_zip1;
|
$sql = " select * from {$g5['g5_shop_order_address_table']}
|
||||||
$ad_zip2 = $od_b_zip2;
|
|
||||||
$ad_addr1 = $od_b_addr1;
|
|
||||||
$ad_addr2 = $od_b_addr2;
|
|
||||||
|
|
||||||
$sql = " select ad_id
|
|
||||||
from {$g5['g5_shop_order_address_table']}
|
|
||||||
where mb_id = '{$member['mb_id']}'
|
where mb_id = '{$member['mb_id']}'
|
||||||
and ad_zip1 = '$ad_zip1'
|
and ad_name = '$od_b_name'
|
||||||
and ad_zip2 = '$ad_zip2'
|
and ad_tel = '$od_b_tel'
|
||||||
and ad_addr1 = '$ad_addr1'
|
and ad_hp = '$od_b_hp'
|
||||||
and ad_addr2 = '$ad_addr2' ";
|
and ad_zip1 = '$od_b_zip1'
|
||||||
|
and ad_zip2 = '$od_b_zip2'
|
||||||
|
and ad_addr1 = '$od_b_addr1'
|
||||||
|
and ad_addr2 = '$od_b_addr2' ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
|
|
||||||
|
// 기본배송지 체크
|
||||||
if($ad_default) {
|
if($ad_default) {
|
||||||
$sql = " update {$g5['g5_shop_order_address_table']}
|
$sql = " update {$g5['g5_shop_order_address_table']}
|
||||||
set ad_default = '0'
|
set ad_default = '0'
|
||||||
@ -603,22 +601,13 @@ if($is_member && ($add_address || $ad_default)) {
|
|||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($row['ad_id']) {
|
if($row['ad_id']){
|
||||||
$sql = " update {$g5['g5_shop_order_address_table']}
|
$sql = " update {$g5['g5_shop_order_address_table']}
|
||||||
set ad_zip1 = '$ad_zip1',
|
set ad_default = '1',
|
||||||
ad_zip2 = '$ad_zip2',
|
ad_subject = '$ad_subject'
|
||||||
ad_addr1 = '$ad_addr1',
|
where mb_id = '{$member['mb_id']}'
|
||||||
ad_addr2 = '$ad_addr2' ";
|
and ad_id = '{$row['ad_id']}' ";
|
||||||
if($ad_default)
|
} else {
|
||||||
$sql .= " , ad_default = '$ad_default' ";
|
|
||||||
if($ad_subject)
|
|
||||||
$sql .= " , ad_subject = '$ad_subject' ";
|
|
||||||
$sql .= " where ad_id = '{$row['ad_id']}'
|
|
||||||
and mb_id = '{$member['mb_id']}' ";
|
|
||||||
sql_query($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$row['ad_id'] && $add_address) {
|
|
||||||
$sql = " insert into {$g5['g5_shop_order_address_table']}
|
$sql = " insert into {$g5['g5_shop_order_address_table']}
|
||||||
set mb_id = '{$member['mb_id']}',
|
set mb_id = '{$member['mb_id']}',
|
||||||
ad_subject = '$ad_subject',
|
ad_subject = '$ad_subject',
|
||||||
@ -630,8 +619,9 @@ if($is_member && ($add_address || $ad_default)) {
|
|||||||
ad_zip2 = '$od_b_zip2',
|
ad_zip2 = '$od_b_zip2',
|
||||||
ad_addr1 = '$od_b_addr1',
|
ad_addr1 = '$od_b_addr1',
|
||||||
ad_addr2 = '$od_b_addr2' ";
|
ad_addr2 = '$od_b_addr2' ";
|
||||||
sql_query($sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);
|
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$od_id.'&uid='.$uid);
|
||||||
|
|||||||
@ -31,9 +31,6 @@ $sql = " select *
|
|||||||
|
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
|
|
||||||
//$qstr = $qstr.'&sca='.$sca.'&page='.$page;
|
|
||||||
$qstr = $qstr.'&sca='.$sca.'&page='.$page.'&save_stx='.$stx;
|
|
||||||
|
|
||||||
if(!mysql_num_rows($result))
|
if(!mysql_num_rows($result))
|
||||||
alert_close('배송지 목록 자료가 없습니다.');
|
alert_close('배송지 목록 자료가 없습니다.');
|
||||||
|
|
||||||
@ -49,8 +46,6 @@ $order_action_url = G5_HTTPS_SHOP_URL.'/orderaddressupdate.php';
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<form name="forderaddress" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
|
<form name="forderaddress" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
|
||||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
|
||||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
|
||||||
<div id="sod_addr_list" class="new_win">
|
<div id="sod_addr_list" class="new_win">
|
||||||
|
|
||||||
<h1 id="new_win_title">배송지 목록</h1>
|
<h1 id="new_win_title">배송지 목록</h1>
|
||||||
|
|||||||
@ -664,7 +664,7 @@ function get_intall_file()
|
|||||||
$sep = chr(30);
|
$sep = chr(30);
|
||||||
|
|
||||||
// 주문자와 동일
|
// 주문자와 동일
|
||||||
$addr_list .= '<input type="radio" name="ad_sel_addr" value="same">'.PHP_EOL;
|
$addr_list .= '<input type="radio" name="ad_sel_addr" value="same" id="ad_sel_addr_same">'.PHP_EOL;
|
||||||
$addr_list .= '<label for="ad_sel_addr_same">주문자와 동일</label>'.PHP_EOL;
|
$addr_list .= '<label for="ad_sel_addr_same">주문자와 동일</label>'.PHP_EOL;
|
||||||
|
|
||||||
// 기본배송지
|
// 기본배송지
|
||||||
@ -707,10 +707,8 @@ function get_intall_file()
|
|||||||
<th scope="row"><label for="ad_subject">배송지명</label></th>
|
<th scope="row"><label for="ad_subject">배송지명</label></th>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="ad_subject" id="ad_subject" class="frm_input" maxlength="20">
|
<input type="text" name="ad_subject" id="ad_subject" class="frm_input" maxlength="20">
|
||||||
<?php if ($addr_list) {
|
<input type="checkbox" name="ad_default" id="ad_default" value="1">
|
||||||
echo '<input type="checkbox" name="ad_default" id="ad_default" value="1">'.PHP_EOL.'
|
<label for="ad_default">기본배송지로 설정</label>
|
||||||
<label for="ad_default">기본배송지로 설정</label>';
|
|
||||||
}?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user