| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * This file is part of EC-CUBE |
|---|
| 4 | * |
|---|
| 5 | * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved. |
|---|
| 6 | * |
|---|
| 7 | * http://www.lockon.co.jp/ |
|---|
| 8 | * |
|---|
| 9 | * This program is free software; you can redistribute it and/or |
|---|
| 10 | * modify it under the terms of the GNU General Public License |
|---|
| 11 | * as published by the Free Software Foundation; either version 2 |
|---|
| 12 | * of the License, or (at your option) any later version. |
|---|
| 13 | * |
|---|
| 14 | * This program is distributed in the hope that it will be useful, |
|---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | * GNU General Public License for more details. |
|---|
| 18 | * |
|---|
| 19 | * You should have received a copy of the GNU General Public License |
|---|
| 20 | * along with this program; if not, write to the Free Software |
|---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 22 | */ |
|---|
| 23 | |
|---|
| 24 | require_once("../require.php"); |
|---|
| 25 | |
|---|
| 26 | class LC_Page { |
|---|
| 27 | function LC_Page() { |
|---|
| 28 | $this->tpl_mainpage = 'shopping/loan.tpl'; |
|---|
| 29 | $this->tpl_css = URL_DIR.'css/layout/shopping/pay.css'; |
|---|
| 30 | // ホームアドレス |
|---|
| 31 | $this->tpl_homeaddr = CF_HOMEADDR; |
|---|
| 32 | // シュミレーション呼び出し |
|---|
| 33 | $this->tpl_simulate = CF_SIMULATE; |
|---|
| 34 | // 加盟店コード |
|---|
| 35 | $this->tpl_storecode = CF_STORECODE; |
|---|
| 36 | // 戻り先 |
|---|
| 37 | $this->tpl_returnurl = CF_RETURNURL; |
|---|
| 38 | // 呼び出し区分(0:シュミレーションのみ、1:シュミレーション+申込) |
|---|
| 39 | $this->tpl_continue = CF_CONTINUE; |
|---|
| 40 | // 役務有無区分(0:無、1:有) |
|---|
| 41 | $this->tpl_labor = CF_LABOR; |
|---|
| 42 | // 結果応答(1:結果あり、2:結果なし) |
|---|
| 43 | $this->tpl_result = CF_RESULT; |
|---|
| 44 | // キャンセルURL |
|---|
| 45 | $this->tpl_cancelurl = CF_CANCELURL; |
|---|
| 46 | |
|---|
| 47 | /* |
|---|
| 48 | session_start時のno-cacheヘッダーを抑制することで |
|---|
| 49 | 「戻る」ボタン使用時の有効期限切れ表示を抑制する。 |
|---|
| 50 | private-no-expire:クライアントのキャッシュを許可する。 |
|---|
| 51 | */ |
|---|
| 52 | session_cache_limiter('private-no-expire'); |
|---|
| 53 | } |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | $objPage = new LC_Page(); |
|---|
| 57 | $objView = new SC_SiteView(); |
|---|
| 58 | $objSiteSess = new SC_SiteSession(); |
|---|
| 59 | $objCartSess = new SC_CartSession(); |
|---|
| 60 | $objCampaignSess = new SC_CampaignSession(); |
|---|
| 61 | $objCustomer = new SC_Customer(); |
|---|
| 62 | $objSiteInfo = $objView->objSiteInfo; |
|---|
| 63 | $arrInfo = $objSiteInfo->data; |
|---|
| 64 | |
|---|
| 65 | // 注文一時IDの取得 |
|---|
| 66 | $uniqid = $objSiteSess->getUniqId(); |
|---|
| 67 | |
|---|
| 68 | // ローン決済の戻り値をチェックする。 |
|---|
| 69 | if($_GET['tranno'] == $uniqid) { |
|---|
| 70 | // ローン決済受付番号をDBに書き込む |
|---|
| 71 | $sqlval['loan_result'] = $_GET['receiptno']; |
|---|
| 72 | $objQuery = new SC_Query(); |
|---|
| 73 | $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid)); |
|---|
| 74 | |
|---|
| 75 | $objPage->tpl_message = "ショッピングローンの手続きは、キャンセルされました。"; |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | switch($_POST['mode']) { |
|---|
| 79 | // 前のページに戻る |
|---|
| 80 | case 'return': |
|---|
| 81 | // 正常な推移であることを記録しておく |
|---|
| 82 | $objSiteSess->setRegistFlag(); |
|---|
| 83 | header("Location: " . URL_SHOP_CONFIRM); |
|---|
| 84 | exit; |
|---|
| 85 | break; |
|---|
| 86 | default: |
|---|
| 87 | break; |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | // カート集計処理 |
|---|
| 91 | $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); |
|---|
| 92 | // 一時受注テーブルの読込 |
|---|
| 93 | $arrData = sfGetOrderTemp($uniqid); |
|---|
| 94 | // カート集計を元に最終計算 |
|---|
| 95 | $arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo); |
|---|
| 96 | |
|---|
| 97 | // 支払い総額 |
|---|
| 98 | $objPage->tpl_amount = $arrData['payment_total']; |
|---|
| 99 | // 受注仮番号 |
|---|
| 100 | $objPage->tpl_tranno = $uniqid; |
|---|
| 101 | // 基本情報を渡す |
|---|
| 102 | $objPage->arrInfo = $arrInfo; |
|---|
| 103 | |
|---|
| 104 | $objView->assignobj($objPage); |
|---|
| 105 | // フレームを選択(キャンペーンページから遷移なら変更) |
|---|
| 106 | $objCampaignSess->pageView($objView); |
|---|
| 107 | //-------------------------------------------------------------------------------------------------------------------------- |
|---|
| 108 | ?> |
|---|