1 | <?php
|
---|
2 | /**
|
---|
3 | *
|
---|
4 | * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
|
---|
5 | *
|
---|
6 | * http://www.lockon.co.jp/
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * MyPage
|
---|
10 | */
|
---|
11 |
|
---|
12 | require_once("../require.php");
|
---|
13 |
|
---|
14 | class LC_Page{
|
---|
15 | function LC_Page() {
|
---|
16 | $this->tpl_mainpage = 'mypage/history.tpl';
|
---|
17 | $this->tpl_title = 'MYページ/購入履歴一覧';
|
---|
18 | session_cache_limiter('private-no-expire');
|
---|
19 | }
|
---|
20 | }
|
---|
21 |
|
---|
22 | define ("HISTORY_NUM", 5);
|
---|
23 |
|
---|
24 | $objPage = new LC_Page();
|
---|
25 | $objView = new SC_MobileView();
|
---|
26 | $objQuery = new SC_Query();
|
---|
27 | $objCustomer = new SC_Customer();
|
---|
28 | $pageNo = isset($_GET['pageno']) ? $_GET['pageno'] : 0;
|
---|
29 |
|
---|
30 | // レイアウトデザインを取得
|
---|
31 | $objPage = sfGetPageLayout($objPage, false, "mypage/index.php");
|
---|
32 |
|
---|
33 | // ログインチェック
|
---|
34 | if(!isset($_SESSION['customer'])) {
|
---|
35 | sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
|
---|
36 | }
|
---|
37 |
|
---|
38 | $col = "order_id, create_date, payment_id, payment_total";
|
---|
39 | $from = "dtb_order";
|
---|
40 | $where = "del_flg = 0 AND customer_id=?";
|
---|
41 | $arrval = array($objCustomer->getvalue('customer_id'));
|
---|
42 | $order = "order_id DESC";
|
---|
43 |
|
---|
44 | $linemax = $objQuery->count($from, $where, $arrval);
|
---|
45 | $objPage->tpl_linemax = $linemax;
|
---|
46 |
|
---|
47 | // 取得範囲の指定(開始行番号、行数のセット)
|
---|
48 | $objQuery->setlimitoffset(HISTORY_NUM, $pageNo);
|
---|
49 | // 表示順序
|
---|
50 | $objQuery->setorder($order);
|
---|
51 |
|
---|
52 | //購入履歴の取得
|
---|
53 | $objPage->arrOrder = $objQuery->select($col, $from, $where, $arrval);
|
---|
54 |
|
---|
55 | // next
|
---|
56 | if ($pageNo + HISTORY_NUM < $linemax) {
|
---|
57 | $next = "<a href='history.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>次へ→</a>";
|
---|
58 | } else {
|
---|
59 | $next = "";
|
---|
60 | }
|
---|
61 |
|
---|
62 | // previous
|
---|
63 | if ($pageNo - HISTORY_NUM > 0) {
|
---|
64 | $previous = "<a href='history.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>←前へ</a>";
|
---|
65 | } elseif ($pageNo == 0) {
|
---|
66 | $previous = "";
|
---|
67 | } else {
|
---|
68 | $previous = "<a href='history.php?pageno=0'>←前へ</a>";
|
---|
69 | }
|
---|
70 |
|
---|
71 | // bar
|
---|
72 | if ($next != '' && $previous != '') {
|
---|
73 | $bar = " | ";
|
---|
74 | } else {
|
---|
75 | $bar = "";
|
---|
76 | }
|
---|
77 |
|
---|
78 | $objPage->tpl_strnavi = $previous . $bar . $next;
|
---|
79 | $objView->assignobj($objPage); //$objpage内の全てのテンプレート変数をsmartyに格納
|
---|
80 | $objView->display(SITE_FRAME); //パスとテンプレート変数の呼び出し、実行
|
---|
81 | ?>
|
---|