1 | <?php |
---|
2 | /* |
---|
3 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
4 | * |
---|
5 | * http://www.lockon.co.jp/ |
---|
6 | */ |
---|
7 | |
---|
8 | // {{{ requires |
---|
9 | require_once(CLASS_PATH . "pages/LC_Page.php"); |
---|
10 | |
---|
11 | /** |
---|
12 | * ご利用規約 のページクラス. |
---|
13 | * |
---|
14 | * @package Page |
---|
15 | * @author LOCKON CO.,LTD. |
---|
16 | * @version $Id$ |
---|
17 | */ |
---|
18 | class LC_Page_Entry_Kiyaku extends LC_Page { |
---|
19 | |
---|
20 | // }}} |
---|
21 | // {{{ functions |
---|
22 | |
---|
23 | /** |
---|
24 | * Page を初期化する. |
---|
25 | * |
---|
26 | * @return void |
---|
27 | */ |
---|
28 | function init() { |
---|
29 | parent::init(); |
---|
30 | $this->tpl_mainpage = 'entry/kiyaku.tpl'; |
---|
31 | $this->tpl_title = "ご利用規約"; |
---|
32 | } |
---|
33 | |
---|
34 | /** |
---|
35 | * Page のプロセス. |
---|
36 | * |
---|
37 | * @return void |
---|
38 | */ |
---|
39 | function process() { |
---|
40 | $objView = new SC_SiteView(); |
---|
41 | $objCustomer = new SC_Customer(); |
---|
42 | $objCampaignSess = new SC_CampaignSession(); |
---|
43 | |
---|
44 | // レイアウトデザインを取得 |
---|
45 | $layout = new SC_Helper_PageLayout_Ex(); |
---|
46 | $layout->sfGetPageLayout($this, false, DEF_LAYOUT); |
---|
47 | |
---|
48 | // 規約内容の取得 |
---|
49 | $objQuery = new SC_Query(); |
---|
50 | $objQuery->setorder("rank DESC"); |
---|
51 | $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1"); |
---|
52 | |
---|
53 | $max = count($arrRet); |
---|
54 | $this->tpl_kiyaku_text = ""; |
---|
55 | for ($i = 0; $i < $max; $i++) { |
---|
56 | $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n"; |
---|
57 | $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n"; |
---|
58 | } |
---|
59 | |
---|
60 | // キャンペーンからの遷移がチェック |
---|
61 | $this->is_campaign = $objCampaignSess->getIsCampaign(); |
---|
62 | $this->campaign_dir = $objCampaignSess->getCampaignDir(); |
---|
63 | |
---|
64 | $objView->assignobj($this); |
---|
65 | // フレームを選択(キャンペーンページから遷移なら変更) |
---|
66 | $objCampaignSess->pageView($objView); |
---|
67 | } |
---|
68 | |
---|
69 | /** |
---|
70 | * モバイルページを初期化する. |
---|
71 | * |
---|
72 | * @return void |
---|
73 | */ |
---|
74 | function mobileInit() { |
---|
75 | $this->init(); |
---|
76 | } |
---|
77 | |
---|
78 | /** |
---|
79 | * Page のプロセス(モバイル). |
---|
80 | * |
---|
81 | * @return void |
---|
82 | */ |
---|
83 | function mobileProcess() { |
---|
84 | $objView = new SC_MobileView(); |
---|
85 | $objCustomer = new SC_Customer(); |
---|
86 | |
---|
87 | $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; |
---|
88 | $next = $offset; |
---|
89 | |
---|
90 | // レイアウトデザインを取得 |
---|
91 | $objLayout = new SC_Helper_PageLayout_Ex(); |
---|
92 | $objLayout->sfGetPageLayout($this, false, DEF_LAYOUT); |
---|
93 | |
---|
94 | // 規約内容の取得 |
---|
95 | $objQuery = new SC_Query(); |
---|
96 | $count = $objQuery->count("dtb_kiyaku", "del_flg <> 1"); |
---|
97 | $objQuery->setorder("rank DESC"); |
---|
98 | $objQuery->setlimitoffset(1, $offset); |
---|
99 | $arrRet = $objQuery->select("kiyaku_title, kiyaku_text", "dtb_kiyaku", "del_flg <> 1"); |
---|
100 | |
---|
101 | if($count > $offset + 1){ |
---|
102 | $next++; |
---|
103 | } else { |
---|
104 | $next = -1; |
---|
105 | } |
---|
106 | |
---|
107 | $max = count($arrRet); |
---|
108 | $this->tpl_kiyaku_text = ""; |
---|
109 | for ($i = 0; $i < $max; $i++) { |
---|
110 | $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_title'] . "\n\n"; |
---|
111 | $this->tpl_kiyaku_text.=$arrRet[$i]['kiyaku_text'] . "\n\n"; |
---|
112 | } |
---|
113 | |
---|
114 | $objView->assign("offset", $next); |
---|
115 | $objView->assignobj($this); |
---|
116 | $objView->display(SITE_FRAME); |
---|
117 | } |
---|
118 | |
---|
119 | /** |
---|
120 | * デストラクタ. |
---|
121 | * |
---|
122 | * @return void |
---|
123 | */ |
---|
124 | function destroy() { |
---|
125 | parent::destroy(); |
---|
126 | } |
---|
127 | } |
---|
128 | ?> |
---|