주문내역 부분 출력관련 질문입니다 orderinquiryview.php문서
본문
http://sir.co.kr/bbs/board.php?bo_table=yc5_tip&wr_id=183&page=2
영카트 팁게시판의 이 글을 참조하였구요.
실질적인 구현은 되어 작동은 되고 있습니다.
다만 문제가 저희는 orderinquiryview.php 에서 문서를 출력하여 주문서로 활용하는데요.
이렇게 추가작업내용 부분이 두번이나 들어가버리게 됩니다.
추가작업내용부분의 출력부분의 위치를 바꿔버리면 아에 화면에서 보이지 않게 되고 원래 위치에 넣게되면 이처럼 두번이 표시가 되는데 혼자 아웅다웅씨름하다가 도저히 안되겠어서 질문드려봅니다..
해당옵션이 출력되는 부분에 대한 구문 ↓
<div class="tbl_head02 tbl_wrap">
<thead>
<tr>
<th scope="col" rowspan="2">이미지</th>
<th scope="col" colspan="7" id="th_itname">상품명</th>
</tr>
<tr>
<th scope="col" id="th_itopt">옵션명</th>
<th scope="col" id="th_itqty">수량</th>
<th scope="col" id="th_itprice">판매가</th>
<th scope="col" id="th_itsum">소계</th>
<th scope="col" id="th_itpt">할인액</th>
<th scope="col" id="th_itpt">배송비</th>
<th scope="col" id="th_itst">상태</th>
</tr>
</thead>
<tbody>
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$image = get_it_image($row['it_id'], 70, 70);
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price, ct_msg, ct_file
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) +1;
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_qty) as qty
from {$g5['g5_shop_cart_table']}
where it_id = '{$row['it_id']}'
and od_id = '$od_id' ";
$sum = sql_fetch($sql);
// 배송비
switch($row['ct_send_cost'])
{
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id);
if($sendcost == 0)
$ct_send_cost = '무료';
}
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'];
$sell_price = $opt_price * $opt['ct_qty'];
$point = $opt['ct_point'] * $opt['ct_qty'];
if($k == 0) {
?>
<tr>
<td rowspan="<?php echo $rowspan; ?>" class="td_imgsmall"><?php echo $image; ?></td>
<td headers="th_itname" colspan="7"><a href="./item.php?it_id=<?php echo $row['it_id']; ?>"><?php echo $row['it_name']; ?></a></td>
</tr>
<?php } ?>
<tr>
<td headers="th_itopt"><?php echo $opt['ct_option']; ?></td>
<td headers="th_itqty" class="td_mngsmall"><?php echo number_format($opt['ct_qty']); ?></td>
<td headers="th_itprice" class="td_numbig"><?php echo number_format($opt_price); ?></td>
<td headers="th_itsum" class="td_numbig"><?php echo number_format($sell_price); ?></td>
<td headers="th_itpt" class="td_num"><?php echo number_format($point); ?></td>
<td headers="th_itpt" class="td_dvr"><?php echo $ct_send_cost; ?></td>
<td headers="th_itst" class="td_mngsmall"><?php echo $opt['ct_status']; ?></td>
</tr>
<?php
if($opt['ct_msg'] | $opt['ct_file']) {
?>
<tr>
<th headers="ct_msg">추가작업내용</th>
<td colspan="4" class="td_mngsmall"><?php echo stripslashes($opt['ct_msg']); ?></td>
<th headers="ct_file">첨부파일</th>
<td colspan="2" class="td_mngsmall"><a href="<?php echo G5_DATA_URL."/odfile/".$opt['ct_file']?>" target="_blank">다운받기</a></td>
</tr>
<?php
}
?>
<?php
$tot_point += $point;
$st_count1++;
if($opt['ct_status'] == '주문')
$st_count2++;
}
}
// 주문 상품의 상태가 모두 주문이면 고객 취소 가능
if($st_count1 > 0 && $st_count1 == $st_count2)
$custom_cancel = true;
?>
</tbody>
</table>
</div>
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$tot_price = $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']
- $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon']
- $od['od_cancel_price'];
?>
<dl id="sod_bsk_tot">
<dt class="sod_bsk_dvr">주문총액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_price']); ?> 원</strong></dd>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">개별상품 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">주문금액 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비 쿠폰할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost2'] > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_cancel_price'] > 0) { ?>
<dt class="sod_bsk_dvr">취소금액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cancel_price']); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원</strong></dd>
<dt class="sod_bsk_point">할인액</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
</dl>
</section>