경로 수정 작업 중
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
include_once('./_common.php');
|
||||
|
||||
// 상품이미지 사이즈(폭, 높이)를 몇배 축소 할것인지를 설정
|
||||
// 0 으로 설정하면 오류남 : 기본 2
|
||||
$image_rate = 2;
|
||||
|
||||
$g4[title] = "상품 검색";
|
||||
include_once("./_head.php");
|
||||
$g4['title'] = "상품 검색";
|
||||
include_once('./_head.php');
|
||||
?>
|
||||
|
||||
<img src="<?=$g4[shop_img_path]?>/top_search.gif" border="0"><p>
|
||||
<img src="<?=G4_SHOP_URL?>/img/top_search.gif" border="0"><p>
|
||||
|
||||
<table width=100% cellpadding=0 cellspacing=0 align=center border=0>
|
||||
<tr>
|
||||
@ -19,14 +19,14 @@ include_once("./_head.php");
|
||||
<?
|
||||
// QUERY 문에 공통적으로 들어가는 내용
|
||||
// 상품명에 검색어가 포한된것과 상품판매가능인것만
|
||||
$sql_common = " from $g4[yc4_item_table] a,
|
||||
$g4[yc4_category_table] b
|
||||
$sql_common = " from {$g4['yc4_item_table']} a,
|
||||
{$g4['yc4_category_table']} b
|
||||
where a.ca_id=b.ca_id
|
||||
and a.it_use = 1
|
||||
and a.it_use = 1
|
||||
and b.ca_use = 1
|
||||
/* 중복검색에 대한 오류로 인해 막음 : where (a.ca_id=b.ca_id or a.ca_id2=b.ca_id or a.ca_id3=b.ca_id) */ ";
|
||||
if ($search_str) {
|
||||
$sql_common .= " and ( a.it_id like '$search_str%' or
|
||||
$sql_common .= " and ( a.it_id like '$search_str%' or
|
||||
a.it_name like '%$search_str%' or
|
||||
a.it_basic like '%$search_str%' or
|
||||
a.it_explan like '%$search_str%' ) ";
|
||||
@ -52,7 +52,7 @@ include_once("./_head.php");
|
||||
// 검색된 내용이 몇행인지를 얻는다
|
||||
$sql = " select COUNT(*) as cnt $sql_common ";
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row[cnt];
|
||||
$total_count = $row['cnt'];
|
||||
echo " 입력하신 검색어로 총 <b>{$total_count}건</b>의 상품이 검색 되었습니다.<br><br>";
|
||||
|
||||
// 임시배열에 저장해 놓고 분류별로 출력한다.
|
||||
@ -60,29 +60,29 @@ include_once("./_head.php");
|
||||
if ($total_count > 0) {
|
||||
if (trim($search_str)) {
|
||||
// 인기검색어
|
||||
$sql = " insert into $g4[popular_table]
|
||||
$sql = " insert into {$g4['popular_table']}
|
||||
set pp_word = '$search_str',
|
||||
pp_date = '$g4[time_ymd]',
|
||||
pp_ip = '$_SERVER[REMOTE_ADDR]' ";
|
||||
pp_date = '".G4_TIME_YMD."',
|
||||
pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
sql_query($sql, FALSE);
|
||||
}
|
||||
|
||||
unset($save); // 임시 저장 배열
|
||||
$sql = " select a.ca_id,
|
||||
$sql = " select a.ca_id,
|
||||
a.it_id
|
||||
$sql_common
|
||||
order by a.ca_id, a.it_id desc ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=mysql_fetch_array($result); $i++) {
|
||||
if ($save[ca_id] != $row[ca_id]) {
|
||||
if ($save[ca_id]) {
|
||||
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['ca_id'] = $row['ca_id'];
|
||||
$save['cnt'] = 0;
|
||||
}
|
||||
$save[it_id][$save[cnt]] = $row[it_id];
|
||||
$save['it_id'][$save['cnt']] = $row['it_id'];
|
||||
$save[cnt]++;
|
||||
}
|
||||
mysql_free_result($result);
|
||||
@ -94,11 +94,11 @@ include_once("./_head.php");
|
||||
</table>
|
||||
|
||||
<?
|
||||
function write_search_save($save)
|
||||
function write_search_save($save)
|
||||
{
|
||||
global $g4, $search_str , $default , $image_rate , $cart_dir;
|
||||
|
||||
$sql = " select ca_name from $g4[yc4_category_table] where ca_id = '$save[ca_id]' ";
|
||||
$sql = " select ca_name from {$g4['yc4_category_table']} where ca_id = '{$save['ca_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
/*
|
||||
@ -122,9 +122,9 @@ function write_search_save($save)
|
||||
$ca_temp = "";
|
||||
if(strlen($save['ca_id']) > 2) // 중분류 이하일 경우
|
||||
{
|
||||
$sql2 = " select ca_name from $g4[yc4_category_table] where ca_id='".substr($save[ca_id],0,2)."' ";
|
||||
$sql2 = " select ca_name from $g4[yc4_category_table] where ca_id='".substr($save['ca_id'],0,2)."' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$ca_temp = "<b><a href='./list.php?ca_id=".substr($save[ca_id],0,2)."'>$row2[ca_name]</a></b> > ";
|
||||
$ca_temp = "<b><a href='./list.php?ca_id=".substr($save['ca_id'],0,2)."'>{$row2['ca_name']}</a></b> > ";
|
||||
}
|
||||
echo "
|
||||
<table width=98% cellpadding=0 cellspacing=0 border=0 align=center>
|
||||
@ -134,15 +134,15 @@ function write_search_save($save)
|
||||
<colgroup width=100>
|
||||
<tr><td colspan=4 height=2 bgcolor=#0E87F9></td></tr>
|
||||
<tr>
|
||||
<td colspan=2 height='28'> {$ca_temp}<b><a href='./list.php?ca_id={$save[ca_id]}'>$row[ca_name]</a></b> ($save[cnt])</td>
|
||||
<td colspan=2 height='28'> {$ca_temp}<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>";
|
||||
|
||||
for ($i=0; $i<$save[cnt]; $i++) {
|
||||
for ($i=0; $i<$save['cnt']; $i++) {
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
it_name,
|
||||
it_amount,
|
||||
it_amount2,
|
||||
it_amount3,
|
||||
@ -153,10 +153,10 @@ function write_search_save($save)
|
||||
it_type3,
|
||||
it_type4,
|
||||
it_type5
|
||||
from $g4[yc4_item_table] where it_id = '{$save[it_id][$i]}' ";
|
||||
from {$g4['yc4_item_table']} where it_id = '{$save['it_id'][$i]}' ";
|
||||
$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'] / $image_rate), (int)($default['de_simg_height'] / $image_rate), $row['it_id']);
|
||||
|
||||
if ($i > 0)
|
||||
echo "<tr><td height=1></td><td bgcolor=#CCCCCC colspan=3></td></tr>";
|
||||
@ -165,14 +165,14 @@ function write_search_save($save)
|
||||
<tr>
|
||||
<td align=center style='padding-top:7px; padding-bottom:7px;'>$image</td>
|
||||
<td> ".it_name_icon($row)."</td>
|
||||
<!-- <td align=right class=amount>".display_amount($row[it_amount])." </td> -->
|
||||
<td align=right class=amount>".display_amount(get_amount($row), $row[it_tel_inq])." </td>
|
||||
<td align=right>".display_point($row[it_point])." </td>
|
||||
<!-- <td align=right class=amount>".display_amount($row['it_amount'])." </td> -->
|
||||
<td align=right class=amount>".display_amount(get_amount($row), $row['it_tel_inq'])." </td>
|
||||
<td align=right>".display_point($row['it_point'])." </td>
|
||||
</tr>";
|
||||
}
|
||||
}
|
||||
echo "<tr><td colspan=4 height=1 bgcolor=#CCCCCC></td></tr>";
|
||||
echo "</table><br><br>\n";
|
||||
}
|
||||
|
||||
include_once("./_tail.php");
|
||||
include_once('./_tail.php');
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user