쇼핑몰: #114 상품 목록 표준화 및 스타일 작업 중

This commit is contained in:
whitedot
2013-05-02 16:38:04 +09:00
parent 5c2a585bbd
commit 35628ccfcb
4 changed files with 115 additions and 119 deletions

View File

@ -52,9 +52,9 @@ if ($w == "")
$html_title = "1단계분류추가"; $html_title = "1단계분류추가";
$ca['ca_use'] = 1; $ca['ca_use'] = 1;
$ca['ca_explan_html'] = 1; $ca['ca_explan_html'] = 1;
$ca['ca_img_width'] = $default['de_simg_width']; $ca['ca_img_width'] = $default['de_mimg_width'];
$ca['ca_img_height'] = $default['de_simg_height']; $ca['ca_img_height'] = $default['de_mimg_height'];
$ca['ca_list_mod'] = 4; $ca['ca_list_mod'] = 3;
$ca['ca_list_row'] = 5; $ca['ca_list_row'] = 5;
$ca['ca_stock_qty'] = 99999; $ca['ca_stock_qty'] = 99999;
} }
@ -145,14 +145,14 @@ $pg_anchor .= '</ul>';
<tr> <tr>
<th scope="row"><label for="ca_img_width">출력이미지 폭</label></th> <th scope="row"><label for="ca_img_width">출력이미지 폭</label></th>
<td> <td>
<?php echo help("환경설정 &gt; 이미지() 폭이 기본값으로 설정됩니다.\n".G4_SHOP_URL."/list.php에서 출력되는 이미지의 폭입니다."); ?> <?php echo help("쇼핑몰환경설정 &gt; 이미지() 넓이가 기본값으로 설정됩니다.\n".G4_SHOP_URL."/list.php에서 출력되는 이미지의 폭입니다."); ?>
<input type="text" name="ca_img_width" value="<?php echo $ca['ca_img_width']; ?>" id="ca_img_width" required class="required frm_input" size="5" > 픽셀 <input type="text" name="ca_img_width" value="<?php echo $ca['ca_img_width']; ?>" id="ca_img_width" required class="required frm_input" size="5" > 픽셀
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="ca_img_height">출력이미지 높이</label></th> <th scope="row"><label for="ca_img_height">출력이미지 높이</label></th>
<td> <td>
<?php echo help("환경설정 &gt; 이미지() 높이가 기본값으로 설정됩니다.\n".G4_SHOP_URL."/list.php에서 출력되는 이미지의 높이입니다."); ?> <?php echo help("쇼핑몰환경설정 &gt; 이미지() 높이가 기본값으로 설정됩니다.\n".G4_SHOP_URL."/list.php에서 출력되는 이미지의 높이입니다."); ?>
<input type="text" name="ca_img_height" value="<?php echo $ca['ca_img_height']; ?>" id="ca_img_height" required class="required frm_input" size="5" > 픽셀 <input type="text" name="ca_img_height" value="<?php echo $ca['ca_img_height']; ?>" id="ca_img_height" required class="required frm_input" size="5" > 픽셀
</td> </td>
</tr> </tr>

View File

