$sub_menu = '400640'; 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 != "") { $sql_search .= " $where $sel_field like '%$search%' "; $where = " and "; } } if ($sel_ca_id != "") { $sql_search .= " $where ca_id like '$sel_ca_id%' "; } if ($sel_field == "") { $sel_field = "it_name"; } $sql_common = " from {$g4['shop_item_table']} a left join {$g4['shop_event_item_table']} b on (a.it_id=b.it_id and b.ev_id='$ev_id') "; $sql_common .= $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; // 시작 열을 구함 if (!$sort1) { $sort1 = "b.ev_id"; } if (!$sort2) { $sort2 = "desc"; } $sql = " select a.*, b.ev_id $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"; $qstr1 = "ev_id=$ev_id&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; ?>