$sub_menu = "400410"; include_once("./_common.php"); auth_check($auth[$sub_menu], "r"); $g4[title] = "주문개별관리"; include_once(G4_ADMIN_PATH."/admin.head.php"); $where = " where "; $sql_search = ""; if ($search != "") { if ($sel_field == "c.ca_id") { $sql_search .= " $where $sel_field like '$search%' "; $where = " and "; } else if ($sel_field != "") { $sql_search .= " $where $sel_field like '%$search%' "; $where = " and "; } if ($save_search != $search) $page = 1; } if ($sel_field == "") $sel_field = "od_id"; if ($sort1 == "") $sort1 = "od_id"; if ($sort2 == "") $sort2 = "desc"; $sql_common = " from $g4[yc4_order_table] a left join $g4[yc4_cart_table] b on (a.on_uid = b.on_uid) left join $g4[yc4_item_table] c on (b.it_id = c.it_id) $sql_search "; // 테이블의 전체 레코드수만 얻음 $sql = " select count(*) 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 a.od_id, a.mb_id, a.od_name, a.od_deposit_name, a.od_time, b.it_opt1, b.it_opt2, b.it_opt3, b.it_opt4, b.it_opt5, b.it_opt6, b.ct_status, b.ct_qty, b.ct_amount, b.ct_point, (b.ct_qty * b.ct_amount) as ct_sub_amount, (b.ct_qty * b.ct_point) as ct_sub_point, c.it_id, c.it_name, c.it_opt1_subject, c.it_opt2_subject, c.it_opt3_subject, c.it_opt4_subject, c.it_opt5_subject, c.it_opt6_subject $sql_common order by $sort1 $sort2 limit $from_record, $rows "; $result = sql_query($sql); $qstr1 = "sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&save_search=$search"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; ?>
include_once(G4_ADMIN_PATH."/admin.tail.php"); ?>