Merge branch 'master' of github.com:gnuboard/yc4s

This commit is contained in:
whitedot
2013-05-21 15:37:38 +09:00
8 changed files with 60 additions and 167 deletions

View File

@ -241,48 +241,6 @@ $pg_anchor .= '</ul>';
<input type="text" name="ca_mobile_list_row" value='<?php echo $ca['ca_mobile_list_row']; ?>' id="ca_mobile_list_row" required class="required frm_input" size="3">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt1_subject">옵션 제목 1</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목1 로 기본입력됩니다."); ?>
<input type="text" name="ca_opt1_subject" value="<?php echo $ca['ca_opt1_subject']; ?>" id="ca_opt1_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt2_subject">옵션 제목 2</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목2 로 기본입력됩니다."); ?>
<input type="text" name="ca_opt2_subject" value="<?php echo $ca['ca_opt2_subject']; ?>" id="ca_opt2_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt3_subject">옵션 제목 3</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목3 으로 기본입력됩니다."); ?>
<input type="text" name="ca_opt3_subject" value="<?php echo $ca['ca_opt3_subject']; ?>" id="ca_opt3_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt4_subject">옵션 제목 4</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목4 로 기본입력됩니다."); ?>
<input type="text" name="ca_opt4_subject" value="<?php echo $ca['ca_opt4_subject']; ?>" id="ca_opt4_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt5_subject">옵션 제목 5</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목5 로 기본입력됩니다."); ?>
<input type="text" name="ca_opt5_subject" value="<?php echo $ca['ca_opt5_subject']; ?>" id="ca_opt5_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_opt6_subject">옵션 제목 6</label></th>
<td>
<?php echo help("제조사, 원산지 이외 옵션을 사용하실 수 있습니다.\n이곳에 입력한 옵션 제목은 상품입력 시 옵션 제목6 으로 기본입력됩니다."); ?>
<input type="text" name="ca_opt6_subject" value="<?php echo $ca['ca_opt6_subject']; ?>" id="ca_opt6_subject" class="frm_input">
</td>
</tr>
<tr>
<th scope="row"><label for="ca_stock_qty">재고수량</label></th>
<td>

View File

@ -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',

View File

@ -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']);

View File

@ -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 ='<ul class="anchor">

View File

@ -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&amp;sel_field=od_id&amp;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<count($opt); $k++)
{
// 첫라인에는 금액옵션을 줄 수 없음
if ($k == 0)
{
// 첫라인에 '셑'과 같은 문자를 입력할 수 없음
// if (preg_match("/;/", $opt[$k])) {
if (!preg_match("/&/", $opt[$k]) && preg_match("/;/", $opt[$k]))
{
$line1 = false;
break;
}
}
// 옵션금액에 + 또는 - 부호가 없다면 오류
unset($exp);
$exp = explode(";", $opt[$k]);
if ($exp[1] > 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',

View File

@ -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);
}
*/
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================

View File

@ -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");

View File

@ -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`
--