1 | <!--{* |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
6 | * |
---|
7 | * http://www.lockon.co.jp/ |
---|
8 | * |
---|
9 | * This program is free software; you can redistribute it and/or |
---|
10 | * modify it under the terms of the GNU General Public License |
---|
11 | * as published by the Free Software Foundation; either version 2 |
---|
12 | * of the License, or (at your option) any later version. |
---|
13 | * |
---|
14 | * This program is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this program; if not, write to the Free Software |
---|
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | */ |
---|
23 | *}--> |
---|
24 | |
---|
25 | <section id="mypagecolumn"> |
---|
26 | |
---|
27 | <h2 class="title"><!--{$tpl_title|h}--></h2> |
---|
28 | <!--{if $tpl_navi != ""}--> |
---|
29 | <!--{include file=$tpl_navi}--> |
---|
30 | <!--{else}--> |
---|
31 | <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}--> |
---|
32 | <!--{/if}--> |
---|
33 | |
---|
34 | <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/index.php"> |
---|
35 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
36 | <input type="hidden" name="order_id" value="" /> |
---|
37 | <input type="hidden" name="pageno" value="<!--{$objNavi->nowpage}-->" /> |
---|
38 | |
---|
39 | <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3> |
---|
40 | <!--{if $objNavi->all_row > 0}--> |
---|
41 | |
---|
42 | <!--★インフォメーション★--> |
---|
43 | <div class="information"> |
---|
44 | <p>There are <span class="attention"><span id="historycount"><!--{$objNavi->all_row}--></span> items</span> in your purchase history.</p> |
---|
45 | </div> |
---|
46 | |
---|
47 | <div class="form_area"> |
---|
48 | |
---|
49 | <!--▼フォームボックスここから --> |
---|
50 | <div class="formBox"> |
---|
51 | <!--{section name=cnt loop=$arrOrder max=$dispNumber}--> |
---|
52 | <!--▼商品 --> |
---|
53 | <div class="arrowBox"> |
---|
54 | <p> |
---|
55 | <em>Order number:</em><span class="order_id"><!--{$arrOrder[cnt].order_id}--></span><br /> |
---|
56 | <em>Date and time of purchase:</em><span class="create_date"><!--{$arrOrder[cnt].create_date|sfDispDBDate}--></span><br /> |
---|
57 | <em>Payment method:</em><span class="payment_id"><!--{$arrOrder[cnt].payment_method|h}--></span><br /> |
---|
58 | <em>Total amount:</em>$ <span class="payment_total"><!--{$arrOrder[cnt].payment_total|number_format}--></span><br /> |
---|
59 | <em>Order status:</em> |
---|
60 | <!--{if $smarty.const.MYPAGE_ORDER_STATUS_DISP_FLAG }--> |
---|
61 | <!--{assign var=order_status_id value="`$arrOrder[cnt].status`"}--> |
---|
62 | <!--{if $order_status_id != $smarty.const.ORDER_PENDING }--> |
---|
63 | <span class="order_status"><!--{$arrCustomerOrderStatus[$order_status_id]|h}--></span><br /> |
---|
64 | <!--{else}--> |
---|
65 | <span class="order_status attention"><!--{$arrCustomerOrderStatus[$order_status_id]|h}--></span><br /> |
---|
66 | <!--{/if}--> |
---|
67 | <!--{/if}--> |
---|
68 | </p> |
---|
69 | <a href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php?order_id=<!--{$arrOrder[cnt].order_id}-->" rel="external"></a> |
---|
70 | </div> |
---|
71 | <!--▲商品 --> |
---|
72 | <!--{/section}--> |
---|
73 | </div><!-- /.formBox --> |
---|
74 | </div><!-- /.form_area--> |
---|
75 | <div class="btn_area"> |
---|
76 | <!--{if $objNavi->all_row > $dispNumber}--> |
---|
77 | <p><a href="javascript: void(0);" class="btn_more" id="btn_more_history" onClick="getHistory(5); return false;" rel="external">View more (+<!--{$dispNumber}--> items)</a></p> |
---|
78 | <!--{/if}--> |
---|
79 | </div> |
---|
80 | <!--{else}--> |
---|
81 | <div class="form_area"> |
---|
82 | <div class="information"> |
---|
83 | <p>There is no purchase history.</p> |
---|
84 | </div> |
---|
85 | </div><!-- /.form_area--> |
---|
86 | <!--{/if}--> |
---|
87 | </form> |
---|
88 | </section> |
---|
89 | |
---|
90 | <!--▼検索バー --> |
---|
91 | <section id="search_area"> |
---|
92 | <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
93 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
94 | <input type="hidden" name="mode" value="search" /> |
---|
95 | <input type="search" name="name" id="search" value="" placeholder="Enter keywords" class="searchbox" > |
---|
96 | </form> |
---|
97 | </section> |
---|
98 | <!--▲検索バー --> |
---|
99 | |
---|
100 | <script> |
---|
101 | var pageNo = 2; |
---|
102 | var url = "<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php"; |
---|
103 | var statusImagePath = "<!--{$TPL_URLPATH}-->"; |
---|
104 | |
---|
105 | function getHistory(limit) { |
---|
106 | $.mobile.showPageLoadingMsg(); |
---|
107 | var i = limit; |
---|
108 | //送信データを準備 |
---|
109 | var postData = {}; |
---|
110 | $('#form1').find(':input').each(function(){ |
---|
111 | postData[$(this).attr('name')] = $(this).val(); |
---|
112 | }); |
---|
113 | postData["mode"] = "getList"; |
---|
114 | postData["pageno"] = pageNo; |
---|
115 | postData["disp_number"] = i; |
---|
116 | |
---|
117 | $.ajax({ |
---|
118 | type: "POST", |
---|
119 | url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/index.php", |
---|
120 | data: postData, |
---|
121 | cache: false, |
---|
122 | dataType: "json", |
---|
123 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
124 | alert(textStatus); |
---|
125 | $.mobile.hidePageLoadingMsg(); |
---|
126 | }, |
---|
127 | success: function(result){ |
---|
128 | for (var j = 0; j < i; j++) { |
---|
129 | if (result[j] != null) { |
---|
130 | var history = result[j]; |
---|
131 | var historyHtml = ""; |
---|
132 | var maxCnt = $(".arrowBox").length - 1; |
---|
133 | var historyEl = $(".arrowBox").get(maxCnt); |
---|
134 | historyEl = $(historyEl).clone(true).insertAfter(historyEl); |
---|
135 | maxCnt++; |
---|
136 | |
---|
137 | //注文番号をセット |
---|
138 | $($(".arrowBox span.order_id").get(maxCnt)).text(history.order_id); |
---|
139 | //購入日時をセット |
---|
140 | $($(".arrowBox span.create_date").get(maxCnt)).text(history.create_date); |
---|
141 | //支払い方法をセット |
---|
142 | $($(".arrowBox span.payment_id").get(maxCnt)).text(history.payment_method); |
---|
143 | //合計金額をセット |
---|
144 | $($(".arrowBox span.payment_total").get(maxCnt)).text(history.payment_total); |
---|
145 | //履歴URLをセット |
---|
146 | $($(".arrowBox a").get(maxCnt)).attr("href", url + "?order_id=" + history.order_id); |
---|
147 | } |
---|
148 | } |
---|
149 | pageNo++; |
---|
150 | |
---|
151 | //すべての商品を表示したか判定 |
---|
152 | if (parseInt($("#historycount").text()) <= $(".arrowBox").length) { |
---|
153 | $("#btn_more_history").hide(); |
---|
154 | } |
---|
155 | $.mobile.hidePageLoadingMsg(); |
---|
156 | } |
---|
157 | }); |
---|
158 | } |
---|
159 | </script> |
---|