source: branches/eccube-donation/html/frontparts/bloc/thank_you.php @ 20674

Revision 20674, 3.8 KB checked in by tao, 10 years ago (diff)

#refs 寄付ポイント数上限設定機能、現在の寄付状況表示ブロック、csvファイルのファイルロックを追加。

Line 
1<style type="text/css">
2div#thankyou{border: none;background: #E0ECEF;text-align: center;overflow: auto;margin:12px auto;}
3div#thankyou div#innner{margin:8px;}
4div#thankyou div#innner h2{margin:12px;font-size:18px;text-shadow: -1px -1px 0px #FFF;font-weight: bold;}
5div#thankyou div#innner p{margin:2px 4px;font-size:90%;}
6div#thankyou div#innner dl{margin:12px auto;padding:0;line-height: 1.4em;width:14em;}
7div#thankyou div#innner dl dt{width: 3em;font-weight: bold;color:#666;}
8div#thankyou div#innner dl dd{margin-left: 4em; margin-top:-1.4em;font-weight: bold;}
9</style>
10<?php
11/*
12 * This file is part of EC-CUBE
13 *
14 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
15 *
16 * http://www.lockon.co.jp/
17 *
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
22 *
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 * GNU General Public License for more details.
27 *
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31 *
32 * 2011-03-17 Tao Sasaki (tao@xross-cube.com)
33 *
34 */
35
36// {{{ requires
37if( !defined("CLASS_PATH") ){
38    require_once("../../require.php");
39}
40require_once(CLASS_PATH . "pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php");
41
42// }}}
43// {{{ generate page
44class LC_Page_FrontParts_Bloc_ThankYou extends LC_Page_FrontParts_Bloc {
45
46    // }}}
47    // {{{ functions
48
49    /**
50     * Page を初期化する.
51     *
52     * @return void
53     */
54    function init() {
55        parent::init();
56        $this->tpl_login = false;
57        $this->tpl_disable_logout = false;
58        $this->tpl_error = "";
59    }
60
61    /**
62     * Page のプロセス.
63     *
64     * @return void
65     */
66    function process() {
67        if(!file_exists(DATA_PATH.'downloads/donation_summary.csv')){
68            $objQuery = new SC_Query;
69            $ret = $objQuery->getOne("SELECT php_path FROM dtb_bloc WHERE php_path = 'frontparts/bloc/thank_you.php'");
70            if(!$ret){
71                $objQuery->query("INSERT INTO dtb_bloc (bloc_name,tpl_path,filename,create_date,update_date,php_path,del_flg)
72                 VALUES('東北地方太平洋沖地震ポイント寄付状況','','thank_you',NOW(),NOW(),'frontparts/bloc/thank_you.php',0)");
73                 if($fp = fopen(DATA_PATH.'downloads/donation_summary.csv','a+')){
74                    fwrite($fp,'0,0,0');
75                    fclose($fp);
76                 }
77            }
78        }
79       
80        //現在の寄付データ取得
81        $summary = file_get_contents(DATA_PATH.'downloads/donation_summary.csv');
82        $this->summary = explode(",",$summary);
83    }
84
85    /**
86     * デストラクタ.
87     *
88     * @return void
89     */
90    function destroy() {
91        parent::destroy();
92    }
93}
94
95$objPage = new LC_Page_FrontParts_Bloc_ThankYou();
96register_shutdown_function(array($objPage, "destroy"));
97$objPage->init();
98$objPage->process();
99
100?>
101<div id="thankyou">
102    <div id="innner">
103        <h2>現在のポイント寄付状況</h2>
104        <p>ご協力ありがとうございます。<br />現在、皆様からお寄せ頂いた東北地方太平洋沖地震へのポイント寄付は以下の通りです。</p>
105        <dl>
106            <dt>件数:</dt>
107            <dd><?php echo number_format($objPage->summary[0]); ?>件</dd>
108            <dt>合計:</dt>
109            <dd><?php echo number_format($objPage->summary[1]); ?>pt</dd>
110        </dl>
111    </div>
112</div>
113
Note: See TracBrowser for help on using the repository browser.