source: branches/feature-module-update/data/class/pages/mypage/LC_Page_Mypage.php @ 16066

Revision 16066, 3.6 KB checked in by nanasess, 17 years ago (diff)

クラス化に伴う修正

  • 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
Line 
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
9require_once(CLASS_PATH . "pages/LC_Page.php");
10
11/**
12 * MyPage のページクラス.
13 *
14 * @package Page
15 * @author LOCKON CO.,LTD.
16 * @version $Id$
17 */
18class LC_Page_MyPage extends LC_Page {
19
20    // {{{ properties
21
22    /** ページナンバー */
23    var $tpl_pageno;
24
25    // }}}
26    // {{{ functions
27
28    /**
29     * Page を初期化する.
30     *
31     * @return void
32     */
33    function init() {
34        parent::init();
35        $this->tpl_mainpage = TEMPLATE_DIR .'mypage/index.tpl';
36        $this->tpl_title = 'MYページ/購入履歴一覧';
37        $this->tpl_navi = TEMPLATE_DIR . 'mypage/navi.tpl';
38        $this->tpl_column_num = 1;
39        $this->tpl_mainno = 'mypage';
40        $this->tpl_mypageno = 'index';
41        $this->allowClientCache();
42    }
43
44    /**
45     * Page のプロセス.
46     *
47     * @return void
48     */
49    function process() {
50
51        $objView = new SC_SiteView();
52        $objQuery = new SC_Query();
53        $objCustomer = new SC_Customer();
54
55        // レイアウトデザインを取得
56        $objLayout = new SC_Helper_PageLayout_Ex();
57        $objLayout->sfGetPageLayout($this, false, "mypage/index.php");
58
59        // ログインチェック
60        if(!isset($_SESSION['customer'])) {
61            SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
62        }else {
63            //マイページトップ顧客情報表示用
64            $this->CustomerName1 = $objCustomer->getvalue('name01');
65            $this->CustomerName2 = $objCustomer->getvalue('name02');
66            $this->CustomerPoint = $objCustomer->getvalue('point');
67        }
68
69        //ページ送り用
70        if (isset($_POST['pageno'])) {
71            $this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
72        }
73
74        $col = "order_id, create_date, payment_id, payment_total";
75        $from = "dtb_order";
76        $where = "del_flg = 0 AND customer_id=?";
77        $arrval = array($objCustomer->getvalue('customer_id'));
78        $order = "order_id DESC";
79
80        $linemax = $objQuery->count($from, $where, $arrval);
81        $this->tpl_linemax = $linemax;
82
83        // ページ送りの取得
84        $objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
85        $this->tpl_strnavi = $objNavi->strnavi;     // 表示文字列
86        $startno = $objNavi->start_row;
87
88        // 取得範囲の指定(開始行番号、行数のセット)
89        $objQuery->setlimitoffset(SEARCH_PMAX, $startno);
90        // 表示順序
91        $objQuery->setorder($order);
92
93        //購入履歴の取得
94        $this->arrOrder = $objQuery->select($col, $from, $where, $arrval);
95
96        // 支払い方法の取得
97        $objDb = new SC_Helper_DB_Ex();
98        $this->arrPayment = $objDb->sfGetIDValueList("dtb_payment", "payment_id", "payment_method");
99
100        $objView->assignobj($this);             //$objpage内の全てのテンプレート変数をsmartyに格納
101        $objView->display(SITE_FRAME);              //パスとテンプレート変数の呼び出し、実行
102    }
103
104    /**
105     * デストラクタ.
106     *
107     * @return void
108     */
109    function destroy() {
110        parent::destroy();
111    }
112
113    //エラーチェック
114
115    function lfErrorCheck() {
116        $objErr = new SC_CheckError();
117        $objErr->doFunc(array("メールアドレス", "login_email", STEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","EMAIL_CHECK","MAX_LENGTH_CHECK"));
118        $objErr->dofunc(array("パスワード", "login_password", PASSWORD_LEN2), array("EXIST_CHECK","ALNUM_CHECK"));
119        return $objErr->arrErr;
120    }
121}
122?>
Note: See TracBrowser for help on using the repository browser.