Source for file LC_Page_Products_Review.php
Documentation is available at LC_Page_Products_Review.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 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_EX_REALDIR . 'page_extends/LC_Page_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id:LC_Page_Products_Review.php 15532 2007-08-31 14:39:46Z nanasess $
$masterData = new SC_DB_MasterData_Ex();
$this->arrRECOMMEND = $masterData->getMasterData("mtb_recommend");
$this->arrSex = $masterData->getMasterData("mtb_sex");
$this->tpl_mainpage = 'products/review.tpl';
$this->httpCacheControl('nocache');
$objFormParam = new SC_FormParam_Ex();
$objFormParam->setParam($_POST);
$objFormParam->convParam();
switch ($this->getMode()){
if (empty($this->arrErr)) {
$this->tpl_mainpage = 'products/review_confirm.tpl';
if (empty($this->arrErr)) {
SC_Response_Ex::sendRedirect('review_complete.php');
// 最初のproduct_idは、$_GETで渡ってくる。
$objFormParam->setParam($_GET);
$this->arrForm = $objFormParam->getHashArray();
if (empty($this->arrForm['name'])) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
$this->setTemplate($this->tpl_mainpage);
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
$objFormParam->addParam("レビューID", "review_id", INT_LEN, 'aKV');
$objFormParam->addParam("商品ID", "product_id", INT_LEN, 'n', array("NUM_CHECK","EXIST_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("投稿者名", "reviewer_name", STEXT_LEN, 'aKV', array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("投稿者URL", "reviewer_url", MTEXT_LEN, 'a', array("NO_SPTAB", "SPTAB_CHECK", "MAX_LENGTH_CHECK", "URL_CHECK"));
$objFormParam->addParam("性別", 'sex', INT_LEN, 'n', array("NUM_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("おすすめレベル", "recommend_level", INT_LEN, 'n', array("EXIST_CHECK", "SELECT_CHECK"));
$objFormParam->addParam("タイトル", 'title', STEXT_LEN, 'aKV', array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$objFormParam->addParam("コメント", 'comment', LTEXT_LEN, 'aKV', array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @return array エラーメッセージの配列
$arrErr = $objFormParam->checkError();
$arrForm = $objFormParam->getHashArray();
$objQuery = & SC_Query_Ex::getSingletonInstance();
$flag = $objQuery->count("dtb_review","product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
$arrErr['title'] .= "重複したタイトルは登録できません。";
if (REVIEW_ALLOW_URL == false) {
$objErr = new SC_CheckError_Ex($objFormParam->getHashArray());
$objErr->doFunc(array('URL', 'comment', $this->arrReviewDenyURL), array("PROHIBITED_STR_CHECK"));
$arrErr += $objErr->arrErr;
* @param integer $product_id 商品ID
* @return string $product_name 商品名
$objQuery = & SC_Query_Ex::getSingletonInstance();
return $objQuery->get('name', "dtb_products", "product_id = ? ", array($product_id));
$objQuery = & SC_Query_Ex::getSingletonInstance();
$arrRegist = $objFormParam->getDbArray();
$arrRegist['create_date'] = 'CURRENT_TIMESTAMP';
$arrRegist['update_date'] = 'CURRENT_TIMESTAMP';
$arrRegist['creator_id'] = '0';
$arrRegist['review_id'] = $objQuery->nextVal('dtb_review_review_id');
$objQuery->insert("dtb_review", $arrRegist);
Documentation generated on Fri, 24 Feb 2012 14:02:13 +0900 by Seasoft
|