쇼핑몰: #115 #117 상품검색 이미지 노출 관련 오류

This commit is contained in:
whitedot
2013-05-02 13:05:48 +09:00
parent b0d69bd27d
commit be575a2f49
2 changed files with 84 additions and 98 deletions

View File

@ -363,3 +363,10 @@ input.required:focus {padding:3px 3px 4px;border:0;background:#21272e !important
.sfaq_tolist {padding:0 10px;text-align:right} .sfaq_tolist {padding:0 10px;text-align:right}
.sfaq_admin {text-align:right} .sfaq_admin {text-align:right}
.sfaq_img {text-align:center} .sfaq_img {text-align:center}
/* 상품검색 */
#ssch_ov {margin:0 0 10px;padding:15px 0;border:1px solid #e9e9e9;background:#f7f7f7;text-align:center}
#ssch caption {padding:0 0 5px;font-size:1em;font-weight:bold;text-align:left;line-height:1.5em}
.ssch_it_img {width:100px;text-align:center}
/* .ssch_it_img img {width:100px;height:100px} */
#ssch .ssch_num {width:150px;text-align:right}

View File

@ -1,10 +1,6 @@
<?php <?php
include_once('./_common.php'); include_once('./_common.php');
// 상품이미지 사이즈(폭, 높이)를 몇배 축소 할것인지를 설정
// 0 으로 설정하면 오류남 : 기본 2
$image_rate = 2;
$g4['title'] = "상품 검색 결과"; $g4['title'] = "상품 검색 결과";
include_once('./_head.php'); include_once('./_head.php');
@ -44,7 +40,13 @@ if ($search_ca_id != "")
$sql = " select COUNT(*) as cnt $sql_common "; $sql = " select COUNT(*) as cnt $sql_common ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = $row['cnt'];
?>
<div id="ssch">
<div id="ssch_ov">검색어 <strong><?php echo ($search_str ? stripslashes(get_text($search_str)) : '없음'); ?></strong> | 검색 결과 <strong><?php echo $total_count; ?></strong>건</div>
<?php
// 임시배열에 저장해 놓고 분류별로 출력한다. // 임시배열에 저장해 놓고 분류별로 출력한다.
// write_serarch_save() 함수가 임시배열에 있는 내용을 출력함 // write_serarch_save() 함수가 임시배열에 있는 내용을 출력함
if ($total_count > 0) { if ($total_count > 0) {
@ -76,11 +78,7 @@ if ($total_count > 0) {
$save[cnt]++; $save[cnt]++;
} }
} }
?>
<p>검색어 <strong><?php echo stripslashes(get_text($search_str)); ?></strong>, 검색 결과 <?php echo $total_count; ?> 건</p>
<?php
mysql_free_result($result); mysql_free_result($result);
write_search_save($save); write_search_save($save);
@ -91,45 +89,28 @@ function write_search_save($save)
$sql = " select ca_name from {$g4['shop_category_table']} where ca_id = '{$save['ca_id']}' "; $sql = " select ca_name from {$g4['shop_category_table']} where ca_id = '{$save['ca_id']}' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
/*
echo "
<table width=98% cellpadding=0 cellspacing=0 border=0 align=center>
<colgroup width=80>
<colgroup width=>
<colgroup width=150>
<colgroup width=100>
<tr><td colspan=4 height=2 bgcolor=#0E87F9></td></tr>
<tr>
<td colspan=2 height='28'>&nbsp;<b><a href='./list.php?ca_id={$save[ca_id]}'>$row[ca_name]</a></b> ($save[cnt])</td>
<td align=center>판매가격</td>
<td align=center>포인트</td>
</tr>
<tr><td colspan=4 height=1 bgcolor=#CCCCCC></td></tr>
";
*/
// 김선용 2006.12 : 중복 하위분류명이 많으므로 대분류 포함하여 출력 // 김선용 2006.12 : 중복 하위분류명이 많으므로 대분류 포함하여 출력
$ca_temp = ""; $ca_temp = "";
if(strlen($save['ca_id']) > 2) // 중분류 이하일 경우 if(strlen($save['ca_id']) > 2) // 중분류 이하일 경우
{ {
$sql2 = " select ca_name from $g4[shop_category_table] where ca_id='".substr($save['ca_id'],0,2)."' "; $sql2 = " select ca_name from $g4[shop_category_table] where ca_id='".substr($save['ca_id'],0,2)."' ";
$row2 = sql_fetch($sql2); $row2 = sql_fetch($sql2);
$ca_temp = "<b><a href='./list.php?ca_id=".substr($save['ca_id'],0,2)."'>{$row2['ca_name']}</a></b> &gt; "; $ca_temp = '<a href="./list.php?ca_id='.substr($save['ca_id'],0,2).'">'.$row2['ca_name'].'</a> &gt; ';
} }
echo " ?>
<table width=98% cellpadding=0 cellspacing=0 border=0 align=center> <table class="basic_tbl">
<colgroup width=80> <caption><?php echo $ca_temp?><a href="./list.php?ca_id=<?php echo $save['ca_id']; ?>"><?php echo $row['ca_name']; ?></a> 상품<?php echo $save['cnt']; ?>개</caption>
<colgroup width=> <thead>
<colgroup width=150>
<colgroup width=100>
<tr><td colspan=4 height=2 bgcolor=#0E87F9></td></tr>
<tr> <tr>
<td colspan=2 height='28'>&nbsp;{$ca_temp}<b><a href='./list.php?ca_id={$save['ca_id']}'>{$row['ca_name']}</a></b> ({$save['cnt']})</td> <th>이미지</td>
<td align=center>판매가격</td> <th>상품명</th>
<td align=center>포인트</td> <th>판매가격</td>
<th>포인트</td>
</tr> </tr>
<tr><td colspan=4 height=1 bgcolor=#CCCCCC></td></tr>"; </thead>
<tbody>
<?php
for ($i=0; $i<$save['cnt']; $i++) { for ($i=0; $i<$save['cnt']; $i++) {
$sql = " select it_id, $sql = " select it_id,
it_name, it_name,
@ -146,23 +127,21 @@ function write_search_save($save)
from {$g4['shop_item_table']} where it_id = '{$save['it_id'][$i]}' "; from {$g4['shop_item_table']} where it_id = '{$save['it_id'][$i]}' ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$image = get_it_image("{$row['it_id']}_s", (int)($default['de_simg_width'] / $image_rate), (int)($default['de_simg_height'] / $image_rate), $row['it_id']); $image = get_it_image($row['it_id'].'_s', (int)($default['de_simg_width']), (int)($default['de_simg_height']), $row['it_id']);
?>
if ($i > 0)
echo "<tr><td height=1></td><td bgcolor=#CCCCCC colspan=3></td></tr>";
echo "
<tr> <tr>
<td align=center style='padding-top:7px; padding-bottom:7px;'>$image</td> <td class="ssch_it_img"><?php echo $image; ?></td>
<td>&nbsp;".it_name_icon($row)."</td> <td><?php echo it_name_icon($row); ?></td>
<!-- <td align=right class=amount>".display_amount($row['it_amount'])."&nbsp;</td> --> <td class="ssch_num"><?php echo display_amount(get_amount($row), $row['it_tel_inq']); ?></td>
<td align=right class=amount>".display_amount(get_amount($row), $row['it_tel_inq'])."&nbsp;</td> <td class="ssch_num"><?php echo display_point($row['it_point']); ?></td>
<td align=right>".display_point($row['it_point'])."&nbsp;</td> </tr>
</tr>"; <?php } // for 끝 ?>
} </tbody>
echo "<tr><td colspan=4 height=1 bgcolor=#CCCCCC></td></tr>"; </table>
echo "</table><br><br>\n"; <?php } // function 끝 ?>
}
</div>
<?php
include_once('./_tail.php'); include_once('./_tail.php');
?> ?>