1 | <?php |
---|
2 | /* |
---|
3 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved. |
---|
4 | * |
---|
5 | * http://www.lockon.co.jp/ |
---|
6 | */ |
---|
7 | |
---|
8 | //データベースから商品検索を実行する。(ECキット動作試験用の開発) |
---|
9 | require_once("../require.php"); |
---|
10 | |
---|
11 | class LC_Page{ |
---|
12 | function LC_Page() { |
---|
13 | $this->tpl_mainpage = USER_PATH . 'templates/mypage/index.tpl'; |
---|
14 | $this->tpl_title = 'MYページ/購入履歴一覧'; |
---|
15 | $this->tpl_navi = USER_PATH . 'templates/mypage/navi.tpl'; |
---|
16 | $this->tpl_mainno = 'mypage'; |
---|
17 | $this->tpl_mypageno = 'index'; |
---|
18 | session_cache_limiter('private-no-expire'); |
---|
19 | } |
---|
20 | } |
---|
21 | |
---|
22 | $objPage = new LC_Page(); |
---|
23 | $objView = new SC_SiteView(); |
---|
24 | $objQuery = new SC_Query(); |
---|
25 | $objCustomer = new SC_Customer(); |
---|
26 | |
---|
27 | // レイアウトデザインを取得 |
---|
28 | $objPage = sfGetPageLayout($objPage, false, "mypage/index.php"); |
---|
29 | |
---|
30 | // ログインチェック |
---|
31 | if(!isset($_SESSION['customer'])) { |
---|
32 | sfDispSiteError(CUSTOMER_ERROR); |
---|
33 | }else { |
---|
34 | //マイページトップ顧客情報表示用 |
---|
35 | $objPage->CustomerName1 = $objCustomer->getvalue('name01'); |
---|
36 | $objPage->CustomerName2 = $objCustomer->getvalue('name02'); |
---|
37 | $objPage->CustomerPoint = $objCustomer->getvalue('point'); |
---|
38 | } |
---|
39 | |
---|
40 | //ページ送り用 |
---|
41 | if (isset($_POST['pageno'])) { |
---|
42 | $objPage->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE); |
---|
43 | } |
---|
44 | |
---|
45 | $col = "order_id, create_date, payment_id, payment_total"; |
---|
46 | $from = "dtb_order"; |
---|
47 | $where = "del_flg = 0 AND customer_id=?"; |
---|
48 | $arrval = array($objCustomer->getvalue('customer_id')); |
---|
49 | $order = "order_id DESC"; |
---|
50 | |
---|
51 | $linemax = $objQuery->count($from, $where, $arrval); |
---|
52 | $objPage->tpl_linemax = $linemax; |
---|
53 | |
---|
54 | // ページ送りの取得 |
---|
55 | $objNavi = new SC_PageNavi($_POST['pageno'], $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX); |
---|
56 | $objPage->tpl_strnavi = $objNavi->strnavi; // 表示文字列 |
---|
57 | $startno = $objNavi->start_row; |
---|
58 | |
---|
59 | // 取得範囲の指定(開始行番号、行数のセット) |
---|
60 | $objQuery->setlimitoffset(SEARCH_PMAX, $startno); |
---|
61 | // 表示順序 |
---|
62 | $objQuery->setorder($order); |
---|
63 | |
---|
64 | //購入履歴の取得 |
---|
65 | $objPage->arrOrder = $objQuery->select($col, $from, $where, $arrval); |
---|
66 | |
---|
67 | // 支払い方法の取得 |
---|
68 | $objPage->arrPayment = sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); |
---|
69 | |
---|
70 | |
---|
71 | $objView->assignobj($objPage); //$objpage内の全てのテンプレート変数をsmartyに格納 |
---|
72 | $objView->display(SITE_FRAME); //パスとテンプレート変数の呼び出し、実行 |
---|
73 | |
---|
74 | |
---|
75 | //------------------------------------------------------------------------------------------------------------------------- |
---|
76 | |
---|
77 | //エラーチェック |
---|
78 | |
---|
79 | function lfErrorCheck() { |
---|
80 | $objErr = new SC_CheckError(); |
---|
81 | $objErr->doFunc(array("メールアドレス", "login_email", STEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","EMAIL_CHECK","MAX_LENGTH_CHECK")); |
---|
82 | $objErr->dofunc(array("パスワード", "login_password", PASSWORD_LEN2), array("EXIST_CHECK","ALNUM_CHECK")); |
---|
83 | return $objErr->arrErr; |
---|
84 | } |
---|
85 | |
---|
86 | ?> |
---|