primeidc/backoffice/module/shop/good_info.php
2021-10-26 18:26:49 +09:00

819 lines
31 KiB
PHP

<?
include $_SERVER[DOCUMENT_ROOT] . "/backoffice/header.php";
include $_SERVER[DOCUMENT_ROOT] . "/module/category/category.lib.php";
include $_SERVER[DOCUMENT_ROOT] . "/module/shop/shop.lib.php";
if(!in_array("shop_good_manage",$_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["AUTH"]) && $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["GRADE"]!="ROOT"):
jsMsg("권한이 없습니다.");
jsHistory("-1");
endif;
//DB연결
$dblink = SetConn($_conf_db["main_db"]);
$arrAllCategory = getCategoryAll();
//상품분류 리스트
$arrCategory = getCategoryList(0);//1차카테고리
//상품정보
$arrInfo = getGoodInfo(mysql_real_escape_string($_REQUEST[idx]));
//print_r2($arrInfo);
//카테고리 정보
$arrCatCode = explode("/", $arrInfo["list"][0]["cat_code"]);
$arrExtCat = getGoodExtCat(mysql_real_escape_string($_REQUEST[idx]));
$catrs = mysql_query("select * from tbl_category order by cat_code");
?>
<div id="admin-container">
<? include "menu_good.php"; ?>
<div id="admin-content">
<h2 class="admin-title">상품 수정</h2>
<script language="javascript">
//카테고리 이름 자바스크립트 변수 생성
var arrayAllCategory = new Array();
<?
foreach ($arrAllCategory AS $key => $val){
?>
arrayAllCategory[<?=$key?>] = "<?=$val?>";
<?
}
?>
</script>
<form name="frmInfo" method="post" action="good_evn.php" ENCTYPE="multipart/form-data" onSubmit="return goodCheckForm(this)">
<input type="hidden" name="evnMode" value="edit">
<input type="hidden" name="idx" value="<?=$arrInfo["list"][0][idx]?>">
<input type="hidden" name="rt_url" value="<?=$_REQUEST[listURL]?>">
<!-- 기본정보 -->
<h3 class="admin-title-middle">기본정보</h3>
<table class="admin-table-type1">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<th>상품코드</th>
<td class="space-left"><input type="text" name="g_code" style="width:200" maxlength="30" value="<?=stripslashes($arrInfo["list"][0][g_code])?>" class="input" /></td>
</tr>
<tr>
<th>상품분류</th>
<td class="space-left">
<input type="hidden" name="cat_no" id="cat_no" value="<?php echo $arrInfo['list'][0]['cat_no']; ?>">
<select name="cat" id="cat" class="first-depth" depth="1">
<option value="">==========1차분류==========</option>
<?for($i=0;$i<$arrCategory["total"];$i++){?>
<option value="<?=$arrCategory["list"][$i][cat_no]?>"<?=$arrCatCode[0]==$arrCategory["list"][$i][cat_no]?" selected":""?>><?=$arrCategory["list"][$i][cat_name]?></option>
<?}?>
</select>
<?php
//DB연결
$dblink = SetConn($_conf_db["main_db"]);
for($i=2;$i<$_SITE["PRODUCT"]["CATEGORY_DEPTH"]+1;$i++){ //카테고리 $_SITE["PRODUCT"]["CATEGORY_DEPTH"]차까지 만듬 => 1차 초기화는 따로위에서 함
$_dep = $i-2;
?>
<select name="cat<?=$i?>" id="cat<?=$i?>" class="subcategory depth<?=$i?>" depth="<?=$i?>">
<option value="">==========<?=$i?>차분류==========</option>
<?php
if (strlen($arrCatCode[$_dep])) {
$subCa = getCategoryList($arrCatCode[$_dep]);
for ($j=0; $j<$subCa['total']; $j++) {
?>
<option value="<?php echo $subCa['list'][$j]['cat_no']; ?>" <?=$arrCatCode[$_dep+1]==$subCa['list'][$j]['cat_no']?" selected='selected'":""?>><?php echo $subCa['list'][$j]['cat_name']; ?></option>
<?php
}
}
?>
</select>
<?
}
?>
</td>
</tr>
<!-- <tr>
<th>추가분류</th>
<td class="space-left">
<select name="addcaList">
<option value="">선택</option>
<?php
for ($i=0; $row = mysql_fetch_assoc($catrs); $i++) {
unset($space);
for ($j=0; $j<$row['cat_depth']; $j++) {
$space .= "&nbsp;&nbsp;&nbsp;";
}
?>
<option value="<?php echo $row['cat_no']; ?>"><?php echo $space.$row['cat_name']; ?></option>
<?php
}
?>
</select>
<button value="추가" type="button" class="addcat">추가</button>
<button value="삭제" type="button" class="delcat">삭제</button>
<select multiple="multiple" name="rel_category[]" style="width:30%;height:150px;">
<?php
if ($arrExtCat['total'] > "0") {
for ($i=0; $i<$arrExtCat['total']; $i++) {
$arrExtCatCode = explode("/", $arrExtCat["list"][$i]["cat_code"]);
$strExtCat = "";
for($j=0;$j<count($arrExtCatCode)-1;$j++){
$strExtCat .= $arrAllCategory[$arrExtCatCode[$j]];
if($j != count($arrExtCatCode)-2){
$strExtCat .= " > ";
}
}
echo "<option value=\"".$arrExtCat['list'][$i]['cat_no']."\">".$strExtCat."</option>";
}
}
?>
</select>
</td>
</tr>
<tr>
<th>관련상품</th>
<td class="space-left">
<select name="caList">
<option value="">선택</option>
<?php
$catrs = mysql_query("select * from tbl_category order by cat_code");
for ($i=0; $row = mysql_fetch_assoc($catrs); $i++) {
unset($space);
for ($j=0; $j<$row['cat_depth']; $j++) {
$space .= "&nbsp;&nbsp;&nbsp;";
}
?>
<option value="<?php echo $row['cat_no']; ?>"><?php echo $space.$row['cat_name']; ?></option>
<?php
}
?>
</select>
<select multiple="multiple" name="pickList" style="width:30%;height:150px;"></select>
<button value="추가" type="button" class="addrel">추가</button>
<button value="삭제" type="button" class="delrel">삭제</button>
<select multiple="multiple" name="rel_product[]" style="width:30%;height:150px;">
<?php
if (strlen(str_replace(",","",$arrInfo['list'][0]['rel_g_idx']))) {
$rel_idx = explode(",",$arrInfo['list'][0]['rel_g_idx']);
for ($i=0; $i<count($rel_idx); $i++) {
$rel_info = getGoodInfo($rel_idx[$i]);
echo "<option value=\"".$rel_info['list'][0]['idx']."\">".$rel_info['list'][0]['g_name']."</option>";
}
}
?>
</select>
</td>
</tr> -->
<tr>
<th>상품명</th>
<td class="space-left"><input type="text" name="g_name" style="width:90%" class="input" maxlength="200" value="<?=stripslashes($arrInfo["list"][0][g_name])?>" /></td>
</tr>
<!-- <tr>
<th>간략설명</th>
<td class="space-left"><textarea name="memo" class="textarea" style="width:90%;height:60px"><?=stripslashes($arrInfo["list"][0]["memo"])?></textarea></td>
</tr> -->
<tr>
<th>정렬순서</th>
<td class="space-left"><input type="text" name="sort_num" size="4" maxlength="8" value="<?=$arrInfo["list"][0][sort_num]?>" class="input" /> (숫자가 높을수록 위쪽에 표시됨)</td>
</tr>
<tr style="display:none">
<th>개별결제자 아이디</th>
<td class="space-left"><input type="text" name="author_name" size="20" value="<?=$arrInfo["list"][0][author_name]?>" maxlength="30" class="input" /> 개별결제 사용시만 결제자 아이디 작성해 주시면 됩니다.</td>
</tr>
<!-- <tr>
<th>아이콘</th>
<td class="space-left">
<ul style="display:inline-block;width:90%;padding-top:10px;">
<?
$arrIcons = explode("|",$arrInfo["list"][0][icons]);
if ($handle = opendir($_SERVER[DOCUMENT_ROOT] . "/uploaded/shop_icons/")) {
$cc=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
?>
<li style="float:left;width:160px;height:40px;"><input type="checkbox" name="shop_icon[]" value="<?=$file?>"<?=in_array($file,$arrIcons)?" checked":""?>><img src="/uploaded/shop_icons/<?=$file?>"></li>
<?
//if($cc%8 == 7) echo "<br />";
//$cc++;
}
}
closedir($handle);
}
?>
</ul>
<div style="color:#d33131;clar:both;">(FTP를 이용하여 /www/uploaded/shop_icons 폴더에 아이콘을 업로드 시키면 나타납니다.)</div>
</td>
</tr> -->
</tbody>
</table>
<br />
<!-- 상품 추가정보 -->
<h3 class="admin-title-middle">상품 추가정보</h3>
<table class="admin-table-type1">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<th>브랜드</th>
<td class="space-left"><input type="text" name="brand" style="width:200" maxlength="50" value="<?=stripslashes($arrInfo["list"][0][brand])?>" class="input" /></td>
</tr>
<tr>
<th>판매자</th>
<td class="space-left"><input type="text" name="vendor" style="width:200" maxlength="50" value="<?=stripslashes($arrInfo["list"][0][vendor])?>" class="input" /></td>
</tr>
<tr>
<th>원산지/제조사</th>
<td class="space-left"><input type="text" name="madein" style="width:200" maxlength="50" value="<?=stripslashes($arrInfo["list"][0][madein])?>" class="input" /></td>
</tr>
<tr>
<th>옵션1</th>
<td class="space-left"><input type="text" name="etc_1" style="width:50%" value="<?=stripslashes($arrInfo["list"][0]["etc_1"])?>" class="input" /></td>
</tr>
<tr>
<th>옵션2</th>
<td class="space-left"><input type="text" name="etc_2" style="width:50%" value="<?=stripslashes($arrInfo["list"][0]["etc_2"])?>" class="input" /></td>
</tr>
<tr>
<th>옵션3</th>
<td class="space-left"><input type="text" name="etc_3" style="width:50%" value="<?=stripslashes($arrInfo["list"][0]["etc_3"])?>" class="input" /></td>
</tr>
<tr>
<th>옵션4</th>
<td class="space-left"><input type="text" name="etc_4" style="width:50%" value="<?=stripslashes($arrInfo["list"][0]["etc_4"])?>" class="input" /></td>
</tr>
<tr>
<th>옵션5</th>
<td class="space-left"><input type="text" name="etc_5" style="width:50%" value="<?=stripslashes($arrInfo["list"][0]["etc_5"])?>" class="input" /></td>
</tr>
<!-- <tr>
<th>소비자가</th>
<td class="space-left"><input type="text" name="sale_price" style="width:200" maxlength="20" value="<?=stripslashes($arrInfo["list"][0][sale_price])?>" class="input" /> (숫자만 입력)</td>
</tr> -->
<tr>
<th>판매가</th>
<td class="space-left"><input type="text" name="price" style="width:200" maxlength="20" value="<?=stripslashes($arrInfo["list"][0][price])?>" class="input" /> (숫자만 입력)</td>
</tr>
<!-- <tr>
<th>대처문구</th>
<td class="space-left"><input type="text" name="isbn" style="width:200" value="<?=stripslashes($arrInfo["list"][0][isbn])?>" class="input" /> 가격대신 들어갈 문구</td>
</td>
</tr> -->
<tr>
<th>적립금</th>
<td class="space-left"><input type="text" name="point" style="width:100" maxlength="20" value="<?=stripslashes($arrInfo["list"][0][point])?>" class="input" />
<select name="point_unit">
<option value="F"<?=$arrInfo["list"][0][point_unit]=="F"?" selected":""?>>고정금액</option>
<option value="P"<?=$arrInfo["list"][0][point_unit]=="P"?" selected":""?>>%</option>
</select>
</td>
</tr>
<tr>
<th>상품진열</th>
<td class="space-left"><input type="radio" id="is_show_y" name="is_show" value="Y"<?=$arrInfo["list"][0][is_show]=="Y"?" checked":""?>><label for="is_show_y"><font color=blue>진열함</font></label> &nbsp;
<input type="radio" id="is_show_n" name="is_show" value="N"<?=$arrInfo["list"][0][is_show]=="N"?" checked":""?>><label for="is_show_n"><font color=red>진열안함</font></label>
</td>
</tr>
<tr>
<th>메인노출 여부</th>
<td class="space-left">
<input type="radio" id="main_show_y" name="main_show" value="Y"<?=$arrInfo["list"][0][main_show]=="Y"?" checked":""?>><label for="main_show_y"><font color=blue>노출함</font</label> &nbsp;
<input type="radio" id="main_show_n" name="main_show" value="N"<?=$arrInfo["list"][0][main_show]=="N"?" checked":""?>><label for="main_show_n"><font color=red>노출안함</font</label> &nbsp;
</td>
</tr>
<!-- <tr>
<th>재고관리</th>
<td class="space-left">
<input type="radio" id="stock_type_1" name="stock_type" value="1" onclick="checkStockManage(1);"<?=$arrInfo["list"][0][stock_type]=="1"?" checked":""?>><label for="stock_type_1"><font color=blue>재고관리 안함</font></label> &nbsp;
<input type="radio" id="stock_type_2" name="stock_type" value="2" onclick="checkStockManage(2);"<?=$arrInfo["list"][0][stock_type]=="2"?" checked":""?>><label for="stock_type_2"><font color=green>일반 재고관리</font></label> &nbsp;
<input type="radio" id="stock_type_3" name="stock_type" value="3" onclick="checkStockManage(3);"<?=$arrInfo["list"][0][stock_type]=="3"?" checked":""?>><label for="stock_type_3"><font color=red>연계 재고관리</font></label>
<table class="admin-table-type1" id="layerStock" style="position:relative; display:none; width:200px !important;">
<tr>
<th>재고량</th>
<td class="space-left"><input type="text" name="stock" style="width:100" maxlength="10" value="<?=$arrInfo["list"][0][stock]?>" class="input" /></td>
</tr>
</table>
</td>
</tr> -->
</tbody>
</table>
<br />
<!-- 옵션 추가정보 -->
<h3 class="admin-title-middle" style="display:<?=$arrInfo["list"][0][stock_type]=="2"?"":"none"?>;">상품 옵션정보 &nbsp; <a href="javascript:append_opt();"><img src="/backoffice/images/k_add.gif" alt="추가" align="top" /></a> <a href="javascript:remove_opt();"><img src="/backoffice/images/k_delete.gif" alt="삭제" align="top" /></a></h3>
<!-- 옵션관련 변수 처리는 /common/js/shop.js 에서 처리합니다 -->
<input type="hidden" id="opt_hidden_count" name="opt_hidden_count" value="<?php echo $arrInfo['total_opt']; ?>">
<!-- 추가옵션 관리 -->
<table class="admin-table-type1" id="layerOption1" style="position:relative; display:<?=$arrInfo["list"][0][stock_type]=="2"?"":"none"?>;">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<th>추가옵션</th>
<td class="space-left">
<div style="width:480px;">
<table class="admin-table-type1" id="product_opt">
<colgroup>
<col width="150" />
<col width="200" />
<col width="130" />
</colgroup>
<tbody>
<tr>
<td colspan="3">옵션수정후 아래의 수정을 클릭을 하시면 적용됩니다.</td>
</tr>
<tr>
<th class="space-center">옵션명</th>
<th class="space-center">옵션항목</th>
<th class="space-center">항목설정</th>
</tr>
<?
for($i=0;$i<$arrInfo["total_opt"];$i++){
?>
<tr>
<td>
<input type='hidden' id='opt_hidden_value_<?=$i?>' name='opt_hidden_value_<?=$i?>'>
<input type='text' id='opt_subject_<?=$i?>' name='opt_subject_<?=$i?>' style='width:100%' maxlength='250' value="<?=stripslashes($arrInfo["opt"][$i]["opt_1"])?>" class="input" />
</td>
<td>
<select id='opt_contents_<?=$i?>' name='opt_contents_<?=$i?>' style='width:100%'>
<?
for($j=0;$j<$arrInfo["total_opt_info"];$j++){
if($arrInfo["opt"][$i]["opt_1"]==$arrInfo["opt_info"][$j]["opt_1"]){
?>
<option value="<?=$arrInfo["opt_info"][$j]["opt_1_value"]?>|<?=$arrInfo["opt_info"][$j]["price"]?>"><?=$arrInfo["opt_info"][$j]["opt_1_value"]?>|<?=$arrInfo["opt_info"][$j]["price"]?></option>
<?
}
}
?>
</select></td>
<td>
<a href="javascript:void(0);" onclick='LayerShowProductOpt(<?=$i?>, event)'><img src="/backoffice/images/k_add.gif" alt="추가" /></a>
<a href="javascript:void(0);" onclick='getProductOpt(<?=$i?>, document.getElementById("opt_contents_<?=$i?>").selectedIndex, document.getElementById("opt_contents_<?=$i?>").value, event)'><img src="/backoffice/images/k_modify.gif" alt="수정" /></a>
<a href="javascript:void(0);" onclick='delProductOpt(<?=$i?>, document.getElementById("opt_contents_<?=$i?>").selectedIndex)'><img src="/backoffice/images/k_delete.gif" alt="삭제" /></a>
</td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<!-- 추가옵션 관리 -->
<!-- 연계 재고관리 -->
<div id="layerOption2" style="position:relative; display:<?=$arrInfo["list"][0][stock_type]=="3"?"":"none"?>;">
<a href="javascript:;" id="addItemBtn" class="btn-pack medium dark">옵션추가</a>
<table id="stockoptiontbl" border="1px" class="admin-table-type1">
<tr>
<th>옵션명</th>
<th>항목명</th>
<th>가격</th>
<th>재고</th>
<th>옵션삭제</th>
</tr>
<?if($arrInfo["total_opt"]<1){?>
<tr class="item<?=$i+1?>">
<td><input type="text" class="input" name="opt_subject[]" id="opt_subject1" value="<?=$arrInfo["opt_info"][$j]["opt_1"]?>"/><!-- <a href="javascript:;" class="addBtn btn-pack">항목추가</a> --></td>
<td><input type="text" class="input" name="opt_contents[]" id="opt_contents_1" value="<?=$arrInfo["opt_info"][$j]["opt_1_value"]?>"/></td>
<td><input type="text" class="input" name="opt_price[]" value="<?=$arrInfo["opt_info"][$j]["price"]?>"/></td>
<td><input type="text" class="input" name="opt_stock[]" value="<?=$arrInfo["opt_info"][$j]["stock"]?>"/></td>
<td><a href="javascript:;" class="delBtn btn-pack">삭제</a></td>
</tr>
<?}else{?>
<?
for($i=0;$i<$arrInfo["total_opt"];$i++){
for($j=0;$j<$arrInfo["total_opt_info"];$j++){
?>
<tr class="item<?=$i+1?>">
<td><input type="text" class="input" name="opt_subject[]" id="opt_subject1" value="<?=$arrInfo["opt_info"][$j]["opt_1"]?>"/><!-- <a href="javascript:;" class="addBtn btn-pack">항목추가</a> --></td>
<td><input type="text" class="input" name="opt_contents[]" id="opt_contents_1" value="<?=$arrInfo["opt_info"][$j]["opt_1_value"]?>"/></td>
<td><input type="text" class="input" name="opt_price[]" value="<?=$arrInfo["opt_info"][$j]["price"]?>"/></td>
<td><input type="text" class="input" name="opt_stock[]" value="<?=$arrInfo["opt_info"][$j]["stock"]?>"/></td>
<td><a href="javascript:;" class="delBtn btn-pack">삭제</a></td>
</tr>
<?}}?>
<?}?>
</table>
</tbody>
</table>
</div>
<!-- 연계 재고관리 -->
<!-- 옵션 추가정보 -->
<!-- 상품 사진 -->
<br />
<h3 class="admin-title-middle">상품 사진 | <input type="radio" id="image_type_1" name="image_type" value="1" checked onclick="checkImageType(1);"<?=$arrInfo["list"][0][image_type]=="1"?" checked":""?>><label for="image_type_1"><font color=blue>대표이미지</font></label> <!-- <input type="radio" id="image_type_2" name="image_type" value="2" onclick="checkImageType(2);"<?=$arrInfo["list"][0][image_type]=="2"?" checked":""?>><label for="image_type_2"><font color=green>개별이미지</font></label> --></h3>
<!-- 이미지 타입 1 -->
<div id="layerImage1" style="position:relative; display:block;">
<div class="mgb5" style="line-height:20px;">
아래 이미지중 대표이미지로 설정된 이미지를 장바구니, 상품목록, 상품상세 이미지를 자동으로 생성(나머지는 확대이미지로 사용) <br />
이미지크기는 600px내외 1:1 비율이 적당합니다. 이미지파일의 확장자는 RGB모드의 jpg, gif, png 입니다.
</div>
<table class="admin-table-type1">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<?
//업로드 한것
if($arrInfo["total_files"]>0){
for($i=0; $i < $arrInfo["total_files"]; $i++){
?>
<tr>
<th>업로드된 사진 <?=$i+1?> </th>
<td class="space-left">
<span onClick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["files"][$i][re_name]?>', event);" style="cursor:pointer;">[보기]</span> &nbsp;
<!--
<a href="javascript:;" onclick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["files"][$i][re_name]?>');">보기</a>-->
<input type="checkbox" name="delPhoto[]" id="delPhoto1<?=$i?>" value="<?=$arrInfo["files"][$i][idx]?>"><label for="delPhoto1<?=$i?>"><font color=red>삭제</font></label> &nbsp;
<font color=blue><?=$arrInfo["files"][$i][re_name]==$arrInfo["list"][0][p_image]?"대표이미지":""?></font>
</td>
</tr>
<?}?>
<?}?>
<?
for($i=0; $i < intval($_SITE["PRODUCT"]["IMAGE_COUNT"] - $arrInfo["total_files"]); $i++){
?>
<tr>
<th>사진 <?=$i+1?></th>
<td class="space-left"><input type="file" name="photo_file[]" style="width:400px;" class="input" /> <input type="radio" name="p_image" value="<?=$i?>" id="idPhoto<?=$i?>"><label for="idPhoto<?=$i?>">대표이미지</label></td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
<!-- 이미지 타입 2 -->
<div id="layerImage2" style="position:relative; display:none;">
<div class="mgb5" style="line-height:20px;">
아래 이미지중 대표이미지로 설정된 이미지를 장바구니, 상품목록, 상품상세 이미지를 자동으로 생성(나머지는 확대이미지로 사용)
</div>
<table class="admin-table-type1">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<th>장바구니 사진</th>
<td class="space-left"><a href="javascript:;" onclick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["list"][0][image_s]?>');">[보기]</a> <input type="file" name="photo_file_s" style="width:400px;" class="input" /> </td>
</tr>
<tr>
<th>상품목록 사진</th>
<td class="space-left"><a href="javascript:;" onclick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["list"][0][image_m]?>');">[보기]</a> <input type="file" name="photo_file_m" style="width:400px;" class="input" /> </td>
</tr>
<tr>
<th>상세정보 사진</th>
<td class="space-left"><a href="javascript:;" onclick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["list"][0][image_l]?>');">[보기]</a> <input type="file" name="photo_file_l" style="width:400px;" class="input" /> </td>
</tr>
<?
//업로드 한것
if($arrInfo["total_files"]>0){
for($i=0; $i < $arrInfo["total_files"]; $i++){
?>
<tr>
<th>업로드된 사진 <?=$i+1?> </th>
<td class="space-left"><a href="javascript:;" onclick="LayerShowImage('<?=$arrInfo["list"][0][idx]?>/<?=$arrInfo["files"][$i][re_name]?>');">[보기]</a> &nbsp;
<input type="checkbox" name="delPhoto[]" id="delPhoto2<?=$i?>" value="<?=$arrInfo["files"][$i][idx]?>"><label for="delPhoto2<?=$i?>"><font color=red>[삭제]</font></label>
</td>
</tr>
<?}?>
<?}?>
<?
for($i=0; $i < intval($_SITE["PRODUCT"]["IMAGE_COUNT"] - $arrInfo["total_files"]); $i++){
?>
<tr>
<th>사진 <?=$i+1?></th>
<td class="space-left"><input type="file" name="photo_file[]" style="width:400px;" class="input" /></td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
<br />
<h3 class="admin-title-middle">상품 설명</h3>
<table width="100%;" border="0" cellspacing="1" cellpadding="6" bgcolor="#dedede">
<colgroup>
<col width="140" />
<col width="*" />
</colgroup>
<tbody>
<tr>
<th bgcolor="#f8f8f8">상세설명</th>
<td bgcolor="#ffffff">
<?
$edit_content = stripslashes($arrInfo["list"][0]["contents"]) ;
include $_SERVER[DOCUMENT_ROOT] . "/webedit/Editor.html";
?>
</td>
</tr>
<!-- <tr>
<th bgcolor="#f8f8f8">배송/교환안내</th>
<td bgcolor="#ffffff">
<?
$edit_name = "mokcha";
$edit_content = stripslashes($arrInfo["list"][0]["mokcha"]) ;
//include $_SERVER[DOCUMENT_ROOT] . "/webedit/Editor.html";
?>
</td>
</tr> -->
<!-- <tr>
<th bgcolor="#f8f8f8">모바일 상세설명</th>
<td bgcolor="#ffffff">
<?
$edit_name = "author_text";
$edit_content = stripslashes($arrInfo["list"][0]["author_text"]) ;
//include $_SERVER[DOCUMENT_ROOT] . "/webedit/Editor.html";
?>
</td>
</tr> -->
</tbody>
</table>
<div class="admin-buttons">
<div class="cen">
<span class="btn_pack xlarge icon"><span class="refresh"></span><input type="submit" value="정보수정" style="font-weight:bold" /></span>
</div>
</div>
</form>
</div>
</div>
<?
//DB해제
SetDisConn($dblink);
include $_SERVER[DOCUMENT_ROOT] . "/backoffice/footer.php" ;
?>
<script language="javascript">
jQuery(function($) {
function reset_category(obj) {
$(obj).empty().append("<option value=\"\">=========="+$(obj).attr("depth")+"차분류==========</option>");
}
function category_set(obj) {
var cat = $(obj).val();
if (cat.length) {
$("#cat_no").val(cat);
$.ajax({
type:"POST",
url:"/module/category/ajax.category.php",
data:{
mode : "getsub",
cat : cat
},
datatype:"json",
success: function(msg){
//if (!$("#debug").length) $("body").prepend("<div id='debug' style='position:absolute;width:80%;50%;background-color:#fff;left:10%;top:10%;z-index:9999;'></div>");
//$("#debug").html(msg);
data = JSON.parse(msg);
if (data.success && data.calist.length) {
var target, idx;
idx = parseInt($(obj).attr("depth")) + 1;
target = ".depth"+idx;
if ($(target).length) {
reset_category(target);
for(var i=0; i<data.calist.length; i++) {
$(target).append("<option value=\""+data.calist[i].cat_no+"\">"+data.calist[i].cat_name+"</option>");
}
}
}
},
error:function(msg){
alert("로드에러");
document.reload();
},
complete : function(){
},
beforeSend : function() {
}
});
}
}
// 초기화
$(".subcategory").each(function(idx) {
//reset_category(this);
$(this).bind("change",function() {
category_set(this);
});
});
$("#cat").change(function() {
category_set(this);
});
$("select[name=caList]").change(function() {
if ($(this).val() != "") {
var cat = $(this).val();
$.ajax({
type:"POST",
url:"/module/shop/ajax.good.php",
data:{
mode : "getproduct",
cat : cat
},
datatype:"json",
success: function(msg){
//if (!$("#debug").length) $("body").prepend("<div id='debug' style='position:absolute;width:80%;50%;background-color:#fff;left:10%;top:10%;z-index:9999;'></div>");
//$("#debug").html(msg);
data = JSON.parse(msg);
if (data.success) {
var target;
target = "select[name=pickList]";
if ($(target).length) {
$(target).empty();
for(var i=0; i<data.result.length; i++) {
$(target).append("<option value=\""+data.result[i].idx+"\">"+data.result[i].g_name+"</option>");
}
}
}
},
error:function(msg){
alert("로드에러");
document.reload();
},
complete : function(){
},
beforeSend : function() {
}
});
}
});
$(".addcat").click(function() {
if ($("select[name=addcaList] option:selected").length) {
$("select[name=addcaList] option:selected").each(function(idx) {
var obj = this;
$("select[name='rel_category[]'] option").each(function() {
if ($(this).val() == $(obj).val()) {
$(this).remove();
}
});
$("select[name='rel_category[]']").append("<option value='"+$(obj).val()+"'>"+$(obj).text()+"</option>");
});
} else {
alert("분류를 선택해주세요");
return false;
}
});
$(".delcat").click(function() {
if ($("select[name='rel_category[]'] option:selected").length) {
$("select[name='rel_category[]'] option:selected").each(function(idx) {
$(this).remove();
});
} else {
alert("분류를 선택해주세요");
return false;
}
});
$(".addrel").click(function() {
if ($("select[name=pickList] option:selected").length) {
$("select[name=pickList] option:selected").each(function(idx) {
var obj = this;
$("select[name='rel_product[]'] option").each(function() {
if ($(this).val() == $(obj).val()) {
$(this).remove();
}
});
$("select[name='rel_product[]']").append("<option value='"+$(obj).val()+"'>"+$(obj).text()+"</option>");
});
} else {
alert("상품을 선택해주세요");
return false;
}
});
$(".delrel").click(function() {
if ($("select[name='rel_product[]'] option:selected").length) {
$("select[name='rel_product[]'] option:selected").each(function(idx) {
$(this).remove();
});
} else {
alert("상품을 선택해주세요");
return false;
}
});
$("form[name=frmInfo]").submit(function() {
if ($("input[name=cat_no]").val() == ""){
alert("상품 분류를 선택해 주십시요.");
$("input[name=cat_no]").focus();
return false;
}
if ($("input[name=p_name]").val() == ""){
alert("상품명을 입력해 주십시요.");
$("input[name=cat_no]").focus();
return false;
}
try{ contents.outputBodyHTML(); } catch(e){ }
$("select[name='rel_product[]'] option").each(function(idx) {
$(this).attr("selected","selected");
});
$("select[name='rel_category[]'] option").each(function(idx) {
$(this).attr("selected","selected");
});
});
});
//상품연계재고관리시(관리자용)
$(document).ready(function(){
// 옵션추가 버튼 클릭시
$("#addItemBtn").click(function(){
// item 의 최대번호 구하기
var lastItemNo = $("#stockoptiontbl tr:last").attr("class").replace("item", "");
var newitem = $("#stockoptiontbl tr:eq(1)").clone();
newitem.removeClass();
newitem.find("td:eq(0)").attr("rowspan", "1");
newitem.addClass("item"+(parseInt(lastItemNo)+1));
$("#stockoptiontbl").append(newitem);
$("#opt_hidden_count").val($("#opt_hidden_count").val() + 1);
});
// 항목추가 버튼 클릭시
$(".addBtn").live("click", function(){
var clickedRow = $(this).parent().parent();
var cls = clickedRow.attr("class");
// tr 복사해서 마지막에 추가
var newrow = clickedRow.clone();
newrow.find("td:eq(0)").remove();
newrow.insertAfter($("#stockoptiontbl ."+cls+":last"));
// rowspan 조정
resizeRowspan(cls);
$("#opt_hidden_count").val($("#opt_hidden_count").val() + 1);
});
// 삭제버튼 클릭시
$(".delBtn").live("click", function(){
var clickedRow = $(this).parent().parent();
var cls = clickedRow.attr("class");
// 각 항목의 첫번째 row를 삭제한 경우 다음 row에 td 하나를 추가해 준다.
if( clickedRow.find("td:eq(0)").attr("rowspan") ){
if( clickedRow.next().hasClass(cls) ){
clickedRow.next().prepend(clickedRow.find("td:eq(0)"));
}
}
clickedRow.remove();
// rowspan 조정
resizeRowspan(cls);
$("#opt_hidden_count").val($("#opt_hidden_count").val() - 1);
});
// cls : rowspan 을 조정할 class ex) item1, item2, ...
function resizeRowspan(cls){
var rowspan = $("."+cls).length;
$("."+cls+":first td:eq(0)").attr("rowspan", rowspan);
}
});
</script>
<div id="layerProductOpt" style="position:absolute; display:none; background-color:#FFCC00; border-size:3px;bordercolor:#CCCCCC"></div>
<div id="layerImageShow" style="position:absolute; display:none; background-color:#FFFFFF; border-size:3px;bordercolor:#CCCCCC"></div>
<div id="layerGoodCat" style="position:absolute; display:none; background-color:#FFCC00; border-size:3px;bordercolor:#CCCCCC"></div>
<div id="layerRelGood" style="position:absolute; display:none; background-color:#FFFFFF; border-size:3px;bordercolor:#CCCCCC">
<iframe id="iframeRelGood" name="iframeRelGood" border="1" width="1200" height="800"></iframe>
</div>
<iframe id="iframeHidden" name="iframeHidden" border="0" width="0" height="0"></iframe>