Files
firstgarden-web-gnu/skin/shop/basic/item.info.skin.php

189 lines
6.3 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 관리자가 확인한 사용후기의 갯수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 갯수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
// 관련상품의 갯수를 얻음
$sql = " select count(*) as cnt from {$g5['g5_shop_item_relation_table']} a left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id and b.it_use='1') where a.it_id = '{$it['it_id']}' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
function pg_anchor($anc_id) {
global $default;
global $item_use_count, $item_qa_count, $item_relation_count;
?>
<ul class="sanchor">
<li><a href="#sit_inf" <?php if ($anc_id == 'inf') echo 'class="sanchor_on"'; ?>>상품정보</a></li>
<li><a href="#sit_use" <?php if ($anc_id == 'use') echo 'class="sanchor_on"'; ?>>사용후기 <span class="item_use_count"><?php echo $item_use_count; ?></span></a></li>
<li><a href="#sit_qa" <?php if ($anc_id == 'qa') echo 'class="sanchor_on"'; ?>>상품문의 <span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="#sit_dvr" <?php if ($anc_id == 'dvr') echo 'class="sanchor_on"'; ?>>배송정보</a></li><?php } ?>
<?php if ($default['de_change_content']) { ?><li><a href="#sit_ex" <?php if ($anc_id == 'ex') echo 'class="sanchor_on"'; ?>>교환정보</a></li><?php } ?>
<li><a href="#sit_rel" <?php if ($anc_id == 'rel') echo 'class="sanchor_on"'; ?>>관련상품 <span class="item_relation_count"><?php echo $item_relation_count; ?></span></a></li>
</ul>
<?php
}
?>
<link rel="stylesheet" href="<?php echo G5_SHOP_SKIN_URL; ?>/style.css">
<!-- 상품 정보 시작 { -->
<section id="sit_inf">
<h2>상품 정보</h2>
<?php echo pg_anchor('inf'); ?>
<h3>상품 기본설명</h3>
<?php if ($it['it_basic']) { // 상품 기본설명 ?>
<div id="sit_inf_basic">
<?php echo $it['it_basic']; ?>
</div>
<?php } ?>
<h3>상품 상세설명</h3>
<?php if ($it['it_explan']) { // 상품 상세설명 ?>
<div id="sit_inf_explan">
<?php echo conv_content($it['it_explan'], 1); ?>
</div>
<?php } ?>
<h3>상품 정보 고시</h3>
<?php
if ($it['it_info_value']) {
$info_data = unserialize($it['it_info_value']);
$gubun = $it['it_info_gubun'];
$info_array = $item_info[$gubun]['article'];
?>
<!-- 상품정보고시 -->
<table id="sit_inf_open">
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<?php
foreach($info_data as $key=>$val) {
$ii_title = $info_array[$key][0];
$ii_value = $val;
?>
<tr>
<th scope="row"><?php echo $ii_title; ?></th>
<td><?php echo $ii_value; ?></td>
</tr>
<?php } //foreach?>
</tbody>
</table>
<!-- 상품정보고시 end -->
<?php } //if?>
</section>
<!-- } 상품 정보 끝 -->
<!-- 사용후기 시작 { -->
<section id="sit_use">
<h2>사용후기</h2>
<?php echo pg_anchor('use'); ?>
<div id="itemuse"><?php include_once('./itemuse.php'); ?></div>
</section>
<!-- } 사용후기 끝 -->
<!-- 상품문의 시작 { -->
<section id="sit_qa">
<h2>상품문의</h2>
<?php echo pg_anchor('qa'); ?>
<div id="itemqa"><?php include_once('./itemqa.php'); ?></div>
</section>
<!-- } 상품문의 끝 -->
<?php if ($default['de_baesong_content']) { // 배송정보 내용이 있다면 ?>
<!-- 배송정보 시작 { -->
<section id="sit_dvr">
<h2>배송정보</h2>
<?php echo pg_anchor('dvr'); ?>
<?php echo conv_content($default['de_baesong_content'], 1); ?>
</section>
<!-- } 배송정보 끝 -->
<?php } ?>
<?php if ($default['de_change_content']) { // 교환/반품 내용이 있다면 ?>
<!-- 교환/반품 시작 { -->
<section id="sit_ex">
<h2>교환/반품</h2>
<?php echo pg_anchor('ex'); ?>
<?php echo conv_content($default['de_change_content'], 1); ?>
</section>
<!-- } 교환/반품 끝 -->
<?php } ?>
<!-- 관련상품 시작 { -->
<section id="sit_rel">
<h2>관련상품</h2>
<?php echo pg_anchor('rel'); ?>
<div class="sct_wrap">
<?php
$sql = " select b.* from {$g5['g5_shop_item_relation_table']} a left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id) where a.it_id = '{$it['it_id']}' and b.it_use='1' ";
$list = new item_list("item.relation.skin.php", $default['de_rel_list_mod'], 1, $default['de_rel_img_width'], $default['de_rel_img_height']);
$list->set_query($sql);
echo $list->run();
?>
</div>
</section>
<!-- } 관련상품 끝 -->
<!--[if lte IE 6]>
<script>
// 이미지 등비율 리사이징
$(window).load(function() {
view_image_resize();
});
function view_image_resize()
{
var $img = $("#sit_inf_explan img");
var img_wrap = $("#sit_inf_explan").width();
var win_width = $(window).width() - 35;
var res_width = 0;
if(img_wrap < win_width)
res_width = img_wrap;
else
res_width = win_width;
$img.each(function() {
var img_width = $(this).width();
var img_height = $(this).height();
var this_width = $(this).data("width");
var this_height = $(this).data("height");
if(this_width == undefined) {
$(this).data("width", img_width); // 원래 이미지 사이즈
$(this).data("height", img_height);
this_width = img_width;
this_height = img_height;
}
if(this_width > res_width) {
$(this).width(res_width);
var res_height = Math.round(res_width * $(this).data("height") / $(this).data("width"));
$(this).height(res_height);
} else {
$(this).width(this_width);
$(this).height(this_height);
}
});
}
</script>
<![endif]-->