Source for file LC_Page_Shopping_Payment.php
Documentation is available at LC_Page_Shopping_Payment.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_Shopping_Payment.php 15532 2007-08-31 14:39:46Z nanasess $
$objSiteInfo =
$objView->objSiteInfo;
$arrInfo =
$objSiteInfo->data;
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid =
SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid =
$uniqid;
$this->tpl_user_point =
$this->objCustomer->getValue('point');
$this->tpl_back_url =
URL_DELIV_TOP;
$this->tpl_back_url =
URL_SHOP_TOP .
"?from=nonmember";
// 金額の取得 (購入途中で売り切れた場合にはこの関数内にてその商品の数量が0になる)
$objDb->sfTotalCart($this, $objCartSess, $arrInfo);
if (empty($arrData)) $arrData =
array();
$this->arrData =
$objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo);
$objCartSess->chkSoldOut($objCartSess->getCartList());
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
$this->arrErr =
$this->lfCheckError($this->arrData, $arrInfo, $objCartSess);
if(count($this->arrErr) ==
0) {
$objSiteSess->setRegistFlag();
$uniqid =
$objSiteSess->getUniqId();
$objSiteSess->setRegistFlag();
// ここのbreakは、意味があるので外さないで下さい。
$arrInfo =
$objSiteInfo->data;
$total_pretax =
$objCartSess->getAllProductsTotal($arrInfo);
$arrRet =
$objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
$this->arrDelivTime =
SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
$objView->assignobj($this);
// フレームを選択(キャンペーンページから遷移なら変更)
$objCampaignSess->pageView($objView);
$objSiteInfo =
$objView->objSiteInfo;
$arrInfo =
$objSiteInfo->data;
// ユーザユニークIDの取得と購入状態の正当性をチェック
$uniqid =
SC_Utils_Ex::sfCheckNormalAccess($objSiteSess, $objCartSess);
$this->tpl_uniqid =
$uniqid;
$this->tpl_user_point =
$this->objCustomer->getValue('point');
// 金額の取得 (購入途中で売り切れた場合にはこの関数内にてその商品の数量が0になる)
$objDb->sfTotalCart($this, $objCartSess, $arrInfo);
if (empty($arrData)) $arrData =
array();
$this->arrData =
$objDb->sfTotalConfirm($arrData, $this, $objCartSess, $arrInfo);
$objCartSess->chkSoldOut($objCartSess->getCartList(), true);
if (!isset
($_POST['mode'])) $_POST['mode'] =
"";
if (!empty($_POST['return'])) {
switch ($_POST['mode']) {
$_POST['mode'] =
'payment';
$objSiteSess->setRegistFlag();
$this->arrErr =
$this->lfCheckError($this->arrData, $arrInfo, $objCartSess);
if (!isset
($this->arrErr['payment_id'])) {
$uniqid =
$objSiteSess->getUniqId();
$this->arrErr =
$this->lfCheckError($this->arrData, $arrInfo, $objCartSess);
if(count($this->arrErr) ==
0) {
$objSiteSess->setRegistFlag();
$uniqid =
$objSiteSess->getUniqId();
if (!isset
($this->arrErr['payment_id'])) {
$objSiteSess->setRegistFlag();
// ここのbreakは、意味があるので外さないで下さい。
$arrInfo =
$objSiteInfo->data;
$total_pretax =
$objCartSess->getAllProductsTotal($arrInfo);
$arrRet =
$objDb->sfGetDelivTime($this->objFormParam->getValue('payment_id'));
$this->arrDelivTime =
SC_Utils_Ex::sfArrKeyValue($arrRet, 'time_id', 'deliv_time');
$objView->assignobj($this);
$objView->display(SITE_FRAME);
$this->objFormParam->addParam("お支払い方法", "payment_id", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("ポイント", "use_point", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK", "ZERO_START"));
$this->objFormParam->addParam("配達時間", "deliv_time_id", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
$this->objFormParam->addParam("ご質問", "message", LTEXT_LEN, "KVa", array("SPTAB_CHECK", "MAX_LENGTH_CHECK"));
$this->objFormParam->addParam("ポイントを使用する", "point_check", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"), '2');
$this->objFormParam->addParam("配達日", "deliv_date", STEXT_LEN, "KVa", array("MAX_LENGTH_CHECK"));
$objQuery->setorder("rank DESC");
$arrRet =
$objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) ");
foreach($arrRet as $data) {
if (strlen($data['rule']) !=
0 &&
strlen($data['upper_rule']) !=
0) {
if ($data['rule'] <=
$total_pretax &&
$data['upper_rule'] >=
$total_pretax) {
elseif (strlen($data['rule']) !=
0) {
if($data['rule'] <=
$total_pretax) {
elseif (strlen($data['upper_rule']) !=
0) {
if($data['upper_rule'] >=
$total_pretax) {
if (USE_POINT ===
false) {
$_POST['point_check'] =
"";
$_POST['use_point'] =
"0";
if (!isset
($_POST['point_check'])) $_POST['point_check'] =
"";
if($_POST['point_check'] ==
'1') {
$objErr->doFunc(array("ポイントを使用する", "point_check"), array("EXIST_CHECK"));
$objErr->doFunc(array("ポイント", "use_point"), array("EXIST_CHECK"));
// FIXME mobile 互換のため br は閉じない...
if($arrRet['use_point'] >
$max_point) {
$objErr->arrErr['use_point'] =
"※ ご利用ポイントが所持ポイントを超えています。<br>";
if(($arrRet['use_point'] *
POINT_VALUE) >
$arrData['subtotal']) {
$objErr->arrErr['use_point'] =
"※ ご利用ポイントがご購入金額を超えています。<br>";
$total_pretax =
$objCartSess->getAllProductsTotal($arrInfo);
foreach ($arrPayment as $key =>
$payment) {
if ($payment['payment_id'] ==
$arrRet['payment_id']) {
if ($pay_flag &&
$arrRet['payment_id'] !=
"") {
$where =
"payment_id = ?";
$arrRet =
$objQuery->select("payment_method, charge", "dtb_payment", $where, array($payment_id));
return (array($arrRet[0]['payment_method'], $arrRet[0]['charge']));
$arrRet =
$objQuery->select("deliv_id, deliv_time", "dtb_delivtime", $where, array($time_id));
return (array($arrRet[0]['deliv_id'], $arrRet[0]['deliv_time']));
$sqlval['order_temp_id'] =
$uniqid;
$sqlval['update_date'] =
'Now()';
if($sqlval['payment_id'] !=
"") {
list
($sqlval['payment_method'], $sqlval['charge']) =
$this->lfGetPaymentInfo($sqlval['payment_id']);
$sqlval['payment_id'] =
'0';
$sqlval['payment_method'] =
"";
if($sqlval['deliv_time_id'] !=
"") {
list
($sqlval['deliv_id'], $sqlval['deliv_time']) =
$this->lfGetDelivTimeInfo($sqlval['deliv_time_id']);
$sqlval['deliv_time_id'] =
'0';
$sqlval['deliv_id'] =
'0';
$sqlval['deliv_time'] =
"";
if($sqlval['point_check'] !=
'1') {
$sqlval['use_point'] =
0;
$objDb->sfRegistTempOrder($uniqid, $sqlval);
$max =
$objCartSess->getMax();
for($i =
1; $i <=
$max; $i++
) {
if($_SESSION[$objCartSess->key][$i]['id'][0] !=
"") {
$arrID['product_id'][$i] =
$_SESSION[$objCartSess->key][$i]['id'][0];
if(count($arrID['product_id']) >
0) {
$id =
implode(",", $arrID['product_id']);
$deliv_date =
$objQuery->get("dtb_products", "MAX(deliv_date_id)", "product_id IN (".
$id.
")");
//配達可能日のスタート値から、配達日の配列を取得する
$arrDelivDate =
$this->lfGetDateArray($start_day, DELIV_DATE_END_MAX);
//配達可能日のスタート値から、配達日の配列を取得する
$arrWDAY =
$masterData->getMasterData("mtb_wday");
$max_day =
$start_day +
$end_day;
for ($i =
$start_day; $i <
$max_day; $i++
) {
$tmp_time =
$now_time +
($i *
24 *
3600);
list
($y, $m, $d, $w) =
split(" ", date("y m d w", $tmp_time));
$val =
sprintf("%02d/%02d/%02d(%s)", $y, $m, $d, $arrWDAY[$w]);
$col =
"payment_id, use_point, deliv_time_id, message, point_check, deliv_date";
$from =
"dtb_order_temp";
$where =
"order_temp_id = ?";
$arrRet =
$objQuery->select($col, $from, $where, array($uniqid));
Documentation generated on Tue, 28 Apr 2009 18:12:59 +0900 by phpDocumentor 1.4.2