source: branches/camp/camp-2_5-E/data/class/pages/entry/LC_Page_Entry_Kiyaku.php @ 19124

Revision 19124, 3.8 KB checked in by Yammy, 12 years ago (diff)

新process()対応

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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// {{{ requires
25require_once(CLASS_PATH . "pages/LC_Page.php");
26
27/**
28 * ご利用規約 のページクラス.
29 *
30 * @package Page
31 * @author LOCKON CO.,LTD.
32 * @version $Id$
33 */
34class LC_Page_Entry_Kiyaku extends LC_Page {
35
36    // }}}
37    // {{{ functions
38
39    /**
40     * Page を初期化する.
41     *
42     * @return void
43     */
44    function init() {
45        parent::init();
46        $this->tpl_mainpage = 'entry/kiyaku.tpl';
47        $this->tpl_title = "ご利用規約";
48    }
49
50    /**
51     * Page のプロセス.
52     *
53     * @return void
54     */
55    function process() {
56        $this->action();
57        $this->sendResponse();
58    }
59
60    /**
61     * Page のアクション.
62     *
63     * @return void
64     */
65    function action() {
66        $objCustomer = new SC_Customer();
67
68        // レイアウトデザインを取得
69        $layout = new SC_Helper_PageLayout_Ex();
70        $layout->sfGetPageLayout($this, false, DEF_LAYOUT);
71
72        // 規約内容の取得
73        $objQuery = new SC_Query();
74        $objQuery->setOrder("rank DESC");
75        $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1");
76
77        $max = count($arrRet);
78        $this->tpl_kiyaku_text = "";
79        for ($i = 0; $i < $max; $i++) {
80            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n";
81            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n";
82        }
83    }
84
85    /**
86     * モバイルページを初期化する.
87     *
88     * @return void
89     */
90    function mobileInit() {
91        $this->init();
92    }
93
94    /**
95     * Page のプロセス(モバイル).
96     *
97     * @return void
98     */
99    function mobileProcess() {
100        $this->mobilAection();
101        $this->sendResponse();
102    }
103
104    /**
105     * Page のアクション(モバイル).
106     *
107     * @return void
108     */
109    function mobileAction() {
110        $objCustomer = new SC_Customer();
111
112        $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
113        $next = $offset;
114
115        // レイアウトデザインを取得
116        $objLayout = new SC_Helper_PageLayout_Ex();
117        $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT);
118
119        // 規約内容の取得
120        $objQuery = new SC_Query();
121        $count = $objQuery->count("dtb_kiyaku", "del_flg <> 1");
122        $objQuery->setOrder("rank DESC");
123        $objQuery->setLimitOffset(1, $offset);
124        $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1");
125
126        if($count > $offset + 1){
127            $next++;
128        } else {
129            $next = -1;
130        }
131
132        $max = count($arrRet);
133        $this->tpl_kiyaku_text = "";
134        for ($i = 0; $i < $max; $i++) {
135            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n";
136            $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n";
137        }
138    }
139
140    /**
141     * デストラクタ.
142     *
143     * @return void
144     */
145    function destroy() {
146        parent::destroy();
147    }
148}
149?>
Note: See TracBrowser for help on using the repository browser.