$sub_menu = '500130'; include_once('./_common.php'); auth_check($auth[$sub_menu], "r"); $g4['title'] = '전자결제내역'; include_once (G4_ADMIN_PATH.'/admin.head.php'); sql_query(" ALTER TABLE `{$g4['shop_card_history_table']}` ADD INDEX `od_id` ( `od_id` ) ", false); $where = " where "; $sql_search = ""; if ($search != "") { if ($sel_field != "") { $sql_search .= " $where $sel_field like '%$search%' "; $where = " and "; } } if ($sel_field == "") $sel_field = "a.od_id"; if ($sort1 == "") $sort1 = "od_id"; if ($sort2 == "") $sort2 = "desc"; $sql_common = " from {$g4['shop_card_history_table']} a left join {$g4['shop_order_table']} b on (a.od_id = b.od_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.*, concat(a.cd_trade_ymd, ' ', a.cd_trade_hms) as cd_app_time $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"; $qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page"; ?>
include_once (G4_ADMIN_PATH.'/admin.tail.php'); ?>