From 368ccff03e1e526671a0290bd32927b64461c57e Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 3 Mar 2014 13:28:58 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B6=84=EB=A5=98=20=EB=B0=8F=20=EC=83=81?= =?UTF-8?q?=ED=92=88=EA=B4=80=EB=A6=AC=EC=97=90=20=EC=BF=A0=ED=8F=B0?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EC=95=88=ED=95=A8=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/categoryform.php | 14 ++++++++++++++ adm/shop_admin/categoryformupdate.php | 1 + adm/shop_admin/couponformupdate.php | 8 ++++---- adm/shop_admin/coupontarget.php | 4 ++-- adm/shop_admin/itemform.php | 19 +++++++++++++++++++ adm/shop_admin/itemformupdate.php | 3 +++ install/gnuboard5shop.sql | 2 ++ 7 files changed, 45 insertions(+), 6 deletions(-) diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php index 29497a2bd..c3495b699 100644 --- a/adm/shop_admin/categoryform.php +++ b/adm/shop_admin/categoryform.php @@ -91,6 +91,12 @@ $frm_submit = '
목록
'; + +// 쿠폰 적용 불가 설정 필드 추가 +if(!sql_query(" select ca_nocoupon from {$g5['g5_shop_category_table']} limit 1 ", false)) { + sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}` + ADD `ca_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `ca_adult_use` ", true); +} ?>
@@ -252,6 +258,14 @@ $frm_submit = '
예 + + + + + value="1" id="ca_nocoupon"> + 예 + +
diff --git a/adm/shop_admin/categoryformupdate.php b/adm/shop_admin/categoryformupdate.php index 338ea0a5b..2d9d6c310 100644 --- a/adm/shop_admin/categoryformupdate.php +++ b/adm/shop_admin/categoryformupdate.php @@ -62,6 +62,7 @@ $sql_common = " ca_skin = '$ca_skin', ca_mb_id = '$ca_mb_id', ca_cert_use = '$ca_cert_use', ca_adult_use = '$ca_adult_use', + ca_nocoupon = '$ca_nocoupon', ca_1_subj = '$ca_1_subj', ca_2_subj = '$ca_2_subj', ca_3_subj = '$ca_3_subj', diff --git a/adm/shop_admin/couponformupdate.php b/adm/shop_admin/couponformupdate.php index 5512ff1dd..83d4cfa45 100644 --- a/adm/shop_admin/couponformupdate.php +++ b/adm/shop_admin/couponformupdate.php @@ -38,15 +38,15 @@ if($_POST['cp_type'] && ($_POST['cp_price'] < 1 || $_POST['cp_price'] > 99)) alert('할인비율을은 1과 99사이 값으로 입력해 주십시오.'); if($_POST['cp_method'] == 0) { - $sql = " select count(*) as cnt from {$g5['g5_shop_item_table']} where it_id = '$cp_target' "; + $sql = " select count(*) as cnt from {$g5['g5_shop_item_table']} where it_id = '$cp_target' and it_nocoupon = '0' "; $row = sql_fetch($sql); if(!$row['cnt']) - alert('입력하신 상품코드는 존재하지 않는 상품코드입니다.'); + alert('입력하신 상품코드는 존재하지 않는 코드이거나 쿠폰적용안함으로 설정된 상품입니다.'); } else if($_POST['cp_method'] == 1) { - $sql = " select count(*) as cnt from {$g5['g5_shop_category_table']} where ca_id = '$cp_target' "; + $sql = " select count(*) as cnt from {$g5['g5_shop_category_table']} where ca_id = '$cp_target' and ca_nocoupon = '0' "; $row = sql_fetch($sql); if(!$row['cnt']) - alert('입력하신 분류코드는 존재하지 않는 분류코드입니다.'); + alert('입력하신 분류코드는 존재하지 않는 분류코드이거나 쿠폰적용안함으로 설정된 분류입니다.'); } if($w == '') { diff --git a/adm/shop_admin/coupontarget.php b/adm/shop_admin/coupontarget.php index df3f9b706..9df513c42 100644 --- a/adm/shop_admin/coupontarget.php +++ b/adm/shop_admin/coupontarget.php @@ -23,14 +23,14 @@ include_once(G5_PATH.'/head.sub.php'); if($_GET['sch_target'] == 1) { $sql_common = " from {$g5['g5_shop_category_table']} "; - $sql_where = " where ca_use = '1' "; + $sql_where = " where ca_use = '1' and ca_nocoupon = '0' "; 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_name "; } else { $sql_common = " from {$g5['g5_shop_item_table']} "; - $sql_where = " where it_use = '1' "; + $sql_where = " where it_use = '1' and it_nocoupon = '0' "; 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 "; diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index 281c855f2..3b8c90935 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -114,6 +114,12 @@ $frm_submit = '
if($it_id) $frm_submit .= PHP_EOL.'상품보기'; $frm_submit .= '
'; + +// 쿠폰적용안함 설정 필드 추가 +if(!sql_query(" select it_nocoupon from {$g5['g5_shop_item_table']} limit 1", false)) { + sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}` + ADD `it_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_use` ", true); +} ?> @@ -354,6 +360,19 @@ $frm_submit .= ''; + + + + + > 예 + + + + + + + + 상품설명 diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php index cd25214af..e28f95ae2 100644 --- a/adm/shop_admin/itemformupdate.php +++ b/adm/shop_admin/itemformupdate.php @@ -290,6 +290,7 @@ $sql_common = " ca_id = '$ca_id', it_notax = '$it_notax', it_sell_email = '$it_sell_email', it_use = '$it_use', + it_nocoupon = '$it_nocoupon', it_soldout = '$it_soldout', it_stock_qty = '$it_stock_qty', it_stock_sms = '$it_stock_sms', @@ -464,6 +465,7 @@ if(is_checked('chk_ca_it_notax')) $ca_fields .= " , it_notax = '$i if(is_checked('chk_ca_it_sell_email')) $ca_fields .= " , it_sell_email = '$it_sell_email' "; if(is_checked('chk_ca_it_tel_inq')) $ca_fields .= " , it_tel_inq = '$it_tel_inq' "; if(is_checked('chk_ca_it_use')) $ca_fields .= " , it_use = '$it_use' "; +if(is_checked('chk_ca_it_nocoupon')) $ca_fields .= " , it_nocoupon = '$it_nocoupon' "; if(is_checked('chk_ca_it_soldout')) $ca_fields .= " , it_soldout = '$it_soldout' "; if(is_checked('chk_ca_it_info')) $ca_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' "; if(is_checked('chk_ca_it_price')) $ca_fields .= " , it_price = '$it_price' "; @@ -510,6 +512,7 @@ if(is_checked('chk_all_it_notax')) $all_fields .= " , it_notax = ' if(is_checked('chk_all_it_sell_email')) $all_fields .= " , it_sell_email = '$it_sell_email' "; if(is_checked('chk_all_it_tel_inq')) $all_fields .= " , it_tel_inq = '$it_tel_inq' "; if(is_checked('chk_all_it_use')) $all_fields .= " , it_use = '$it_use' "; +if(is_checked('chk_all_it_nocoupon')) $all_fields .= " , it_nocoupon = '$it_nocoupon' "; if(is_checked('chk_all_it_soldout')) $all_fields .= " , it_soldout = '$it_soldout' "; if(is_checked('chk_all_it_info')) $all_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' "; if(is_checked('chk_all_it_price')) $all_fields .= " , it_price = '$it_price' "; diff --git a/install/gnuboard5shop.sql b/install/gnuboard5shop.sql index 8a74be270..3369c9f1d 100644 --- a/install/gnuboard5shop.sql +++ b/install/gnuboard5shop.sql @@ -87,6 +87,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_category` ( `ca_mb_id` varchar(255) NOT NULL DEFAULT '', `ca_cert_use` tinyint(4) NOT NULL DEFAULT '0', `ca_adult_use` tinyint(4) NOT NULL DEFAULT '0', + `ca_nocoupon` tinyint(4) NOT NULL DEFAULT '0', `ca_1_subj` varchar(255) NOT NULL DEFAULT '', `ca_2_subj` varchar(255) NOT NULL DEFAULT '', `ca_3_subj` varchar(255) NOT NULL DEFAULT '', @@ -383,6 +384,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item` ( `it_notax` tinyint(4) NOT NULL DEFAULT '0', `it_sell_email` varchar(255) NOT NULL DEFAULT '', `it_use` tinyint(4) NOT NULL DEFAULT '0', + `it_nocoupon` tinyint(4) NOT NULL DEFAULT '0', `it_soldout` tinyint(4) NOT NULL DEFAULT '0', `it_stock_qty` int(11) NOT NULL DEFAULT '0', `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0',