@ -307,6 +307,9 @@ input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important
#sidx_img {margin:0 0 20px} #sidx_img {margin:0 0 20px}
/* 상품 목록 */ /* 상품 목록 */
#sct {}
.sct_admin {text-align:right}
/* 공통 */ /* 공통 */
.sct_wrap {margin:0 0 30px;zoom:1} .sct_wrap {margin:0 0 30px;zoom:1}
.sct_wrap:after {display:block;visibility:hidden;clear:both;content:''} .sct_wrap:after {display:block;visibility:hidden;clear:both;content:''}
@ -324,9 +327,10 @@ input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important
.sct_10 .sct_li {float:left;margin:0 25px 0 0;width:230px} .sct_10 .sct_li {float:left;margin:0 25px 0 0;width:230px}
.sct_10 .sct_last {margin:0 !important} .sct_10 .sct_last {margin:0 !important}
.sct_13 .sct_clear {clear:both} .sct_13 .sct_clear {clear:both}
.sct_10 .sct_a {display:block;position:relative;font-weight:bold;text-decoration:none} .sct_10 .sct_a {display:block;position:relative;text-decoration:none}
.sct_10 .sct_img {display:block;margin:0 0 15px} .sct_10 .sct_img {display:block;margin:0 0 15px}
.sct_10 b {display:block;margin:0 0 8px;font-weight:normal} .sct_10 b {display:block;margin:0 0 8px;font-weight:normal}
.sct_10 .sct_cost {display:block;margin:0 0 10px;font-weight:bold}
.sct_10 .sct_icon {position:absolute;top:10px;left:-5px;margin:0 !important} .sct_10 .sct_icon {position:absolute;top:10px;left:-5px;margin:0 !important}
.sct_10 .sct_icon img {display:block} .sct_10 .sct_icon img {display:block}
.sct_10 .sct_sns {position:absolute;top:190px;right:20px} .sct_10 .sct_sns {position:absolute;top:190px;right:20px}
@ -335,10 +339,10 @@ input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important
.sct_11 .sct_li {float:left;margin:0 25px 0 0;width:230px} .sct_11 .sct_li {float:left;margin:0 25px 0 0;width:230px}
.sct_11 .sct_last {margin:0 !important} .sct_11 .sct_last {margin:0 !important}
.sct_13 .sct_clear {clear:both} .sct_13 .sct_clear {clear:both}
.sct_11 .sct_a {display:block;position:relative;padding:0 0 5px;background:#f7f7f7;font-weight:bold;text-decoration:none} .sct_11 .sct_a {display:block;position:relative;padding:0 0 5px;background:#f7f7f7;text-decoration:none}
.sct_11 .sct_img {display:block;margin:0 0 15px} .sct_11 .sct_img {display:block;margin:0 0 15px}
.sct_11 b {display:block;margin:0 0 8px;padding:0 5px;font-weight:normal} .sct_11 b {display:block;margin:0 0 8px;padding:0 5px;font-weight:normal}
.sct_11 .sct_cost {display:block;margin:0 0 10px;padding:0 5px} .sct_11 .sct_cost {display:block;margin:0 0 10px;padding:0 5px;font-weight:bold}
.sct_11 .sct_icon {position:absolute;top:10px;left:-5px;margin:0 !important} .sct_11 .sct_icon {position:absolute;top:10px;left:-5px;margin:0 !important}
.sct_11 .sct_icon img {display:block} .sct_11 .sct_icon img {display:block}
.sct_11 .sct_sns {position:absolute;bottom:10px;right:10px} .sct_11 .sct_sns {position:absolute;bottom:10px;right:10px}

View File

@ -7,9 +7,9 @@ $sql = " select *
and ca_use = '1' "; and ca_use = '1' ";
$ca = sql_fetch($sql); $ca = sql_fetch($sql);
if (!$ca['ca_id']) if (!$ca['ca_id'])
alert("등록된 분류가 없습니다."); alert('등록된 분류가 없습니다.');
$g4['title'] = $ca['ca_name'] . " 상품리스트"; $g4['title'] = $ca['ca_name'].' 상품리스트';
if ($ca['ca_include_head']) if ($ca['ca_include_head'])
@include_once($ca['ca_include_head']); @include_once($ca['ca_include_head']);
@ -19,102 +19,92 @@ else
// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화) // 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin; //if ($skin) $ca[ca_skin] = $skin;
$nav_ca_id = $ca_id;
include G4_SHOP_PATH.'/navigation1.inc.php';
$himg = G4_DATA_URL."/category/{$ca_id}_h";
if (file_exists($himg)) {
echo "<img src='$himg' border=0><br>";
}
// 상단 HTML
echo stripslashes($ca['ca_head_html']);
if ($is_admin) if ($is_admin)
echo "<p align=center><a href='".G4_ADMIN_URL."/shop_admin/categoryform.php?w=u&ca_id=$ca_id'><img src='".G4_SHOP_URL."/img/btn_admin_modify.gif' border=0></a></p>"; echo '<div class="sct_admin"><a href="'.G4_ADMIN_URL.'/shop_admin/categoryform.php?w=u&amp;ca_id='.$ca_id.'" class="btn_admin">분류 관리</a></div>';
include G4_SHOP_PATH.'/listcategory2.inc.php';
?> ?>
<table width=100% cellpadding=0 cellspacing=0> <div id="sct">
<tr>
<td>
<?php <?
// 상품 출력순서가 있다면 $nav_ca_id = $ca_id;
if ($sort != "") { include G4_SHOP_PATH.'/navigation1.inc.php';
$order_by = $sort . " , ";
}
// 상품 (하위 분류의 상품을 모두 포함한다.) $himg = G4_DATA_URL.'/category/'.$ca_id.'_h';
$sql_list1 = " select * "; if (file_exists($himg)) {
$sql_list2 = " order by $order_by it_order, it_id desc "; echo '<div id="sct_himg" class="sct_img"><img src="'.$himg.'" alt=""></div>';
}
// 하위분류 포함 // 상단 HTML
// 판매가능한 상품만 echo '<div id="sct_hhtml">'.stripslashes($ca['ca_head_html']).'</div>';
$sql_common = " from {$g4['shop_item_table']}
where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
$error = "<img src='".G4_SHOP_URL."/img/no_item.gif' border=0>"; include G4_SHOP_PATH.'/listcategory2.inc.php';
// 리스트 유형별로 출력 // 상품 출력순서가 있다면
$list_file = G4_SHOP_PATH.'/'.$ca['ca_skin']; if ($sort != "") {
if (file_exists($list_file)) { $order_by = $sort . " , ";
}
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]); // 상품 (하위 분류의 상품을 모두 포함한다.)
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
$list_mod = $ca['ca_list_mod']; // 하위분류 포함
$list_row = $ca['ca_list_row']; // 판매가능한 상품만
$img_width = $ca['ca_img_width']; $sql_common = " from {$g4['shop_item_table']}
$img_height = $ca['ca_img_height']; where (ca_id like '{$ca_id}%'
or ca_id2 like '{$ca_id}%'
or ca_id3 like '{$ca_id}%')
and it_use = '1' ";
include G4_SHOP_PATH.'/list.sub.php'; $error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
include G4_SHOP_PATH.'/list.sort.php';
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items "; // 리스트 유형별로 출력
$result = sql_query($sql); $list_file = G4_SHOP_PATH.'/'.$ca['ca_skin'];
if (file_exists($list_file)) {
//display_type(2, "maintype10.inc.php", 4, 2, 100, 100, $ca[ca_id]);
$list_mod = $ca['ca_list_mod'];
$list_row = $ca['ca_list_row'];
$img_width = $ca['ca_img_width'];
$img_height = $ca['ca_img_height'];
include G4_SHOP_PATH.'/list.sub.php';
include G4_SHOP_PATH.'/list.sort.php';
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
$result = sql_query($sql);
echo '<div class="sct_wrap">';
include $list_file; include $list_file;
echo '</div>';
} }
else else
{ {
$i = 0;
$error = '<p class="sct_nofile">'.$ca['ca_skin'].' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
}
$i = 0; if ($i==0)
$error = "<p>{$ca['ca_skin']} 파일을 찾을 수 없습니다.<p>관리자에게 알려주시면 감사하겠습니다."; {
echo '<div>'.$error.'</div>';
}
} $qstr1 .= 'ca_id='.$ca_id.'&amp;skin='.$skin.'&amp;ev_id='.$ev_id.'&amp;sort='.$sort;
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&amp;page=');
?>
if ($i==0) <?php
{ // 하단 HTML
echo "<br>"; echo '<div id="sct_thtml">'.stripslashes($ca['ca_tail_html']).'</div>';
echo "<div align=center>$error</div>";
} $timg = G4_DATA_PATH.'/category/'.$ca_id.'_t';
if (file_exists($timg))
echo '<div id="sct_timg" class="sct_img"><img src="'.G4_DATA_URL.'/category/'.$ca_id.'_t" alt="">';
?> ?>
</div>
</td> <?
</tr>
</table>
<br>
<div align=center style='clear:both;'>
<?php
$qstr1 .= "ca_id=$ca_id&skin=$skin&ev_id=$ev_id&sort=$sort";
echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr1&page=");
?>
</div><br>
<?php
// 하단 HTML
echo stripslashes($ca['ca_tail_html']);
$timg = G4_DATA_PATH."/category/{$ca_id}_t";
if (file_exists($timg))
echo "<br><img src='".G4_DATA_URL."/category/{$ca_id}_t' border=0>";
if ($ca['ca_include_tail']) if ($ca['ca_include_tail'])
@include_once($ca['ca_include_tail']); @include_once($ca['ca_include_tail']);
else else

