0 or a.od_coupon > 0 or a.od_send_coupon > 0 ) "; } if ($od_escrow) { $where[] = " a.od_escrow = 1 "; } if ($fr_date && $to_date) { $where[] = " a.od_time between '$fr_date 00:00:00' AND '$to_date 23:59:59' "; } if ($where) { $sql_search = ' WHERE '.implode(' AND ', $where); } if ( empty($sel_field) ) $sel_field = "a.od_id"; if ( empty($sort1) ) $sort1 = "a.od_id"; if ( empty($sort2) ) $sort2 = "desc"; // 상품명, 단가, 수량, 카테고리를 불러오기 위해 DB를 합친다 $sql_common = " FROM {$g5['g5_shop_order_table']} AS a LEFT JOIN {$g5['g5_shop_cart_table']} AS b ON a.od_id = b.od_id LEFT JOIN {$g5['g5_shop_item_table']} AS c ON b.it_id = c.it_id LEFT JOIN {$g5['g5_shop_item_option_table']} AS d ON c.it_id = d.it_id AND b.io_id = d.io_id "; $sql_common .= $sql_search; $sql = " SELECT count(a.od_id) AS cnt " . $sql_common ; $row = sql_fetch($sql); $total_count = $row['cnt']; $rows = 100; if( !isset($rows) ) $rows = $config['cf_page_rows']; $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 // 상품명, 수량, 단가, 카테고리를 가져옴 $sql = " SELECT a.od_id, b.it_name, b.ct_qty, b.ct_price, b.ct_option, b.io_id, c.ca_id, c.it_1, c.it_2, d.io_price $sql_common ORDER BY $sort1 $sort2 LIMIT $from_record, $rows "; $result = sql_query($sql); $qstr1 = "od_status=".urlencode($od_status)."& od_settle_case=".urlencode($od_settle_case)."& od_misu=$od_misu& ;od_cancel_price=$od_cancel_price& od_refund_price=$od_refund_price& od_receipt_point=$od_receipt_point& od_coupon=$od_coupon& fr_date=$fr_date& to_date=$to_date& sel_field=$sel_field& search=$search& save_search=$search"; if($default['de_escrow_use']) $qstr1 .= "&od_escrow=$od_escrow"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; $listall = '전체목록'; ?>
주문일자 ~
$options): ?> $totals): ?>
상품명 옵션 단가 총 수량 총 금액