쇼핑몰: #115 상품검색 작업 중

This commit is contained in:
whitedot
2013-05-02 11:23:43 +09:00
parent 743705a791
commit f46429fcb0

View File

@ -5,18 +5,9 @@ include_once('./_common.php');
// 0 으로 설정하면 오류남 : 기본 2 // 0 으로 설정하면 오류남 : 기본 2
$image_rate = 2; $image_rate = 2;
$g4['title'] = "상품 검색"; $g4['title'] = "상품 검색 결과";
include_once('./_head.php'); include_once('./_head.php');
?>
<img src="<?php echo G4_SHOP_URL; ?>/img/top_search.gif" border="0"><p>
<table width=100% cellpadding=0 cellspacing=0 align=center border=0>
<tr>
<td>
&nbsp;&nbsp; 찾으시는 검색어는 &quot;<b><?php echo stripslashes(get_text($search_str)); ?></b>&quot; 입니다.
<br><br>
<?php
// QUERY 문에 공통적으로 들어가는 내용 // QUERY 문에 공통적으로 들어가는 내용
// 상품명에 검색어가 포한된것과 상품판매가능인것만 // 상품명에 검색어가 포한된것과 상품판매가능인것만
$sql_common = " from {$g4['shop_item_table']} a, $sql_common = " from {$g4['shop_item_table']} a,
@ -53,7 +44,6 @@ include_once('./_head.php');
$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'];
echo "&nbsp;&nbsp; 입력하신 검색어로 총 <b>{$total_count}건</b>의 상품이 검색 되었습니다.<br><br>";
// 임시배열에 저장해 놓고 분류별로 출력한다. // 임시배열에 저장해 놓고 분류별로 출력한다.
// write_serarch_save() 함수가 임시배열에 있는 내용을 출력함 // write_serarch_save() 함수가 임시배열에 있는 내용을 출력함
@ -85,15 +75,15 @@ include_once('./_head.php');
$save['it_id'][$save['cnt']] = $row['it_id']; $save['it_id'][$save['cnt']] = $row['it_id'];
$save[cnt]++; $save[cnt]++;
} }
mysql_free_result($result);
write_search_save($save);
} }
?> ?>
</td>
</tr> <p>검색어 <strong><?php echo stripslashes(get_text($search_str)); ?></strong>, 검색 결과 <?php echo $total_count; ?> 건</p>
</table>
<?php <?php
mysql_free_result($result);
write_search_save($save);
function write_search_save($save) function write_search_save($save)
{ {
global $g4, $search_str , $default , $image_rate , $cart_dir; global $g4, $search_str , $default , $image_rate , $cart_dir;