주문리스트에 주문 상품 레이어 추가
This commit is contained in:
100
adm/shop_admin/ajax.orderitem.php
Normal file
100
adm/shop_admin/ajax.orderitem.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$od_id = $_POST['od_id'];
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
if(!$od['od_id'])
|
||||
die('<div>주문정보가 존재하지 않습니다.</div>');
|
||||
|
||||
// 상품목록
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
cp_price,
|
||||
ct_notax
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
group by it_id
|
||||
order by ct_id ";
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<section id="cart_list">
|
||||
<h2 class="h2_frm">주문상품 목록</h2>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
|
||||
<table>
|
||||
<caption>주문 상품 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">상품명</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>
|
||||
<th scope="col">포인트</th>
|
||||
<th scope="col">배송비</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 상품이미지
|
||||
$image = get_it_image($row['it_id'], 50, 50);
|
||||
|
||||
// 상품의 옵션정보
|
||||
$sql = " select ct_id, it_id, ct_price, ct_qty, ct_option, ct_status, cp_price, ct_send_cost, io_type, io_price
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
and it_id = '{$row['it_id']}'
|
||||
order by io_type asc, ct_id asc ";
|
||||
$res = sql_query($sql);
|
||||
$rowspan = mysql_num_rows($res);
|
||||
|
||||
for($k=0; $opt=sql_fetch_array($res); $k++) {
|
||||
if($opt['io_type'])
|
||||
$opt_price = $opt['io_price'];
|
||||
else
|
||||
$opt_price = $opt['ct_price'] + $opt['io_price'];
|
||||
|
||||
// 소계
|
||||
$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
|
||||
$ct_point['stotal'] = $opt['ct_point'] * $opt['ct_qty'];
|
||||
?>
|
||||
<tr>
|
||||
<?php if($k == 0) { ?>
|
||||
<td rowspan="<?php echo $rowspan; ?>">
|
||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo stripslashes($row['it_name']); ?></a>
|
||||
<?php if($od['od_tax_flag'] && $row['ct_notax']) echo '[비과세상품]'; ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<?php echo $opt['ct_option']; ?>
|
||||
</td>
|
||||
<td class="td_mngsmall"><?php echo $opt['ct_status']; ?></td>
|
||||
<td class="td_num"><?php echo $opt['ct_qty']; ?></td>
|
||||
<td class="td_numsmall"><?php echo number_format($opt_price); ?></td>
|
||||
<td class="td_num"><?php echo number_format($ct_price['stotal']); ?></td>
|
||||
<td class="td_num"><?php echo number_format($opt['cp_price']); ?></td>
|
||||
<td class="td_num"><?php echo number_format($ct_point['stotal']); ?></td>
|
||||
<td class="td_sendcost_by"><?php echo $opt['ct_send_cost'] ? '착불' : '선불'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
@ -33,7 +33,7 @@ if ($od_status) {
|
||||
$sort1 = "od_receipt_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '배송' : // 배송중
|
||||
case '배송' : // 배송중
|
||||
$sort1 = "od_invoice_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
@ -292,7 +292,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>"><?php echo $row['od_id']; ?></a><br>
|
||||
</td> -->
|
||||
<td headers="th_ordnum" class="td_odrnum2" rowspan="2" colspan="2">
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>"><?php echo substr($row['od_id'],0,8).'-'.substr($row['od_id'],8); ?></a>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo substr($row['od_id'],0,8).'-'.substr($row['od_id'],8); ?></a>
|
||||
<?php echo $od_mobile; ?>
|
||||
</td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
@ -426,10 +426,43 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
|
||||
// 주문상품보기
|
||||
$(".orderitem").on("click", function() {
|
||||
var $this = $(this);
|
||||
var od_id = $this.text().replace(/[^0-9]/g, "");
|
||||
|
||||
if($this.next().size())
|
||||
return false;
|
||||
|
||||
$("#orderitemlist").remove();
|
||||
|
||||
$.post(
|
||||
"./ajax.orderitem.php",
|
||||
{ od_id: od_id },
|
||||
function(data) {
|
||||
$this.parent().append("<div id=\"orderitemlist\"><div></div></div>");
|
||||
$("#orderitemlist > div")
|
||||
.html(data)
|
||||
.append("<div><button type=\"button\" id=\"orderitemlist-x\">닫기</button></div>");
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 상품리스트 닫기
|
||||
$("#orderitemlist-x").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
$("body").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
});
|
||||
|
||||
function set_date(today)
|
||||
function set_date(today)
|
||||
{
|
||||
if (today == "오늘") {
|
||||
document.getElementById("fr_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
@ -468,10 +501,10 @@ function forderlist_submit(f)
|
||||
|
||||
/*
|
||||
switch (f.od_status.value) {
|
||||
case "" :
|
||||
case "" :
|
||||
alert("변경하실 주문상태를 선택하세요.");
|
||||
return false;
|
||||
case '주문' :
|
||||
case '주문' :
|
||||
|
||||
default :
|
||||
|
||||
@ -493,9 +526,9 @@ function forderlist_submit(f)
|
||||
|
||||
var chk = document.getElementsByName("chk[]");
|
||||
|
||||
for (var i=0; i<chk.length; i++)
|
||||
for (var i=0; i<chk.length; i++)
|
||||
{
|
||||
if (chk[i].checked)
|
||||
if (chk[i].checked)
|
||||
{
|
||||
var k = chk[i].value;
|
||||
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
|
||||
@ -503,21 +536,21 @@ function forderlist_submit(f)
|
||||
|
||||
switch (change_status)
|
||||
{
|
||||
case "입금" :
|
||||
case "입금" :
|
||||
if (!(current_status == "주문" && current_settle_case == "무통장")) {
|
||||
alert("'주문' 상태의 '무통장'(결제수단)인 경우에만 '입금' 처리 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "준비" :
|
||||
case "준비" :
|
||||
if (current_status != "입금") {
|
||||
alert("'입금' 상태의 주문만 '준비'로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "배송" :
|
||||
case "배송" :
|
||||
if (current_status != "준비") {
|
||||
alert("'준비' 상태의 주문만 '배송'으로 변경이 가능합니다.");
|
||||
return false;
|
||||
@ -552,7 +585,7 @@ function forderlist_submit(f)
|
||||
|
||||
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
|
||||
f.action = "./orderlistupdate.php";
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -441,6 +441,8 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
|
||||
/* 주문내역 */
|
||||
#sodr_list td {text-align:center !important}
|
||||
#orderitemlist {position:relative}
|
||||
#orderitemlist > div {position:absolute;top:0;left:0}
|
||||
|
||||
/* 주문내역 수정 */
|
||||
.sodr_nonpay {color:#ff6600}
|
||||
|
||||
Reference in New Issue
Block a user