#179 에 따른 상품요약정보 상품등록폼에 통합

This commit is contained in:
chicpro
2013-05-15 13:37:55 +09:00
parent 7ac8856147
commit 6bb536dc38
7 changed files with 121 additions and 212 deletions

View File

@ -20,11 +20,19 @@ if(intval(preg_replace("/[^0-9]/", "", $row['Type'])) != 20) {
sql_query(" ALTER TABLE `{$g4['shop_wish_table']}` MODIFY COLUMN it_id VARCHAR(20) NOT NULL DEFAULT '' ", false);
}
// 상품요약정보 필드추가
$sql = " select it_info_gubun from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_info_gubun` VARCHAR(50) NOT NULL DEFAULT '' AFTER `it_tel_inq` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_info_value` TEXT NOT NULL AFTER `it_info_gubun` ", false);
}
// 상품이미지 필드추가
$sql = " select it_img1 from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img1` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_tel_inq` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img1` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_info_value` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img2` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img1` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img3` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img2` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}` ADD `it_img4` VARCHAR(255) NOT NULL DEFAULT '' AFTER `it_img3` ", false);
@ -152,6 +160,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$pg_anchor ='<ul class="anchor">
<li><a href="#anc_sitfrm_cate">상품분류</a></li>
<li><a href="#anc_sitfrm_ini">기본정보</a></li>
<li><a href="#anc_sitfrm_compact">요약정보</a></li>
<li><a href="#anc_sitfrm_cost">가격 및 재고</a></li>
<li><a href="#anc_sitfrm_img">상품이미지</a></li>
<li><a href="#anc_sitfrm_relation">관련상품</a></li>
@ -344,27 +353,6 @@ $pg_anchor ='<ul class="anchor">
<input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="90">
</td>
</tr>
<?php if ($it['it_id']) { ?>
<?php
$sql = " select distinct ii_gubun from {$g4['shop_item_info_table']} where it_id = '$it_id' group by ii_gubun ";
$ii = sql_fetch($sql, false);
if ($ii) {
$item_info_gubun = item_info_gubun($ii['ii_gubun']);
$item_info_gubun .= $item_info_gubun ? " 등록됨" : "";
} else {
// 상품상세정보 테이블이 없다고 가정하여 생성
create_table_item_info();
}
?>
<tr>
<th scope="row">요약상품정보</th>
<td>
<?php echo help("<strong>전자상거래 등에서의 상품 등의 정보제공에 관한 고시</strong>에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다."); ?>
<button type="button" class="btn_frmline" onclick="window.open('./iteminfo.php?it_id=<?php echo $it['it_id']; ?>', '_blank', 'width=670 height=800 scrollbars=yes');">상품요약정보 설정</button>
<span id="item_info_gubun"><?php echo $item_info_gubun; ?></span>
</td>
</tr>
<?php } //if?>
<tr>
<th scope="row">상품설명</th>
<td> <?php echo editor_html('it_explan', $it['it_explan']); ?></td>
@ -398,6 +386,27 @@ $pg_anchor ='<ul class="anchor">
</table>
</section>
<section id="anc_sitfrm_compact" class="cbox">
<h2>상품요약정보</h2>
<?php echo $pg_anchor; ?>
<div id="compact_info_form"><?php include_once(G4_ADMIN_PATH.'/shop_admin/iteminfo.php'); ?></div>
</section>
<script>
$(function(){
$("#it_info_gubun").live("change", function() {
var gubun = $(this).val();
$.post(
"<?php echo G4_ADMIN_URL; ?>/shop_admin/iteminfo.php",
{ it_id: "<?php echo $it['it_id']; ?>", gubun: gubun },
function(data) {
$("#compact_info_form").empty().html(data);
}
);
});
});
</script>
<section id="anc_sitfrm_cost" class="cbox">
<h2>가격 및 재고</h2>
<?php echo $pg_anchor; ?>