View File

@ -2,40 +2,42 @@
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?> ?>
<table width=100% cellpadding=2 cellspacing=0>
<tr>
<?php <?php
for ($i=0; $row=sql_fetch_array($result); $i++) if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// $list_mod 가로 나열 수
for ($i=1; $row=sql_fetch_array($result); $i++)
{ {
if ( ($i>0) && (($i%$list_mod)==0) ) $href = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
{ if ($list_mod >= 2) { // 1줄 이미지 : 2개 이상
echo "</tr>\n\n"; if ($i%$list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
echo "<tr><td colspan='$list_mod' background='".G4_SHOP_URL."/img/line_h.gif' height=1></td></tr>\n\n"; else if ($i%$list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
echo "<tr>\n"; else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
} }
if ($i == 1) echo '<ul class="sct sct_10">';
echo " ?>
<td width='{$td_width}%' align=center valign=top> <li class="sct_li <?php echo $sct_last; ?>">
<br> <a href="<?php echo $href; ?>" class="sct_a">
<table width=98% cellpadding=2 cellspacing=0> <span class="sct_img"><?php echo get_it_image($row['it_id'].'_s', $img_width, $img_height, '', $type); ?></span>
<tr><td align=center>".get_it_image($row['it_id']."_s", $img_width , $img_height, $row['it_id'])."</td></tr> <b><?php echo stripslashes($row['it_name']); ?></b>
<tr><td align=center>".it_name_icon($row)."</td></tr>"; <?php if ($row['it_cust_amount'] && !$row['it_gallery']) { ?>
<s><?php echo display_amount($row['it_cust_amount']); ?></s>
if ($row['it_cust_amount'] && !$row['it_gallery']) <?php } ?>
echo "<tr><td align=center><strike>".display_amount($row['it_cust_amount'])."</strike></td></tr>"; <?php if (!$row['it_gallery']) { // 전시 상품이 아닐 때 ?>
<span class="sct_cost"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></span>
echo "<tr><td align=center>"; <?php } ?>
<span class="sct_icon">
if (!$row['it_gallery']) <?php echo display_item_icon($row); // 이미지 아이콘?>
echo "<span class=amount>".display_amount(get_amount($row), $row['it_tel_inq'])."</span>"; </span>
</a>
echo "</td></tr></table></td>"; <div class="sct_sns">
} <a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_fb.png" alt="페이스북에 공유"></a>
<a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_twt.png" alt="트위터에 공유"></a>
// 나머지 td 를 채운다. <a href="#"><img src="<?php echo G4_URL; ?>/img/shop/sns_goo.png" alt="구글플러스에 공유"></a>
if (($cnt = $i%$list_mod) != 0) </div>
for ($k=$cnt; $k<$list_mod; $k++) </li>
echo " <td>&nbsp;</td>\n"; <?php }
if ($i > 1) echo '</ul>';
?> ?>
</tr>
</table>