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-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.
* @version $Id:LC_Page_Products_Review.php 15532 2007-08-31 14:39:46Z nanasess $
$this->arrRECOMMEND =
$masterData->getMasterData("mtb_recommend");
$this->arrSex =
$masterData->getMasterData("mtb_sex");
if ($_SERVER["REQUEST_METHOD"] ==
"POST") {
$arrRegistColumn =
array(
array( "column" =>
"review_id", "convert" =>
"aKV" ),
array( "column" =>
"product_id", "convert" =>
"aKV" ),
array( "column" =>
"reviewer_name", "convert" =>
"aKV" ),
array( "column" =>
"reviewer_url", "convert" =>
"a"),
array( "column" =>
"sex", "convert" =>
"n" ),
array( "column" =>
"email", "convert" =>
"a" ),
array( "column" =>
"recommend_level", "convert" =>
"n" ),
array( "column" =>
"title", "convert" =>
"aKV" ),
array( "column" =>
"comment", "convert" =>
"aKV" ),
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
$flag =
$objQuery->count("dtb_review","product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
$this->arrErr['title'] .=
"重複したタイトルは登録できません。";
$arrForm['name'] =
$objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
$this->arrForm =
$arrForm;
$arrForm['name'] =
$objQuery->get("dtb_products", "name", "product_id = ? ", array($arrForm['product_id']));
$this->arrForm =
$arrForm;
foreach($_POST as $key =>
$val){
$this->arrForm[ $key ] =
$val;
$this->arrForm['name'] =
$objQuery->get("dtb_products", "name", "product_id = ? ", array($this->arrForm['product_id']));
if(empty($this->arrForm['name'])) {
$flag =
$objQuery->count("dtb_review","product_id = ? AND title = ? ", array($arrForm['product_id'], $arrForm['title']));
$arrForm =
$objQuery->select("product_id, name", "dtb_products", "del_flg = 0 AND status = 1 AND product_id=?", array($_GET['product_id']));
$this->arrForm =
$arrForm[0];
$objView->assignobj($this);
$objErr->doFunc(array("商品ID", "product_id", INT_LEN), array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
$objErr->doFunc(array("投稿者名", "reviewer_name", STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$objErr->doFunc(array("URL", "reviewer_url", MTEXT_LEN), array("NO_SPTAB", "SPTAB_CHECK", "MAX_LENGTH_CHECK", "URL_CHECK"));
$objErr->doFunc(array("おすすめレベル", "recommend_level"), array("SELECT_CHECK"));
$objErr->doFunc(array("タイトル", "title", STEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$objErr->doFunc(array("コメント", "comment", LTEXT_LEN), array("EXIST_CHECK", "SPTAB_CHECK", "MAX_LENGTH_CHECK"));
if (REVIEW_ALLOW_URL ==
false) {
$objErr->doFunc(array("URL", "comment", $this->arrReviewDenyURL), array("PROHIBITED_STR_CHECK"));
* K : 「半角(ハンカク)片仮名」を「全角片仮名」に変換
* C : 「全角ひら仮名」を「全角かた仮名」に変換
* V : 濁点付きの文字を一文字に変換。"K","H"と共に使用します
* n : 「全角」数字を「半角(ハンカク)」に変換
foreach ($arrRegistColumn as $data) {
$arrConvList[ $data["column"] ] =
$data["convert"];
foreach ($arrConvList as $key =>
$val) {
if(!empty($array[$key])) {
foreach ($arrRegistColumn as $data) {
if (strlen($array[ $data["column"] ]) >
0 ) {
$arrRegist[ $data["column"] ] =
$array[ $data["column"] ];
$arrRegist['create_date'] =
'now()';
$arrRegist['update_date'] =
'now()';
$arrRegist['creator_id'] =
'0';
$objQuery->insert("dtb_review", $arrRegist);
Documentation generated on Tue, 28 Apr 2009 18:12:45 +0900 by phpDocumentor 1.4.2