source: branches/feature-module-update/html/mobile/mypage/history.php @ 16170

Revision 16170, 2.2 KB checked in by nanasess, 15 years ago (diff)

モバイル対応

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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
12require_once("../require.php");
13
14class LC_Page{
15    function LC_Page() {
16        $this->tpl_mainpage = MOBILE_TEMPLATE_DIR . 'mypage/history.tpl';
17        $this->tpl_title = 'MYページ/購入履歴一覧';
18        session_cache_limiter('private-no-expire');
19    }
20}
21
22define ("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//$objLayout = new SC_Helper_PageLayout_Ex();
32//$objLayout->sfGetPageLayout($objPage, false, "mypage/index.php");
33
34// ログインチェック
35if(!isset($_SESSION['customer'])) {
36    SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR, "", false, "", true);
37}
38
39$col = "order_id, create_date, payment_id, payment_total";
40$from = "dtb_order";
41$where = "del_flg = 0 AND customer_id=?";
42$arrval = array($objCustomer->getvalue('customer_id'));
43$order = "order_id DESC";
44
45$linemax = $objQuery->count($from, $where, $arrval);
46$objPage->tpl_linemax = $linemax;
47
48// 取得範囲の指定(開始行番号、行数のセット)
49$objQuery->setlimitoffset(HISTORY_NUM, $pageNo);
50// 表示順序
51$objQuery->setorder($order);
52
53//購入履歴の取得
54$objPage->arrOrder = $objQuery->select($col, $from, $where, $arrval);
55
56// next
57if ($pageNo + HISTORY_NUM < $linemax) {
58    $next = "<a href='history.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>次へ→</a>";
59} else {
60    $next = "";
61}
62
63// previous
64if ($pageNo - HISTORY_NUM > 0) {
65    $previous = "<a href='history.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>←前へ</a>";
66} elseif ($pageNo == 0) {
67    $previous = "";
68} else {
69    $previous = "<a href='history.php?pageno=0'>←前へ</a>";
70}
71
72// bar
73if ($next != '' && $previous != '') {
74    $bar = " | ";
75} else {
76    $bar = "";
77}
78
79$objPage->tpl_strnavi = $previous . $bar . $next;
80$objView->assignobj($objPage);              //$objpage内の全てのテンプレート変数をsmartyに格納
81$objView->display(SITE_FRAME);              //パスとテンプレート変数の呼び出し、実行
82?>
Note: See TracBrowser for help on using the repository browser.