아래처럼 있는걸로 확인됩니다만 추가를 해줘야할게 있을까요 ?ㅠㅠ
<?php
unset($save);
unset($tot);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($i == 0)
$save['od_date'] = $row['od_date'];
if ($save['od_date'] != $row['od_date']) {
print_line($save);
unset($save);
$save['od_date'] = $row['od_date'];
}
$save['ordercount']++;
$save['orderprice1'] += $row['orderprice1'];
$save['orderprice'] += $row['orderprice'];
$save['ordercancel'] -= $row['od_cancel_price'];
$save['ordercoupon'] -= $row['couponprice'];
if($row['od_settle_case'] == '무통장')
$save['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$save['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$save['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '배송비')
$save['od_send_cost'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_price'];
$save['receiptpoint'] -= $row['od_receipt_point'];
$save['misu'] -= $row['od_misu'];
$tot['ordercount']++;
$tot['orderprice1'] += $row['orderprice1'];
$tot['orderprice'] += $row['orderprice'];
$tot['ordercancel'] -= $row['od_cancel_price'];
$tot['ordercoupon'] -= $row['couponprice'];
if($row['od_settle_case'] == '무통장')
$tot['receiptbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '가상계좌')
$tot['receiptvbank'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '계좌이체')
$tot['receiptiche'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '배송비')
$tot['od_send_cost'] += $row['od_receipt_price'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_price'];
$tot['receiptpoint'] -= $row['od_receipt_point'];
$tot['od_refund_price'] += $row['od_refund_price'];
$tot['misu'] -= $row['od_misu'];
}
if ($i == 0) {
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
} else {
print_line($save);
}
?>