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

This commit is contained in:
whitedot
2013-02-05 15:43:19 +09:00
8 changed files with 80 additions and 37 deletions

View File

@ -0,0 +1,17 @@
<?php
include_once('./_common.php');
// 상품요약정보중 it_id 가 존재하지 않는 것을 삭제
$sql = " select distinct it_id
from {$g4['yc4_item_info_table']}
order by ii_id ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
$sql1 = "select it_id from {$g4['yc4_item_table']} where it_id = '{$row['it_id']}' ";
$row1 = sql_fetch($sql1);
if(!$row1['it_id']) {
@sql_query(" delete from {$g4['yc4_item_info_table']} where it_id = '{$row['it_id']}' ");
}
}

View File

@ -305,27 +305,27 @@ ul { margin: 0; padding: 0; list-style: none; }
<?=help("상품상세페이지의 상품설명 상단에 표시되는 설명입니다.\nHTML 입력도 가능합니다.", -150, -100);?>
</td>
</tr>
<? if ($it['it_id']) { ?>
<?
$sql = " select distinct ii_gubun from {$g4['yc4_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();
if ($it['it_id']) {
$sql = " select distinct ii_gubun from {$g4['yc4_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 class=ht>
<td>요약상품정보</td>
<td colspan=3>
<input type="button" onclick="window.open('./iteminfo.php?it_id=<?=$it['it_id']?>', '_blank', 'width=670 height=800');" value="상품요약정보 설정" />
<input type="button" id="item_info_set" value="상품요약정보 설정" />
<span id="item_info_gubun"><?=$item_info_gubun?></span>
<?=help("전자상거래 등에서의 상품 등의 정보제공에 관한 고시에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다.");?>
</td>
</tr>
<?}//if?>
<input type="hidden" id="it_explan_html" name="it_explan_html" value=1>
<tr>
<td>상품설명</td>
@ -408,7 +408,7 @@ if ($ii) {
<tr class=ht>
<td>이미지(대) <?=$i?></td>
<td colspan=3>
<input type="file" class=ed id="it_img" name="it_img"<?=$i?> size=40>
<input type="file" class=ed id="it_img" name="it_img<?=$i?>" size=40>
<?
$idx = 'it_img'.$i;
$img = G4_DATA_PATH."/item/$it_id/{$it[$idx]}";
@ -782,8 +782,8 @@ if ($ii) {
<script language='javascript'>
var f = document.fitemform;
<?php if($w == 'u') { ?>
$(document).ready(function() {
$(function() {
<?php if($w == 'u') { ?>
// 선택옵션등록 변경
$("input[name=it_option_use]").click(function() {
var val = $(this).val();
@ -805,8 +805,14 @@ $(document).ready(function() {
}
}
});
<?php } ?>
// 상품요약정보설정
$("#item_info_set").click(function() {
var it_id = $.trim($('input[name=it_id]').val());
window.open('./iteminfo.php?it_id='+it_id, '_blank', 'width=670 height=800');
});
});
<?php } ?>
function codedupcheck(id)
{

View File

@ -379,8 +379,19 @@ if ($w == "")
}
}
// 상품등록시 등록된 상품요약정보의 it_id가 변경됐을 경우 처리
if(get_session('ss_ii_item_code')) {
$ii_item_code = get_session('ss_ii_item_code');
if($it_id != $ii_item_code) {
$sql = " update {$g4['yc4_item_info_table']} set it_id = '$it_id' where it_id = '$ii_item_code' ";
sql_query($sql);
}
}
unset($_SESSION['ss_op_item_code']);
unset($_SESSION['ss_sp_item_code']);
unset($_SESSION['ss_ii_item_code']);
}
else if ($w == "u")
{
@ -455,6 +466,9 @@ if ($w == "" || $w == "u")
// 선택, 추가 옵션 테이블을 체크해 상품정보가 없는 것은 삭제
include_once('./item_option_check.php');
// 상품요약정보 테이블을 체크해 상품정보가 없는 것은 삭제
include_once('./item_info_check.php');
$qstr = "$qstr&sca=$sca&page=$page";
if ($w == "u") {

View File

@ -25,6 +25,9 @@ foreach ($_POST as $key=>$value) {
$item_info_gubun = item_info_gubun($gubun);
$item_info_gubun .= $item_info_gubun ? " 등록됨" : "";
// it_id 변경을 체크하기 위해 세션에 it_id 저장
set_session('ss_ii_item_code', $_POST['it_id']);
include_once(G4_PATH.'/head.sub.php');
?>
<script type="text/javascript">

View File

@ -41,10 +41,10 @@ for($i = 0; $i < $count; $i++) {
}
sql_query($sql);
}
if($w == '') {
set_session('ss_op_item_code', $it_id);
}
if($w == '') {
set_session('ss_op_item_code', $it_id);
}
echo '<script>self.close();</script>';

View File

@ -32,10 +32,10 @@ for($i = 0; $i < $count; $i++) {
}
sql_query($sql);
}
if($w == '') {
set_session('ss_sp_item_code', $it_id);
}
if($w == '') {
set_session('ss_sp_item_code', $it_id);
}
echo '<script>self.close();</script>';

View File

@ -6,12 +6,21 @@ $is_category = false;
$category_option = '';
if ($board['bo_use_category']) {
$is_category = true;
$category_location = './board.php?bo_table='.$bo_table.'&amp;sca=';
$category_href = G4_BBS_URL.'/board.php?bo_table='.$bo_table;
$category_option .= '<li><a href="'.$category_href.'"';
if ($sca=='')
$category_option .= ' id="bo_cate_on"';
$category_option .= '>전체</a></li>';
$categories = explode('|', $board['bo_category_list']); // 구분자가 , 로 되어 있음
for ($i=0; $i<count($categories); $i++) {
if (trim($categories[$i]))
$category_option .= '<li><a href="#">'.$categories[$i].'</a></li>';
$category = trim($categories[$i]);
if ($category=='') continue;
$category_option .= '<li><a href="'.($category_href."&amp;sca=".urlencode($category)).'"';
if ($category==$sca)
$category_option .= ' id="bo_cate_on"';
$category_option .= '>'.$category.'</a></li>';
}
}

View File

@ -16,7 +16,6 @@ if ($is_nogood) $colspan++;
<nav id="bo_cate">
<h2><?=$board['bo_subject']?> 카테고리</h2>
<ul id="bo_cate_ul">
<li><a href="<?=$g4['url']?>/bbs/board.php?bo_table=<?=$bo_table?>">전체</a></li>
<?=$category_option?>
</ul>
</nav>
@ -32,13 +31,13 @@ if ($is_nogood) $colspan++;
<input type="hidden" name="sca" value="<?=$sca?>">
<input type="hidden" name="sop" value="and">
<select name="sfl" title="검색대상">
<option value="wr_subject">제목</option>
<option value="wr_content">내용</option>
<option value="wr_subject||wr_content">제목+내용</option>
<option value="mb_id,1">회원아이디</option>
<option value="mb_id,0">회원아이디(코)</option>
<option value="wr_name,1">글쓴이</option>
<option value="wr_name,0">글쓴이(코)</option>
<option value="wr_subject" <?=get_selected($sfl, 'wr_subject', true);?>>제목</option>
<option value="wr_content" <?=get_selected($sfl, 'wr_content');?>>내용</option>
<option value="wr_subject||wr_content" <?=get_selected($sfl, 'wr_subject||wr_content');?>>제목+내용</option>
<option value="mb_id,1" <?=get_selected($sfl, 'mb_id,1');?>>회원아이디</option>
<option value="mb_id,0" <?=get_selected($sfl, 'mb_id,0');?>>회원아이디(코)</option>
<option value="wr_name,1" <?=get_selected($sfl, 'wr_name,1');?>>글쓴이</option>
<option value="wr_name,0" <?=get_selected($sfl, 'wr_name,0');?>>글쓴이(코)</option>
</select>
<input name="stx" class="fs_input required" maxlength="15" size="15" required value="<?=stripslashes($stx)?>" title="검색어(필수)">
<input type="submit" class="fs_submit" value="검색">
@ -165,11 +164,6 @@ if ($is_nogood) $colspan++;
<?=$page?> 페이지
</p>
<script>
<? if ($sca) { echo "document.fcategory.sca.value = \"$sca\";"; } ?>
<? if ($stx) { echo "document.fsearch.sfl.value = \"$sfl\";"; } ?>
</script>
<? if ($is_checkbox) { ?>
<script>
function all_checked(sw) {