분류 상품 개별 스킨 기능 추가 중

This commit is contained in:
chicpro
2014-03-21 15:09:50 +09:00
parent 736b933aa8
commit 405d144bbd
6 changed files with 147 additions and 5 deletions

View File

@ -97,6 +97,13 @@ if(!sql_query(" select ca_nocoupon from {$g5['g5_shop_category_table']} limit 1
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
ADD `ca_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `ca_adult_use` ", true);
}
// 스킨 디렉토리 필드 추가
if(!sql_query(" select ca_skin_dir from {$g5['g5_shop_category_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
ADD `ca_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_name`,
ADD `ca_mobile_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_skin_dir` ", true);
}
?>
<form name="fcategoryform" action="./categoryformupdate.php" onsubmit="return fcategoryformcheck(this);" method="post" enctype="multipart/form-data">
@ -151,6 +158,34 @@ if(!sql_query(" select ca_nocoupon from {$g5['g5_shop_category_table']} limit 1
<?php } ?>
</td>
</tr>
<tr>
<th scope="row"><label for="ca_skin_dir">PC용 스킨명</label></th>
<td colspan="3">
<select name="ca_skin_dir" id="ca_skin_dir">
<?php
$arr = get_skin_dir('shop');
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($ca['ca_skin_dir'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="ca_mobile_skin_dir">모바일용 스킨명</label></th>
<td colspan="3">
<select name="ca_mobile_skin_dir" id="ca_mobile_skin_dir">
<?php
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($ca['ca_mobile_skin_dir'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row">본인확인 체크</th>
<td>

View File

@ -40,7 +40,9 @@ $g5['category_path'] = G5_DATA_PATH."/category";
if ($ca_image1_del) @unlink("{$g5['category_path']}/{$ca_id}_1");
if ($ca_image0_del) @unlink("{$g5['category_path']}/{$ca_id}_0");
$sql_common = " ca_skin = '$ca_skin',
$sql_common = " ca_skin_dir = '$ca_skin_dir',
ca_mobile_skin_dir = '$ca_mobile_skin_dir',
ca_skin = '$ca_skin',
ca_mobile_skin = '$ca_mobile_skin',
ca_img_width = '$ca_img_width',
ca_img_height = '$ca_img_height',

View File

@ -102,6 +102,7 @@ if(!sql_query(" select it_supply_point from {$g5['g5_shop_item_table']} limit 1
$pg_anchor ='<ul class="anchor">
<li><a href="#anc_sitfrm_cate">상품분류</a></li>
<li><a href="#anc_sitfrm_skin">스킨설정</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>
@ -126,6 +127,13 @@ if(!sql_query(" select it_nocoupon from {$g5['g5_shop_item_table']} limit 1", fa
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
ADD `it_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_use` ", true);
}
// 스킨필드 추가
if(!sql_query(" select it_skin from {$g5['g5_shop_item_table']} limit 1", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
ADD `it_skin` varchar(255) NOT NULL DEFAULT '' AFTER `ca_id3`,
ADD `it_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `it_skin` ", true);
}
?>
<form name="fitemform" action="./itemformupdate.php" method="post" enctype="MULTIPART/FORM-DATA" autocomplete="off" onsubmit="return fitemformcheck(this)">
@ -196,6 +204,68 @@ if(!sql_query(" select it_nocoupon from {$g5['g5_shop_item_table']} limit 1", fa
<?php echo $frm_submit; ?>
<section id="anc_sitfrm_skin">
<h2 class="h2_frm">스킨설정</h2>
<?php echo $pg_anchor; ?>
<div class="local_desc02 local_desc">
<p>상품상세보기에서 사용할 스킨을 설정합니다.</p>
</div>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>스킨설정</caption>
<colgroup>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="it_skin">PC용 스킨</label></th>
<td colspan="3">
<select name="it_skin" id="it_skin">
<?php
$arr = get_skin_dir('shop');
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($it['it_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_ca_it_skin" value="1" id="chk_ca_it_skin">
<label for="chk_ca_it_skin">분류적용</label>
<input type="checkbox" name="chk_all_it_skin" value="1" id="chk_all_it_skin">
<label for="chk_all_it_skin">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="it_mobile_skin">모바일용 스킨</label></th>
<td colspan="3">
<select name="it_mobile_skin" id="it_mobile_skin">
<?php
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($it['it_mobile_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_ca_it_mobile_skin" value="1" id="chk_ca_it_mobile_skin">
<label for="chk_ca_it_mobile_skin">분류적용</label>
<input type="checkbox" name="chk_all_it_mobile_skin" value="1" id="chk_all_it_mobile_skin">
<label for="chk_all_it_mobile_skin">전체적용</label>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
<section id="anc_sitfrm_ini">
<h2 class="h2_frm">기본정보</h2>
<?php echo $pg_anchor; ?>

View File

@ -266,6 +266,8 @@ if ($it_name == "")
$sql_common = " ca_id = '$ca_id',
ca_id2 = '$ca_id2',
ca_id3 = '$ca_id3',
it_skin = '$it_skin',
it_mobile_skin = '$it_mobile_skin',
it_name = '$it_name',
it_mobile_name = '$it_mobile_name',
it_maker = '$it_maker',
@ -456,6 +458,8 @@ if($supply_count) {
// 동일 분류내 상품 동일 옵션 적용
$ca_fields = '';
if(is_checked('chk_ca_it_skin')) $ca_fields .= " , it_skin = '$it_skin' ";
if(is_checked('chk_ca_it_mobile_skin')) $ca_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
if(is_checked('chk_ca_it_basic')) $ca_fields .= " , it_basic = '$it_basic' ";
if(is_checked('chk_ca_it_order')) $ca_fields .= " , it_order = '$it_order' ";
if(is_checked('chk_ca_it_type')) $ca_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";
@ -505,6 +509,8 @@ if($ca_fields) {
// 모든 상품 동일 옵션 적용
$all_fields = '';
if(is_checked('chk_all_it_skin')) $all_fields .= " , it_skin = '$it_skin' ";
if(is_checked('chk_all_it_mobile_skin')) $all_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
if(is_checked('chk_all_it_basic')) $all_fields .= " , it_basic = '$it_basic' ";
if(is_checked('chk_all_it_order')) $all_fields .= " , it_order = '$it_order' ";
if(is_checked('chk_all_it_type')) $all_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";

View File

@ -24,6 +24,19 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$ca_list .= '<option value="'.$row['ca_id'].'">'.$nbsp.$row['ca_name'].'</option>'.PHP_EOL;
}
// 스킨
$skin_list = '<option value="">선택</option>'.PHP_EOL;
$arr = get_skin_dir('shop');
for ($i=0; $i<count($arr); $i++) {
$skin_list .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
}
$mskin_list = '<option value="">선택</option>'.PHP_EOL;
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
$mskin_list .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
}
$where = " and ";
$sql_search = "";
@ -141,7 +154,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_id', 'sca='.$sca); ?>상품코드</a></th>
<th scope="col" colspan="4">분류</th>
<th scope="col" colspan="5">분류</th>
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_order', 'sca='.$sca); ?>순서</a></th>
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_use', 'sca='.$sca, 1); ?>판매</a></th>
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_soldout', 'sca='.$sca, 1); ?>품절</a></th>
@ -153,11 +166,13 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<th scope="col" id="th_pc_title"><?php echo subject_sort_link('it_name', 'sca='.$sca); ?>PC 상품명</a></th>
<th scope="col" id="th_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>판매가격</a></th>
<th scope="col" id="th_camt"><?php echo subject_sort_link('it_cust_price', 'sca='.$sca); ?>시중가격</a></th>
<th scope="col" id="th_skin">PC스킨</th>
</tr>
<tr>
<th scope="col" id="th_mo_title">모바일 상품명</th>
<th scope="col" id="th_pt"><?php echo subject_sort_link('it_point', 'sca='.$sca); ?>포인트</a></th>
<th scope="col" id="th_qty"><?php echo subject_sort_link('it_stock_qty', 'sca='.$sca); ?>재고</a></th>
<th scope="col" id="th_mskin">모바일스킨</th>
</tr>
</thead>
<tbody>
@ -173,14 +188,14 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
?>
<tr class="<?php echo $bg; ?>">
<td rowspan="3" class="td_chk">
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['bo_subject']) ?> 게시판</label>
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['it_name']); ?></label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
</td>
<td rowspan="3" class="td_num">
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<?php echo $row['it_id']; ?>
</td>
<td colspan="4">
<td colspan="5">
<label for="ca_id_<?php echo $i; ?>" class="sound_only">분류</label>
<select name="ca_id[<?php echo $i; ?>]" id="ca_id_<?php echo $i; ?>">
<?php echo conv_selected_option($ca_list, $row['ca_id']); ?>
@ -221,6 +236,12 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<label for="cust_price_<?php echo $i; ?>" class="sound_only">시중가격</label>
<input type="text" name="it_cust_price[<?php echo $i; ?>]" value="<?php echo $row['it_cust_price']; ?>" id="cust_price_<?php echo $i; ?>" class="frm_input sit_camt" size="7">
</td>
<td headers="th_skin" class="td_numbig td_input">
<label for="it_skin_<?php echo $i; ?>" class="sound_only">PC 스킨</label>
<select name="it_skin[<?php echo $i; ?>]" id="it_skin_<?php echo $i; ?>">
<?php echo conv_selected_option($skin_list, $row['it_skin']); ?>
</select>
</td>
</tr>
<tr class="<?php echo $bg; ?>">
<td headers="th_mo_title" class="td_input">
@ -232,11 +253,17 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
<label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고</label>
<input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input sit_qty" size="7">
</td>
<td headers="th_mskin" class="td_numbig td_input">
<label for="it_mobile_skin_<?php echo $i; ?>" class="sound_only">모바일 스킨</label>
<select name="it_mobile_skin[<?php echo $i; ?>]" id="it_mobile_skin_<?php echo $i; ?>">
<?php echo conv_selected_option($mskin_list, $row['it_mobile_skin']); ?>
</select>
</td>
</tr>
<?php
}
if ($i == 0)
echo '<tr><td colspan="11" class="empty_table">자료가 한건도 없습니다.</td></tr>';
echo '<tr><td colspan="12" class="empty_table">자료가 한건도 없습니다.</td></tr>';
?>
</tbody>
</table>

View File

@ -24,6 +24,8 @@ if ($_POST['act_button'] == "선택수정") {
it_cust_price = '{$_POST['it_cust_price'][$k]}',
it_price = '{$_POST['it_price'][$k]}',
it_stock_qty = '{$_POST['it_stock_qty'][$k]}',
it_skin = '{$_POST['it_skin'][$k]}',
it_mobile_skin = '{$_POST['it_mobile_skin'][$k]}',
it_use = '{$_POST['it_use'][$k]}',
it_soldout = '{$_POST['it_soldout'][$k]}',
it_order = '{$_POST['it_order'][$k]}',