#204 관리자 주문상세 상품리스트 변경 작업
This commit is contained in:
@ -86,37 +86,22 @@ if ($default['de_card_test']) {
|
|||||||
$g4['shop_cardpg']['kcp'] = "http://testadmin8.kcp.co.kr";
|
$g4['shop_cardpg']['kcp'] = "http://testadmin8.kcp.co.kr";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = " select ct_id,
|
// 주문총액
|
||||||
it_id,
|
$sql = " select SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty)) as sum_order
|
||||||
it_name,
|
from {$g4['shop_cart_table']}
|
||||||
ct_qty,
|
where uq_id = '{$od['uq_id']}' ";
|
||||||
ct_option,
|
$row = sql_fetch($sql);
|
||||||
ct_price,
|
$total_order = $row['sum_order'];
|
||||||
ct_point,
|
|
||||||
ct_status,
|
// 상품목록
|
||||||
ct_time,
|
$sql = " select it_id,
|
||||||
ct_point_use,
|
it_name
|
||||||
ct_stock_use,
|
|
||||||
io_type,
|
|
||||||
io_price,
|
|
||||||
ct_num
|
|
||||||
from {$g4['shop_cart_table']}
|
from {$g4['shop_cart_table']}
|
||||||
where uq_id = '{$od['uq_id']}'
|
where uq_id = '{$od['uq_id']}'
|
||||||
|
and ct_num = '0'
|
||||||
order by ct_id ";
|
order by ct_id ";
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
|
|
||||||
$lines = array();
|
|
||||||
$total_order = 0;
|
|
||||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
|
||||||
$lines[$i] = $row;
|
|
||||||
if($row['io_type'])
|
|
||||||
$total_price = $row['io_price'] * $row['ct_qty'];
|
|
||||||
else
|
|
||||||
$total_price = ($row['ct_price'] + $row['io_price']) * $row['ct_qty'];
|
|
||||||
$lines[$i]['price'] = $total_price;
|
|
||||||
$total_order += $total_price;
|
|
||||||
}
|
|
||||||
|
|
||||||
$pg_anchor = '<ul class="anchor">
|
$pg_anchor = '<ul class="anchor">
|
||||||
<li><a href="#anc_sodr_list">주문상품 목록</a></li>
|
<li><a href="#anc_sodr_list">주문상품 목록</a></li>
|
||||||
<li><a href="#anc_sodr_pay">주문결제 내역</a></li>
|
<li><a href="#anc_sodr_pay">주문결제 내역</a></li>
|
||||||
@ -148,64 +133,85 @@ $pg_anchor = '<ul class="anchor">
|
|||||||
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
||||||
<input type="hidden" name="page" value="<?php echo $page;?>">
|
<input type="hidden" name="page" value="<?php echo $page;?>">
|
||||||
|
|
||||||
<table>
|
<label for="sit_select_all" class="sound_only">현재 상품 목록 전체선택</label>
|
||||||
<thead>
|
<input type="checkbox" id="sit_select_all">
|
||||||
<tr>
|
|
||||||
<th scope="col">
|
|
||||||
<label for="sit_select_all" class="sound_only">현재 상품 목록 전체선택</label>
|
|
||||||
<input type="checkbox" id="sit_select_all" onclick="select_all();">
|
|
||||||
</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">포인트<br>반영</th>
|
|
||||||
<th scope="col">재고<br>반영</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
for ($i=0; $i<count($lines); $i++) {
|
|
||||||
$ct_amount['소계'] = $lines[$i]['price'];
|
|
||||||
$ct_point['소계'] = $lines[$i]['ct_point'] * $lines[$i]['ct_qty'];
|
|
||||||
if ($lines[$i]['ct_status']=='주문' || $lines[$i]['ct_status']=='준비' || $lines[$i]['ct_status']=='배송' || $lines[$i]['ct_status']=='완료')
|
|
||||||
$t_ct_amount['정상'] += $lines[$i]['price'];
|
|
||||||
else if ($lines[$i]['ct_status']=='취소' || $lines[$i]['ct_status']=='반품' || $lines[$i]['ct_status']=='품절')
|
|
||||||
$t_ct_amount['취소'] += $lines[$i]['price'];
|
|
||||||
|
|
||||||
$image = get_it_image($lines[$i]['it_id'], 50, 50);
|
<ul>
|
||||||
?>
|
<?php
|
||||||
|
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||||
|
// 상품이미지
|
||||||
|
$image = get_it_image($row['it_id'], 50, 50);
|
||||||
|
?>
|
||||||
|
<li>
|
||||||
|
<span><a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?></a></span>
|
||||||
|
<span>
|
||||||
|
<label for="sit_sel_<?php echo $i; ?>" class="sound_only"><?php echo $row['it_name']; ?> 옵션 전체선택</label>
|
||||||
|
<input type="checkbox" id="sit_sel_<?php echo $i; ?>" name="it_sel[]">
|
||||||
|
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo stripslashes($row['it_name']); ?></a>
|
||||||
|
</span>
|
||||||
|
<table>
|
||||||
|
<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">포인트<br>반영</th>
|
||||||
|
<th scope="col">재고<br>반영</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
// 상품의 옵션정보
|
||||||
|
$sql = " select ct_id, it_id, ct_price, ct_qty, ct_option, ct_status, ct_stock_use, ct_point_use, io_type, io_price
|
||||||
|
from {$g4['shop_cart_table']}
|
||||||
|
where uq_id = '{$od['uq_id']}'
|
||||||
|
and it_id = '{$row['it_id']}'
|
||||||
|
order by ct_num ";
|
||||||
|
$res = sql_query($sql);
|
||||||
|
|
||||||
<? if($lines[$i]['ct_num'] == 0) { ?>
|
for($k=0; $opt=sql_fetch_array($res); $k++) {
|
||||||
<tr>
|
if($opt['io_type'])
|
||||||
<td colspan="9"><a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?><?php echo stripslashes($lines[$i]['it_name']); ?></a></td>
|
$opt_price = $opt['io_price'];
|
||||||
</tr>
|
else
|
||||||
<?php } ?>
|
$opt_price = $opt['ct_price'] + $opt['io_price'];
|
||||||
<tr>
|
|
||||||
<td class="td_chk">
|
|
||||||
<input type="hidden" name="ct_id[<?php echo $i; ?>]" value="<?php echo $lines[$i]['ct_id']; ?>">
|
|
||||||
<label for="ct_chk_<?php echo $i; ?>" class="sound_only"><?php echo $lines[$i]['it_name']; ?> 체크</label>
|
|
||||||
<input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" id="ct_chk_<?php echo $i; ?>">
|
|
||||||
</td>
|
|
||||||
<td><?php echo $lines[$i]['ct_option']; ?></td>
|
|
||||||
<td class="td_small_stats"><?php echo $lines[$i]['ct_status']; ?></td>
|
|
||||||
<td class="td_num"><?php echo $lines[$i]['ct_qty']; ?></td>
|
|
||||||
<td class="td_num"><?php echo number_format($lines[$i]['ct_price']); ?></td>
|
|
||||||
<td class="td_num"><?php echo number_format($ct_amount['소계']); ?></td>
|
|
||||||
<td class="td_num"><?php echo number_format($ct_point['소계']); ?></td>
|
|
||||||
<td class="td_small_stats"><?php echo get_yn($lines[$i]['ct_point_use']); ?></td>
|
|
||||||
<td class="td_small_stats"><?php echo get_yn($lines[$i]['ct_stock_use']); ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
$ct_amount['소계'] = $opt_price * $opt['ct_qty'];
|
||||||
$t_ct_amount['합계'] += $ct_amount['소계'];
|
$ct_point['소계'] = $opt['ct_point'] * $opt['ct_qty'];
|
||||||
$t_ct_point['합계'] += $ct_point['소계'];
|
if ($opt['ct_status']=='주문' || $opt['ct_status']=='준비' || $opt['ct_status']=='배송' || $opt['ct_status']=='완료')
|
||||||
}
|
$t_ct_amount['정상'] += $ct_amount['소계'];
|
||||||
?>
|
else if ($opt['ct_status']=='취소' || $opt['ct_status']=='반품' || $opt['ct_status']=='품절')
|
||||||
</tbody>
|
$t_ct_amount['취소'] += $ct_amount['소계'];
|
||||||
</table>
|
?>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="ct_id[]" value="<?php echo $opt['ct_id']; ?>">
|
||||||
|
<label for="ct_opt_chk_<?php echo $i.$k; ?>" class="sound_only"><?php echo $opt['ct_option']; ?> 체크</label>
|
||||||
|
<input type="checkbox" name="ct_chk[]" id="ct_opt_chk_<?php echo $i.$k; ?>" value="1">
|
||||||
|
<?php echo $opt['ct_option']; ?>
|
||||||
|
</td>
|
||||||
|
<td class="td_small_stats"><?php echo $opt['ct_status']; ?></td>
|
||||||
|
<td class="td_num"><?php echo $opt['ct_qty']; ?></td>
|
||||||
|
<td class="td_num"><?php echo number_format($opt_price); ?></td>
|
||||||
|
<td class="td_num"><?php echo number_format($ct_amount['소계']); ?></td>
|
||||||
|
<td class="td_num"><?php echo number_format($ct_point['소계']); ?></td>
|
||||||
|
<td class="td_small_stats"><?php echo get_yn($opt['ct_point_use']); ?></td>
|
||||||
|
<td class="td_small_stats"><?php echo get_yn($opt['ct_stock_use']); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</li>
|
||||||
|
<?
|
||||||
|
$t_ct_amount['합계'] += $ct_amount['소계'];
|
||||||
|
$t_ct_point['합계'] += $ct_point['소계'];
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="btn_list">
|
<div class="btn_list">
|
||||||
<input type="hidden" name="chk_cnt" value="<?php echo $i; ?>">
|
<input type="hidden" name="chk_cnt" value="<?php echo $i; ?>">
|
||||||
@ -795,27 +801,27 @@ $pg_anchor = '<ul class="anchor">
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var select_all_sw = false;
|
$(function() {
|
||||||
var visible_sw = false;
|
// 전체 옵션선택
|
||||||
|
$("#sit_select_all").click(function() {
|
||||||
|
if($(this).is(":checked")) {
|
||||||
|
$("input[name='it_sel[]']").attr("checked", true);
|
||||||
|
$("input[name='ct_chk[]']").attr("checked", true);
|
||||||
|
} else {
|
||||||
|
$("input[name='it_sel[]']").attr("checked", false);
|
||||||
|
$("input[name='ct_chk[]']").attr("checked", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 전체선택, 전체해제
|
// 상품의 옵션선택
|
||||||
function select_all()
|
$("input[name='it_sel[]']").click(function() {
|
||||||
{
|
var $chk = $(this).closest("li").find("input[name='ct_chk[]']");
|
||||||
var f = document.frmorderform;
|
if($(this).is(":checked"))
|
||||||
|
$chk.attr("checked", true);
|
||||||
for (i=0; i<f.chk_cnt.value; i++)
|
|
||||||
{
|
|
||||||
if (select_all_sw == false)
|
|
||||||
document.getElementById('ct_chk_'+i).checked = true;
|
|
||||||
else
|
else
|
||||||
document.getElementById('ct_chk_'+i).checked = false;
|
$chk.attr("checked", false);
|
||||||
}
|
});
|
||||||
|
});
|
||||||
if (select_all_sw == false)
|
|
||||||
select_all_sw = true;
|
|
||||||
else
|
|
||||||
select_all_sw = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function form_submit(f)
|
function form_submit(f)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user