Source for file LC_Page_Admin_Contents_RecommendSearch.php
Documentation is available at LC_Page_Admin_Contents_RecommendSearch.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
$objDb = new SC_Helper_DB_Ex();
SC_Utils_Ex::sfIsSuccess($objSess);
if (!isset ($_POST['mode'])) $_POST['mode'] = "";
if ($_POST['mode'] == "search") {
$where = "del_flg = 0 AND status = 1";
foreach ($this->arrForm as $key => $val) {
$where .= " AND name ILIKE ?";
case 'search_category_id':
list ($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($val);
$where.= " AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE " . $tmp_where . ")";
$arrval = array_merge((array) $arrval, (array) $tmp_arrval);
case 'search_product_code':
$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ? GROUP BY product_id)";
$order = "update_date DESC, product_id DESC";
$col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
$from = "vw_products_nonclass AS noncls ";
if (empty($arrval)) $arrval = array();
$linemax = $objQuery->count("dtb_products", $where, $arrval);
$this->tpl_linemax = $linemax; // 何件が該当しました。表示用
if(isset ($_POST['search_page_max'])
$page_max = $_POST['search_page_max'];
$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchOnlyPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi; // 表示文字列
$startno = $objNavi->start_row;
$objQuery->setLimitOffset($page_max, $startno);
$objQuery->setOrder($order);
$this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
$this->arrCatList = $objDb->sfGetCategoryList();
$objView->assignobj($this);
* K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換
* C : 「全角ひら仮名」を「全角かた仮名」に変換
* V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します
* n : 「全角」数字を「半角(ハンカク)」に変換
$arrConvList['search_name'] = "KVa";
$arrConvList['search_product_code'] = "KVa";
foreach ($arrConvList as $key => $val) {
if(isset ($this->arrForm[$key])) {
$this->arrForm[$key] = mb_convert_kana($this->arrForm[$key] ,$val);
Documentation generated on Fri, 24 Feb 2012 13:58:37 +0900 by Seasoft
|