Source for file LC_Page_Admin_Contents_Recommend.php
Documentation is available at LC_Page_Admin_Contents_Recommend.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 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.
$this->tpl_subnavi =
'contents/subnavi.tpl';
$this->tpl_subno =
"recommend";
$this->tpl_subtitle =
'おすすめ商品管理';
$arrRegistColumn =
array(
array( "column" =>
"product_id", "convert" =>
"n" ),
array( "column" =>
"category_id", "convert" =>
"n" ),
array( "column" =>
"rank", "convert" =>
"n" ),
array( "column" =>
"comment", "convert" =>
"aKV" ),
$this->tpl_disp_max =
RECOMMEND_NUM;
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if (!isset
($_POST['category_id'])) $_POST['category_id'] =
"";
if ( $_POST['mode'] ==
'regist' ){
$this->arrForm =
$this->lfConvertParam($this->arrForm, $arrRegistColumn);
$this->arrErr[$this->arrForm['rank']] =
$this->lfErrorCheck();
if ( ! $this->arrErr[$this->arrForm['rank']]) {
$sql =
"DELETE FROM dtb_best_products WHERE category_id = ? AND rank = ?";
$conn->query($sql, array($this->arrForm['category_id'] ,$this->arrForm['rank']));
$this->arrForm['creator_id'] =
$_SESSION['member_id'];
$this->arrForm['update_date'] =
"NOW()";
$this->arrForm['create_date'] =
"NOW()";
$objQuery->insert("dtb_best_products", $this->arrForm );
// $conn->autoExecute("dtb_best_products", $this->arrForm );
} elseif ( $_POST['mode'] ==
'delete' ){
$sql =
"DELETE FROM dtb_best_products WHERE category_id = ? AND rank = ?";
$conn->query($sql, array($_POST['category_id'] ,$_POST['rank']));
if ( SC_Utils_Ex::sfCheckNumLength($_POST['category_id']) ){
$this->category_id =
$_POST['category_id'];
$sql =
"SELECT B.name, B.main_list_image, A.* FROM dtb_best_products as A INNER JOIN dtb_products as B USING (product_id)
WHERE A.del_flg = 0 ORDER BY rank";
$arrItems =
$conn->getAll($sql);
foreach( $arrItems as $data ){
$this->arrItems[$data['rank']] =
$data;
// 商品変更時は、選択された商品に一時的に置き換える
if ( $_POST['mode'] ==
'set_item'){
$sql =
"SELECT product_id, name, main_list_image FROM dtb_products WHERE product_id = ? AND del_flg = 0";
$result =
$conn->getAll($sql, array($_POST['product_id']));
foreach( $data as $key=>
$val){
$this->arrItems[$_POST['rank']][$key] =
$val;
$this->arrItems[$_POST['rank']]['rank'] =
$_POST['rank'];
$this->checkRank =
$_POST['rank'];
$this->arrActive = isset
($arrActive) ?
$arrActive :
"";;
$this->arrQuestion = isset
($arrQuestion) ?
$arrQuestion :
"";
$this->arrCatList =
$objDb->sfGetCategoryList("level = 1");
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
foreach ($arrRegistColumn as $data) {
$arrConvList[ $data["column"] ] =
$data["convert"];
foreach ($arrConvList as $key =>
$val) {
$new_array[$key] = isset
($array[$key]) ?
$array[$key] :
"";
$objErr->doFunc(array("コメント", "comment", LTEXT_LEN), array("EXIST_CHECK","MAX_LENGTH_CHECK"));
Documentation generated on Tue, 28 Apr 2009 18:10:59 +0900 by phpDocumentor 1.4.2