| 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 | ?> |
|---|