0 "; break; default: $where[] = " od_status = '$od_status' "; break; } switch ($od_status) { case '주문' : $sort1 = "od_id"; $sort2 = "desc"; break; case '입금' : // 결제완료 $sort1 = "od_receipt_time"; $sort2 = "desc"; break; case '배송' : // 배송중 $sort1 = "od_invoice_time"; $sort2 = "desc"; break; } } if ($od_settle_case) { $where[] = " od_settle_case = '$od_settle_case' "; } if ($od_misu) { $where[] = " od_misu != 0 "; } if ($od_cancel_price) { $where[] = " od_cancel_price != 0 "; } if ($od_refund_price) { $where[] = " od_refund_price != 0 "; } if ($od_receipt_point) { $where[] = " od_receipt_point != 0 "; } if ($od_coupon) { $where[] = " od_coupon != 0 "; } if ($od_escrow) { $where[] = " od_escrow = 1 "; } if ($fr_date && $to_date) { $where[] = " od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' "; } if ($where) { $sql_search = ' where '.implode(' and ', $where); } if ($sel_field == "") $sel_field = "od_id"; if ($sort1 == "") $sort1 = "od_id"; if ($sort2 == "") $sort2 = "desc"; $sql_common = " from {$g5['g5_shop_order_table']} $sql_search "; $sql = " select count(od_id) as cnt " . $sql_common; $row = sql_fetch($sql); $total_count = $row['cnt']; $rows = $config['cf_page_rows']; $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 $sql = " select *, (od_cart_coupon + od_coupon + od_send_coupon) as couponprice $sql_common order by $sort1 $sort2 limit $from_record, $rows "; $result = sql_query($sql); $qstr1 = "sel_field=$sel_field&search=$search&save_search=$search"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; $listall = '전체목록'; ?>