쇼핑몰: #118 상품 목록 표준화 및 스타일 완료

This commit is contained in:
whitedot
2013-05-02 21:02:45 +09:00
parent b111507268
commit 5565b0d968
5 changed files with 58 additions and 102 deletions

View File

@ -104,7 +104,7 @@ a:active {color:#000;text-decoration:underline}
.stv_item {display:none;text-align:center}
.stv_item img {margin:5px 0}
#stv_nb {border-top:1px solid #e9e9e9;background:#f9faf5}
#stv_nb {border-top:1px solid #e9e9e9;background:#f7f7f7}
#stv_nb h3 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#stv_nb ul {margin:0;padding:0;list-style:none}
#stv_nb li {text-align:center}
@ -316,6 +316,19 @@ input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important
.sct_here {font-weight:bold}
.sct_bg {padding-right:15px !important;background:url('../img/shop/sct_bg_toright.gif') right 11px no-repeat}
/* 상품 목록 카테고리 목록 */
.sct_ct {}
.sct_ct ul {margin:0 0 10px;padding:10px;border-bottom:1px solid #e9e9e9;list-style:none;zoom:1}
.sct_ct ul:after {display:block;visibility:hidden;clear:both;content:''}
.sct_ct a {text-decoration:none}
.sct_ct_parent {font-weight:bold}
.sct_ct_here {color:#ff3600 !important}
#sct_ct_1 li {float:left;margin:0 10px 10px 0;width:120px}
#sct_ct_2 li {margin:0 0 10px}
#sct_ct_2 a {display:inline-block;width:120px}
#sct_ct_3 li {float:left;margin:0 10px 10px 0;width:120px}
/* 상품 정렬 */
#sct_sort {margin:0 0 10px;zoom:1}
#sct_sort:after {display:block;visibility:hidden;clear:both;content:''}

View File

@ -38,7 +38,7 @@ if ($is_admin)
// 상단 HTML
echo '<div id="sct_hhtml">'.stripslashes($ca['ca_head_html']).'</div>';
include G4_SHOP_PATH.'/listcategory.inc.php';
include G4_SHOP_PATH.'/listcategory3.inc.php';
// 상품 출력순서가 있다면
if ($sort != "") {

View File

@ -1,57 +1,33 @@
<?php
$str = "";
$str = '';
$exists = false;
$ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
// 차차기 분류의 건수를 얻음
$sql = " select count(*) as cnt from {$g4['shop_category_table']}
where ca_id like '$ca_id%'
and length(ca_id) = $len4
and ca_use = '1' ";
$row = sql_fetch($sql);
$cnt = $row['cnt'];
if (!$cnt)
$str .= "<tr><td width=11 background='".G4_SHOP_URL."/img/ca_bg02.gif'></td><td>";
$sql = " select ca_id, ca_name from {$g4['shop_category_table']}
where ca_id like '$ca_id%'
and length(ca_id) = $len2
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
$str .= "<tr><td width=11 background='".G4_SHOP_URL."/img/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td>";
while ($row=sql_fetch_array($result)) {
//$row2 = sql_fetch(" select count(*) as cnt from $g4[shop_category_table] where ca_id like '$row[ca_id]%' ");
$row2 = sql_fetch(" select count(*) as cnt from {$g4['shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
$str .= "<a href='./list.php?ca_id={$row['ca_id']}'>{$row['ca_name']} ({$row2['cnt']})</a> &nbsp; ";
$str .= '<li><a href="./list.php?ca_id='.$row['ca_id'].'">'.$row['ca_name'].' ('.$row2['cnt'].')</a></li>';
$exists = true;
}
$str .= "</td></tr></table></td><td width=11 background='".G4_SHOP_URL."/img/ca_bg03.gif'></td>";
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box01.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg01.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box03.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg04.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>
?>
<div id="sct_ct_1" class="sct_ct">
<ul>
<?php echo $str; ?>
</ul>
</div>
<?php } ?>

View File

@ -1,5 +1,5 @@
<?php
$str = "";
$str = '';
$exists = false;
$ca_id_len = strlen($ca_id);
@ -8,7 +8,7 @@ $len4 = $ca_id_len + 4;
// 최하위 분류의 경우 상단에 동일한 레벨의 분류를 출력해주는 코드
if (!$exists) {
$str = "";
$str = '';
$tmp_ca_id = substr($ca_id, 0, strlen($ca_id)-2);
$tmp_ca_id_len = strlen($tmp_ca_id);
@ -22,8 +22,6 @@ if (!$exists) {
and length(ca_id) = $len4 ";
$row = sql_fetch($sql);
$cnt = $row['cnt'];
if (!$cnt)
$str .= "<tr><td width=11 background='".G4_SHOP_URL."/img/ca_bg02.gif'></td><td>";
$sql = " select ca_id, ca_name from {$g4['shop_category_table']}
where ca_id like '$tmp_ca_id%'
@ -31,13 +29,13 @@ if (!$exists) {
and length(ca_id) = $len2 order by ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$style = "";
if ($ca_id == $row['ca_id'])
$style = " class='accent' ";
$sct_ct_here = '';
if ($ca_id == $row['ca_id']) // 활성 분류 표시
$sct_ct_here = 'sct_ct_here';
$str .= '<li>';
if ($cnt) {
$str .= "<tr><td width=11 background='".G4_SHOP_URL."/img/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td width=120><b>· <a href='./list.php?ca_id={$row['ca_id']}'><span $style>$row[ca_name]</span></a></b></td>";
$str .= '<a href="./list.php?ca_id='.$row['ca_id'].'" class="sct_ct_parent '.$sct_ct_here.'">'.$row['ca_name'].'</a>';
$sql2 = " select ca_id, ca_name from {$g4['shop_category_table']}
where ca_id like '{$row['ca_id']}%'
and ca_use = '1'
@ -45,42 +43,25 @@ if (!$exists) {
$result2 = sql_query($sql2);
$k=0;
while ($row2=sql_fetch_array($result2)) {
if (!$k)
$str .= "<td width=20 align=center>|</td><td class=lh>";
$str .= "<a href='./list.php?ca_id={$row2['ca_id']}'>{$row2['ca_name']}</a> &nbsp; ";
$str .= '<a href="./list.php?ca_id='.$row2['ca_id'].'">'.$row2['ca_name'].'</a>';
$k++;
}
//if (!$k) $str .= "<td></td><td>";
$str .= "</td></tr></table></td><td width=11 background='".G4_SHOP_URL."/img/ca_bg03.gif'></td>";
} else {
$str .= "<a href='./list.php?ca_id={$row['ca_id']}'><span $style>{$row['ca_name']}</span></a> &nbsp; ";
$str .= '<a href="./list.php?ca_id='.$row['ca_id'].'" class="sct_ct_parent '.$sct_ct_here.'">'.$row['ca_name'].'</a>';
}
$str .= '</li>';
$exists = true;
}
if (!$cnt)
$str .= "</td><td width=11 background='".G4_SHOP_URL."/img/ca_bg03.gif'></td></tr>";
}
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box01.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg01.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box03.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg04.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>
?>
<div id="sct_ct_2" class="sct_ct">
<ul>
<?php echo $str; ?>
</ul>
</div>
<?php } ?>

View File

@ -1,5 +1,5 @@
<?php
$str = "";
$str = '';
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
@ -10,36 +10,22 @@ $sql = " select ca_id, ca_name from {$g4['shop_category_table']}
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
$str .= "<tr><td width=11 background='".G4_SHOP_PATH."/img/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td>";
while ($row=sql_fetch_array($result)) {
if (preg_match("/^{$row['ca_id']}/", $ca_id))
$span = "<span style='font-weight:bold;'>";
$sct_ct_here = 'sct_ct_here';
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id={$row['ca_id']}'>{$span}{$row['ca_name']}</span></a> &nbsp; ";
$sct_ct_here = '';
$str .= '<li><a href="./list.php?ca_id='.$row['ca_id'].'" class="'.$sct_ct_here.'">'.$row['ca_name'].'</a></li>';
$exists = true;
}
$str .= "</td></tr></table></td><td width=11 background='".G4_SHOP_URL."/img/ca_bg03.gif'></td>";
if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box01.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg01.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box03.gif'></td>
<td background='".G4_SHOP_URL."/img/ca_bg04.gif'></td>
<td width=11><img src='".G4_SHOP_URL."/img/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>
?>
<div id="sct_ct_3" class="sct_ct">
<ul>
<?php echo $str; ?>
</ul>
</div>
<?php } ?>