diff --git a/adm/shop_admin/couponform.php b/adm/shop_admin/couponform.php
index 5cc3d5e57..619313116 100644
--- a/adm/shop_admin/couponform.php
+++ b/adm/shop_admin/couponform.php
@@ -175,7 +175,7 @@ $(function() {
$("#sch_target").click(function() {
var cp_method = $("#cp_method").val();
- var opt = "left=50,top=50,width=500,height=400";
+ var opt = "left=50,top=50,width=500,height=600";
var url = "./coupontarget.php?sch_target=";
if(cp_method == "0") {
@@ -193,7 +193,7 @@ $(function() {
return false;
}
- var opt = "left=50,top=50,width=500,height=400";
+ var opt = "left=50,top=50,width=500,height=600";
var url = "./couponmember.php";
window.open(url, "win_member", opt);
});
diff --git a/adm/shop_admin/couponmember.php b/adm/shop_admin/couponmember.php
index 18abda1e9..da867f458 100644
--- a/adm/shop_admin/couponmember.php
+++ b/adm/shop_admin/couponmember.php
@@ -9,10 +9,30 @@ $html_title = '회원검색';
$g4['title'] = $html_title;
include_once(G4_PATH.'/head.sub.php');
-if($_GET['mb_name']) {
- $sql = " select mb_id, mb_name from {$g4['member_table']} where mb_leave_date = '' and mb_intercept_date ='' and mb_name like '%$mb_name%' ";
- $result = sql_query($sql);
-}
+$sql_common = " from {$g4['member_table']} ";
+$sql_where = " where mb_leave_date = '' and mb_intercept_date ='' ";
+
+if($_GET['mb_name'])
+ $sql_where .= " and mb_name like '%$mb_name%' ";
+
+// 테이블의 전체 레코드수만 얻음
+$sql = " select count(*) as cnt " . $sql_common . $sql_where;
+$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 mb_id, mb_name
+ $sql_common
+ $sql_where
+ order by mb_id
+ limit $from_record, $rows ";
+$result = sql_query($sql);
+
+$qstr1 = 'mb_name='.$_GET['mb_name'];
?>
@@ -21,10 +41,9 @@ if($_GET['mb_name']) {
diff --git a/adm/shop_admin/coupontarget.php b/adm/shop_admin/coupontarget.php
index 1aa22e2be..9d5bf0847 100644
--- a/adm/shop_admin/coupontarget.php
+++ b/adm/shop_admin/coupontarget.php
@@ -5,34 +5,59 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], "w");
if($_GET['sch_target'] == 1) {
- $html_title = '분류검색';
+ $html_title = '분류';
$t_name = '분류명';
$t_id = '분류코드';
+ $t_desc1 = '분류를';
+ $t_desc2 = '분류가';
} else {
- $html_title = '상품검색';
+ $html_title = '상품';
$t_name = '상품명';
$t_id = '상품코드';
+ $t_desc1 = '상품을';
+ $t_desc2 = '상품이';
}
-$g4['title'] = $html_title;
+$g4['title'] = $html_title.'검색';
include_once(G4_PATH.'/head.sub.php');
-if($_GET['sch_word']) {
- if($_GET['sch_target'] == 1) {
- $sql = " select ca_id as t_id, ca_name as t_name from {$g4['shop_category_table']} where ca_use = '1' and ca_name like '%$sch_word%' ";
- } else {
- $sql = " select it_id as t_id, it_name as t_name from {$g4['shop_item_table']} where it_use = '1' and it_name like '%$sch_word%' ";
- }
-
- $result = sql_query($sql);
+if($_GET['sch_target'] == 1) {
+ $sql_common = " from {$g4['shop_category_table']} ";
+ $sql_where = " where ca_use = '1' ";
+ if($_GET['sch_word'])
+ $sql_where .= " and ca_name like '%$sch_word%' ";
+ $sql_select = " select ca_id as t_id, ca_name as t_name ";
+ $sql_order = " order by ca_came ";
+} else {
+ $sql_common = " from {$g4['shop_item_table']} ";
+ $sql_where = " where it_use = '1' ";
+ if($GET['sch_word'])
+ $sql_where .= " and it_name like '%$sch_word%' ";
+ $sql_select = " select it_id as t_id, it_name as t_name ";
+ $sql_order = " order by it_name ";
}
+
+// 테이블의 전체 레코드수만 얻음
+$sql = " select count(*) as cnt " . $sql_common . $sql_where;
+$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 = $sql_select . $sql_common . $sql_where . $sql_order . " limit $from_record, $rows ";
+$result = sql_query($sql);
+
+$qstr1 = 'sch_target='.$_GET['sch_target'].'&sch_word='.$_GET['sch_word'];
?>
-
쿠폰 적용 상품선택
+
쿠폰 적용 선택
- 쿠폰을 적용할 상품을 선택하세요. 상품이 많을 경우에는 검색 기능을 이용하세요.
+ 쿠폰을 적용할 선택하세요. 많을 경우에는 검색 기능을 이용하세요.