1 | <?php |
---|
2 | /* |
---|
3 | * MyPage |
---|
4 | */ |
---|
5 | |
---|
6 | require_once("../require.php"); |
---|
7 | |
---|
8 | class LC_Page{ |
---|
9 | function LC_Page() { |
---|
10 | $this->tpl_mainpage = 'mypage/history.tpl'; |
---|
11 | $this->tpl_title = 'MY¥Ú¡¼¥¸/¹ØÆþÍúÎò°ìÍ÷'; |
---|
12 | session_cache_limiter('private-no-expire'); |
---|
13 | } |
---|
14 | } |
---|
15 | |
---|
16 | define ("HISTORY_NUM", 5); |
---|
17 | |
---|
18 | $objPage = new LC_Page(); |
---|
19 | $objView = new SC_SiteView(); |
---|
20 | $objQuery = new SC_Query(); |
---|
21 | $objCustomer = new SC_Customer(); |
---|
22 | $pageNo = isset($_GET['pageno']) ? $_GET['pageno'] : 0; |
---|
23 | |
---|
24 | // ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ |
---|
25 | $objPage = sfGetPageLayout($objPage, false, "mypage/index.php"); |
---|
26 | |
---|
27 | // ¥í¥°¥¤¥ó¥Á¥§¥Ã¥¯ |
---|
28 | if(!isset($_SESSION['customer'])) { |
---|
29 | sfDispSiteError(CUSTOMER_ERROR); |
---|
30 | } |
---|
31 | |
---|
32 | $col = "order_id, create_date, payment_id, payment_total"; |
---|
33 | $from = "dtb_order"; |
---|
34 | $where = "del_flg = 0 AND customer_id=?"; |
---|
35 | $arrval = array($objCustomer->getvalue('customer_id')); |
---|
36 | $order = "order_id DESC"; |
---|
37 | |
---|
38 | $linemax = $objQuery->count($from, $where, $arrval); |
---|
39 | $objPage->tpl_linemax = $linemax; |
---|
40 | |
---|
41 | // ¼èÆÀÈϰϤλØÄê(³«»Ï¹ÔÈֹ桢¹Ô¿ô¤Î¥»¥Ã¥È) |
---|
42 | $objQuery->setlimitoffset(HISTORY_NUM, $pageNo); |
---|
43 | // ɽ¼¨½ç½ø |
---|
44 | $objQuery->setorder($order); |
---|
45 | |
---|
46 | //¹ØÆþÍúÎò¤Î¼èÆÀ |
---|
47 | $objPage->arrOrder = $objQuery->select($col, $from, $where, $arrval); |
---|
48 | |
---|
49 | // next |
---|
50 | if ($pageNo + HISTORY_NUM < $linemax) { |
---|
51 | $next = "<a href='history.php?pageno=" . ($pageNo + HISTORY_NUM) . "'>¼¡¤Ø¢ª</a>"; |
---|
52 | } else { |
---|
53 | $next = "¼¡¤Ø¢ª"; |
---|
54 | } |
---|
55 | |
---|
56 | // previous |
---|
57 | if ($pageNo - HISTORY_NUM > 0) { |
---|
58 | $previous = "<a href='history.php?pageno=" . ($pageNo - HISTORY_NUM) . "'>¢«Á°</a>"; |
---|
59 | } elseif ($pageNo == 0) { |
---|
60 | $previous = "¢«Á°"; |
---|
61 | } else { |
---|
62 | $previous = "<a href='history.php?pageno=0'>¢«Á°</a>"; |
---|
63 | } |
---|
64 | |
---|
65 | $objPage->tpl_strnavi = $previous . " | " . $next; |
---|
66 | $objView->assignobj($objPage); //$objpageÆâ¤ÎÁ´¤Æ¤Î¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òsmarty¤Ë³ÊǼ |
---|
67 | $objView->display(SITE_FRAME); //¥Ñ¥¹¤È¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤Î¸Æ¤Ó½Ð¤·¡¢¼Â¹Ô |
---|
68 | ?> |
---|