From 2e3e8d12eb7cedfced6555fc76dc1bd424a146df Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 21 May 2013 09:16:29 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=83=81=ED=92=88=EB=B3=B5=EC=82=AC?= =?UTF-8?q?=EC=8B=9C=20=EC=83=81=ED=92=88=EC=9A=94=EC=95=BD=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=B3=B5=EC=82=AC=20=EC=BD=94=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/item_copy_update.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/adm/shop_admin/item_copy_update.php b/adm/shop_admin/item_copy_update.php index 10e664782..802edf912 100644 --- a/adm/shop_admin/item_copy_update.php +++ b/adm/shop_admin/item_copy_update.php @@ -38,15 +38,6 @@ $sql = " insert {$g4['shop_item_table']} $sql_common "; sql_query($sql); -// 상품요약정보 복사 -$sql = " select * from {$g4['shop_item_info_table']} where it_id = '$it_id' order by ii_id "; -$result = sql_query($sql); -for ($i=0; $row=sql_fetch_array($result); $i++) { - $sql = " INSERT INTO `{$g4['shop_item_info_table']}` (`ii_id`, `it_id`, `ii_gubun`, `ii_article`, `ii_title`, `ii_value`) - VALUES (NULL, '$new_it_id', '{$row['ii_gubun']}', '{$row['ii_article']}', '".addslashes($row['ii_title'])."', '".addslashes($row['ii_value'])."') "; - sql_query($sql); -} - // html 에디터로 첨부된 이미지 파일 복사 if($cp['it_explan']) { $matchs = get_editor_image($cp['it_explan']); From f61d3bed4c9f8e4dd99e39521cf2198b88b4d6d7 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 21 May 2013 10:00:51 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#176=20=EC=83=81=ED=92=88=EC=98=B5=EC=85=98?= =?UTF-8?q?=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=9D=EC=84=B1=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/shop.extend.php | 32 ++++++++++++++++++++++++++++++++ install/install_db.php | 1 + install/shop.sql | 42 ++++++++++++++++++++++++------------------ 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/extend/shop.extend.php b/extend/shop.extend.php index 49aee9fa7..e1c63f599 100644 --- a/extend/shop.extend.php +++ b/extend/shop.extend.php @@ -62,6 +62,27 @@ if(!sql_query(" select uq_id from {$g4['uniqid_table']} limit 1 ", false)) { ) ", false); } +// 상품옵션 테이블 생성 +if(!sql_query(" select io_id from {$g4['shop_item_option_table']} limit 1 ", false)) { + sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['shop_item_option_table']}` ( + `io_no` INT(11) NOT NULL AUTO_INCREMENT, + `io_id` VARCHAR(255) NOT NULL DEFAULT '', + `io_type` TINYINT(4) NOT NULL DEFAULT '0', + `it_id` VARCHAR(20) NOT NULL DEFAULT '', + `io_price` INT(11) NOT NULL DEFAULT '0', + `io_stock_qty` INT(11) NOT NULL DEFAULT '0', + `io_noti_qty` INT(11) NOT NULL DEFAULT '0', + `io_use` TINYINT(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`io_no`), + KEY `io_id` (`io_id`), + KEY `it_id` (`it_id`) + ) ", false); + sql_query(" ALTER TABLE `{$g4['shop_item_table']}` + ADD `it_option_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_origin`, + ADD `it_option` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_option_subject`, + ADD `it_supply_subject` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_option` ", false); +} + // uq_id 필드추가 $sql = " select uq_id from {$g4['shop_cart_table']} limit 1 "; $result = sql_query($sql, false); @@ -96,6 +117,17 @@ if(!$result) { ADD `od_mobile` TINYINT(4) NOT NULL DEFAULT '0' AFTER `od_time` ", false); } +// it_brand 추가 +/* +$sql = " select it_brand from {$g4['shop_item_table']} limit 1 "; +$result = sql_query($sql, false); +if(!$result) { + sql_query(" ALTER TABLE `{$g4['shop_item_table']}` + ADD `it_brand` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_origin`, + ADD `it_model` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_brand` ", false); +} +*/ + //============================================================================== // 쇼핑몰 필수 실행코드 모음 끝 //============================================================================== diff --git a/install/install_db.php b/install/install_db.php index 6bdc6c663..419f1fa9d 100644 --- a/install/install_db.php +++ b/install/install_db.php @@ -478,6 +478,7 @@ if($shop_install) { fwrite($f, "\$g4['shop_faq_table'] = SHOP_TABLE_PREFIX.'faq'; // 자주하시는 질문 테이블\n"); fwrite($f, "\$g4['shop_faq_master_table'] = SHOP_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n"); fwrite($f, "\$g4['shop_item_table'] = SHOP_TABLE_PREFIX.'item'; // 상품 테이블\n"); + fwrite($f, "\$g4['shop_item_option_table'] = SHOP_TABLE_PREFIX.'item_option'; // 상품옵션 테이블\n"); fwrite($f, "\$g4['shop_item_ps_table'] = SHOP_TABLE_PREFIX.'item_ps'; // 상품 사용후기 테이블\n"); fwrite($f, "\$g4['shop_item_qa_table'] = SHOP_TABLE_PREFIX.'item_qa'; // 상품 질문답변 테이블\n"); fwrite($f, "\$g4['shop_item_relation_table'] = SHOP_TABLE_PREFIX.'item_relation'; // 관련 상품 테이블\n"); diff --git a/install/shop.sql b/install/shop.sql index cab6790b5..ea1347898 100644 --- a/install/shop.sql +++ b/install/shop.sql @@ -91,12 +91,6 @@ CREATE TABLE IF NOT EXISTS `shop_category` ( `ca_name` varchar(255) NOT NULL DEFAULT '', `ca_skin` varchar(255) NOT NULL DEFAULT '', `ca_mobile_skin` varchar(255) NOT NULL DEFAULT '', - `ca_opt1_subject` varchar(255) NOT NULL DEFAULT '', - `ca_opt2_subject` varchar(255) NOT NULL DEFAULT '', - `ca_opt3_subject` varchar(255) NOT NULL DEFAULT '', - `ca_opt4_subject` varchar(255) NOT NULL DEFAULT '', - `ca_opt5_subject` varchar(255) NOT NULL DEFAULT '', - `ca_opt6_subject` varchar(255) NOT NULL DEFAULT '', `ca_img_width` int(11) NOT NULL DEFAULT '0', `ca_img_height` int(11) NOT NULL DEFAULT '0', `ca_mobile_img_width` int(11) NOT NULL DEFAULT '0', @@ -372,18 +366,9 @@ CREATE TABLE IF NOT EXISTS `shop_item` ( `it_gallery` tinyint(4) NOT NULL DEFAULT '0', `it_maker` varchar(255) NOT NULL DEFAULT '', `it_origin` varchar(255) NOT NULL DEFAULT '', - `it_opt1_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt2_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt3_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt4_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt5_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt6_subject` varchar(255) NOT NULL DEFAULT '', - `it_opt1` text NOT NULL, - `it_opt2` text NOT NULL, - `it_opt3` text NOT NULL, - `it_opt4` text NOT NULL, - `it_opt5` text NOT NULL, - `it_opt6` text NOT NULL, + `it_option_subject` varchar(255) NOT NULL DEFAULT '', + `it_option` varchar(255) NOT NULL DEFAULT '', + `it_supply_subject` varchar(255) NOT NULL DEFAULT '', `it_type1` tinyint(4) NOT NULL DEFAULT '0', `it_type2` tinyint(4) NOT NULL DEFAULT '0', `it_type3` tinyint(4) NOT NULL DEFAULT '0', @@ -426,6 +411,27 @@ CREATE TABLE IF NOT EXISTS `shop_item` ( -- -------------------------------------------------------- +-- +-- Table structure for table `shop_item_option` +-- + +DROP TABLE IF EXISTS `shop_item_option`; +CREATE TABLE IF NOT EXISTS `shop_item_option` ( + `io_no` INT(11) NOT NULL AUTO_INCREMENT, + `io_id` VARCHAR(255) NOT NULL DEFAULT '0', + `io_type` TINYINT(4) NOT NULL DEFAULT '0', + `it_id` VARCHAR(20) NOT NULL DEFAULT '', + `io_price` INT(11) NOT NULL DEFAULT '0', + `io_stock_qty` INT(11) NOT NULL DEFAULT '0', + `io_noti_qty` INT(11) NOT NULL DEFAULT '0', + `io_use` TINYINT(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`io_no`), + KEY `io_id` (`io_id`), + KEY `it_id` (`it_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + -- -- Table structure for table `shop_item_ps` -- From ad52096dcdf13e7a09b86f71eec1216dc1393885 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 21 May 2013 10:17:52 +0900 Subject: [PATCH 3/3] =?UTF-8?q?#176=20=EA=B8=B0=EC=A1=B4=20=EC=83=81?= =?UTF-8?q?=ED=92=88=EC=98=B5=EC=85=98=20=EA=B4=80=EB=A0=A8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/shop_admin/categoryform.php | 42 ------------- adm/shop_admin/categoryformupdate.php | 6 -- adm/shop_admin/itemform.php | 6 -- adm/shop_admin/itemformupdate.php | 89 +-------------------------- 4 files changed, 3 insertions(+), 140 deletions(-) diff --git a/adm/shop_admin/categoryform.php b/adm/shop_admin/categoryform.php index dd2dc690c..26f8bab04 100644 --- a/adm/shop_admin/categoryform.php +++ b/adm/shop_admin/categoryform.php @@ -241,48 +241,6 @@ $pg_anchor .= ''; ' id="ca_mobile_list_row" required class="required frm_input" size="3"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/adm/shop_admin/categoryformupdate.php b/adm/shop_admin/categoryformupdate.php index a362104bc..98c61dc87 100644 --- a/adm/shop_admin/categoryformupdate.php +++ b/adm/shop_admin/categoryformupdate.php @@ -57,12 +57,6 @@ if ($ca_timg_del) @unlink("{$g4['category_path']}/{$ca_id}_t"); $sql_common = " ca_skin = '$ca_skin', ca_mobile_skin = '$ca_mobile_skin', - ca_opt1_subject = '$ca_opt1_subject', - ca_opt2_subject = '$ca_opt2_subject', - ca_opt3_subject = '$ca_opt3_subject', - ca_opt4_subject = '$ca_opt4_subject', - ca_opt5_subject = '$ca_opt5_subject', - ca_opt6_subject = '$ca_opt6_subject', ca_img_width = '$ca_img_width', ca_img_height = '$ca_img_height', ca_list_mod = '$ca_list_mod', diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index b64242442..03e101a02 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -147,12 +147,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++) $script .= "ca_stock_qty['{$row['ca_id']}'] = {$row['ca_stock_qty']};\n"; //$script .= "ca_explan_html['$row[ca_id]'] = $row[ca_explan_html];\n"; $script .= "ca_sell_email['{$row['ca_id']}'] = '{$row['ca_sell_email']}';\n"; - $script .= "ca_opt1_subject['{$row['ca_id']}'] = '{$row['ca_opt1_subject']}';\n"; - $script .= "ca_opt2_subject['{$row['ca_id']}'] = '{$row['ca_opt2_subject']}';\n"; - $script .= "ca_opt3_subject['{$row['ca_id']}'] = '{$row['ca_opt3_subject']}';\n"; - $script .= "ca_opt4_subject['{$row['ca_id']}'] = '{$row['ca_opt4_subject']}';\n"; - $script .= "ca_opt5_subject['{$row['ca_id']}'] = '{$row['ca_opt5_subject']}';\n"; - $script .= "ca_opt6_subject['{$row['ca_id']}'] = '{$row['ca_opt6_subject']}';\n"; } $pg_anchor ='
    diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php index d2f8613c8..ececa7307 100644 --- a/adm/shop_admin/itemformupdate.php +++ b/adm/shop_admin/itemformupdate.php @@ -20,32 +20,6 @@ function itemdelete($it_id) from {$g4['shop_item_table']} where it_id = '$it_id' "; $it = sql_fetch($sql); - /* - $str = $comma = $od_id = ""; - $sql = " select b.od_id - from {$g4['shop_cart_table']} a, - {$g4['shop_order_table']} b - where a.uq_id = b.uq_id - and a.it_id = '$it_id' - and a.ct_status != '쇼핑' "; - $result = sql_query($sql); - $i=0; - while ($row = sql_fetch_array($result)) - { - if (!$od_id) - $od_id = $row['od_id']; - - $i++; - if ($i % 10 == 0) $str .= "\\n"; - $str .= "$comma{$row['od_id']}"; - $comma = " , "; - } - if ($str) - { - alert("이 상품과 관련된 주문이 총 {$i} 건 존재하므로 주문서를 삭제한 후 상품을 삭제하여 주십시오.\\n\\n$str", "./orderstatuslist.php?sort1=od_id&sel_field=od_id&search=$od_id"); - } - */ - // 상품 이미지 삭제 for($i=1; $i<=10; $i++) { $file = G4_DATA_PATH.'/item/'.$it['it_img'.$i]; @@ -121,54 +95,6 @@ function itemdelete($it_id) } -//------------------------------------------------------------------------------ -// 금액 오류 검사 -$line1 = true; -$cnt = 0; -if ($w == "" || $w == "u") -{ - for ($i=1; $i<=6; $i++) - { - $it_opt = $_POST["it_opt{$i}"]; - unset($opt); - $opt = explode("\n", $it_opt); - for ($k=0; $k 0) - { - if (!preg_match("/^([+|-])/", $exp[1])) { - $cnt++; - break; - } - } - } - } -} - -if (!$line1) { - alert("옵션의 첫라인에는 금액을 입력할 수 없습니다."); -} - -if ($cnt > 0) { - alert("옵션의 금액 입력 오류입니다.\\n\\n추가되는 금액은 + 부호를\\n\\n할인되는 금액은 - 부호를 붙여 주십시오."); -} -//------------------------------------------------------------------------------ - @mkdir(G4_DATA_PATH."/item", 0707); @chmod(G4_DATA_PATH."/item", 0707); @@ -379,18 +305,9 @@ $sql_common = " ca_id = '$ca_id', it_gallery = '$it_gallery', it_maker = '$it_maker', it_origin = '$it_origin', - it_opt1_subject = '$it_opt1_subject', - it_opt2_subject = '$it_opt2_subject', - it_opt3_subject = '$it_opt3_subject', - it_opt4_subject = '$it_opt4_subject', - it_opt5_subject = '$it_opt5_subject', - it_opt6_subject = '$it_opt6_subject', - it_opt1 = '$it_opt1', - it_opt2 = '$it_opt2', - it_opt3 = '$it_opt3', - it_opt4 = '$it_opt4', - it_opt5 = '$it_opt5', - it_opt6 = '$it_opt6', + it_option_subject = '$it_option_subject', + it_option = '$it_option', + it_supply_subject = '$it_supply_subject', it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3',