it_explan_strip_tags 를 it_explan2 로 이름 변경

This commit is contained in:
gnuboard
2013-11-06 13:16:27 +09:00
parent 1c08308981
commit b3a8b90cfe
4 changed files with 40 additions and 37 deletions

View File

@ -260,8 +260,6 @@ $it_name = strip_tags(trim($_POST['it_name']));
if ($it_name == "") if ($it_name == "")
alert("상품명을 입력해 주십시오."); alert("상품명을 입력해 주십시오.");
$it_explan_strip_tags = strip_tags(trim($_POST['it_explan']));
$sql_common = " ca_id = '$ca_id', $sql_common = " ca_id = '$ca_id',
ca_id2 = '$ca_id2', ca_id2 = '$ca_id2',
ca_id3 = '$ca_id3', ca_id3 = '$ca_id3',
@ -280,7 +278,7 @@ $sql_common = " ca_id = '$ca_id',
it_type5 = '$it_type5', it_type5 = '$it_type5',
it_basic = '$it_basic', it_basic = '$it_basic',
it_explan = '$it_explan', it_explan = '$it_explan',
it_explan_strip_tags= '$it_explan_strip_tags', it_explan2 = '".strip_tags(trim($_POST['it_explan']))."',
it_mobile_explan = '$it_mobile_explan', it_mobile_explan = '$it_mobile_explan',
it_cust_price = '$it_cust_price', it_cust_price = '$it_cust_price',
it_price = '$it_price', it_price = '$it_price',

View File

@ -650,8 +650,8 @@ if(stripos($row['Type'], 'enum') !== false) {
// 상품테이블에 검색을 위하여 태그없는 상품설명 저장용 필드 추가 // 상품테이블에 검색을 위하여 태그없는 상품설명 저장용 필드 추가
if(!sql_query(" select it_explan_strip_tags from {$g5['g5_shop_item_table']} limit 1 ", false)) { if(!sql_query(" select it_explan2 from {$g5['g5_shop_item_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}` sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
ADD `it_explan_strip_tags` METIUMTEXT NOT NULL AFTER `it_explan` ", true); ADD `it_explan2 METIUMTEXT NOT NULL AFTER `it_explan` ", true);
} }
?> ?>

View File

@ -426,7 +426,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item` (
`it_type5` tinyint(4) NOT NULL DEFAULT '0', `it_type5` tinyint(4) NOT NULL DEFAULT '0',
`it_basic` text NOT NULL, `it_basic` text NOT NULL,
`it_explan` mediumtext NOT NULL, `it_explan` mediumtext NOT NULL,
`it_explan_strip_tags` mediumtext NOT NULL, `it_explan2` mediumtext NOT NULL,
`it_mobile_explan` mediumtext NOT NULL, `it_mobile_explan` mediumtext NOT NULL,
`it_cust_price` int(11) NOT NULL DEFAULT '0', `it_cust_price` int(11) NOT NULL DEFAULT '0',
`it_price` int(11) NOT NULL DEFAULT '0', `it_price` int(11) NOT NULL DEFAULT '0',

View File

@ -11,38 +11,45 @@ include_once('./_head.php');
// QUERY 문에 공통적으로 들어가는 내용 // QUERY 문에 공통적으로 들어가는 내용
// 상품명에 검색어가 포한된것과 상품판매가능인것만 // 상품명에 검색어가 포한된것과 상품판매가능인것만
$sql_common = " from {$g5['g5_shop_item_table']} a, $sql_common = " from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b ";
{$g5['g5_shop_category_table']} b $where = array();
where a.ca_id=b.ca_id $where[] = " (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) ";
and a.it_use = 1
and b.ca_use = 1 $search_all = true;
/* 중복검색에 대한 오류로 인해 막음 : where (a.ca_id=b.ca_id or a.ca_id2=b.ca_id or a.ca_id3=b.ca_id) */ "; // 상세검색 이라면
if ($search_str) { if (isset($qitname) || isset($qitexplan) || isset($qitid))
$sql_common .= " and ( a.it_id like '$search_str%' or $search_all = false;
a.it_name like '%$search_str%' or
a.it_basic like '%$search_str%' or $q = trim($_GET['q']);
a.it_explan like '%$search_str%' ) "; if ($q) {
} $arr = explode(" ", $q);
/* $detail_where = array();
// 공백을 구분하여 검색을 할때는 이 코드를 사용하십시오. or 조건 for ($i=0; $i<count($arr); $i++) {
if ($search_str) { $query = trim($arr[$i]);
$s_str = explode(" ", $search_str); if (!$query) continue;
$or = " ";
$sql_common .= " and ( "; $or = array();
for ($i=0; $i<count($s_str); $i++) { if ($search_all || $qitname)
$sql_common .= " $or (a.it_id like '$s_str[$i]%' or a.it_name like '%$s_str[$i]%' or a.it_basic like '%$s_str[$i]%' or a.it_explan like '%$s_str[$i]%' ) "; $or[] = " a.it_name like '%$query%' ";
$or = " or "; if ($search_all || $qitexplan)
$or[] = " a.it_explan2 like '%$query%' "; // tag 를 제거한 상품설명을 검색한다.
if ($search_all || $qitid)
$or[] = " a.it_id like '%$query%' ";
$detail_where[] = "(" . implode(" or ", $or) . ")";
} }
$sql_common .= " ) ";
$where[] = "(".implode(" or ", $detail_where).")";
} }
*/
// 분류선택이 있다면 특정 분류만 // 분류선택이 있다면 특정 분류만
if ($search_ca_id != "") if ($qcaid != "")
$sql_common .= " and a.ca_id like '$search_ca_id%' "; $where[] = " a.ca_id like '$qcaid%' ";
$sql_where = " where " . implode(" and ", $where);
// 검색된 내용이 몇행인지를 얻는다 // 검색된 내용이 몇행인지를 얻는다
$sql = " select COUNT(*) as cnt $sql_common "; $sql = " select COUNT(*) as cnt $sql_common $sql_where ";
$row = sql_fetch($sql); $row = sql_fetch($sql);
$total_count = $row['cnt']; $total_count = $row['cnt'];
?> ?>
@ -50,7 +57,7 @@ $total_count = $row['cnt'];
<!-- 검색결과 시작 { --> <!-- 검색결과 시작 { -->
<div id="ssch"> <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> <div id="ssch_ov">검색어 <strong><?php echo ($q ? stripslashes(get_text($q)) : '없음'); ?></strong> | 검색 결과 <strong><?php echo $total_count; ?></strong>건</div>
<?php <?php
// 임시배열에 저장해 놓고 분류별로 출력한다. // 임시배열에 저장해 놓고 분류별로 출력한다.
@ -66,10 +73,8 @@ $total_count = $row['cnt'];
} }
unset($save); // 임시 저장 배열 unset($save); // 임시 저장 배열
$sql = " select a.ca_id, $sql = " select a.ca_id, a.it_id $sql_common $sql_where order by a.ca_id, a.it_id desc ";
a.it_id echo $sql;
$sql_common
order by a.ca_id, a.it_id desc ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) { for ($i=0; $row=mysql_fetch_array($result); $i++) {
if ($save['ca_id'] != $row['ca_id']) { if ($save['ca_id'] != $row['ca_id']) {