include_once("./_common.php");
// 상품이미지 사이즈(폭, 높이)를 몇배 축소 할것인지를 설정
// 0 으로 설정하면 오류남 : 기본 2
$image_rate = 2;
$g4[title] = "상품 검색";
include_once("./_head.php");
?>

|
찾으시는 검색어는 "=stripslashes(get_text($search_str))?>" 입니다.
// QUERY 문에 공통적으로 들어가는 내용 // 상품명에 검색어가 포한된것과 상품판매가능인것만 $sql_common = " from $g4[yc4_item_table] a, $g4[yc4_category_table] b where a.ca_id = b.ca_id and ( a.it_name like '%$search_str%' or a.it_basic like '%$search_str%' or a.it_explan like '%$search_str%' ) and a.it_use = 1 and b.ca_use = 1 "; // 분류선택이 있다면 특정 분류만 if ($search_ca_id != "") $sql_common .= " and a.ca_id like '$search_ca_id%' "; // 검색된 내용이 몇행인지를 얻는다 $sql = " select COUNT(*) as cnt $sql_common "; $row = sql_fetch($sql); $total_count = $row[cnt]; $rows = $config[cf_page_rows]; $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함 echo " 입력하신 검색어로 총 {$total_count}건의 상품이 검색 되었습니다. "; // 임시배열에 저장해 놓고 분류별로 출력한다. // write_serarch_save() 함수가 임시배열에 있는 내용을 출력함 if ($total_count > 0) { unset($save); // 임시 저장 배열 $sql = " select a.ca_id, a.it_id $sql_common order by a.ca_id, a.it_id desc limit $from_record, $rows "; $result = sql_query($sql); for ($i=0; $row=mysql_fetch_array($result); $i++) { if ($save[ca_id] != $row[ca_id]) { if ($save[ca_id]) { write_search_save($save); unset($save); } $save[ca_id] = $row[ca_id]; $save[cnt] = 0; } $save[it_id][$save[cnt]] = $row[it_id]; $save[cnt]++; } mysql_free_result($result); write_search_save($save); } ?> |
| $row[ca_name] | 판매가격 | 포인트 | |
| $image | ".it_name_icon($row)." | ".display_amount(get_amount($row), $row[it_tel_inq])." | ".display_point($row[it_point])." |