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 | <h2 class="title"><!--{$tpl_title|h}--></h2> |
---|
27 | <!--{include file=$tpl_navi}--> |
---|
28 | |
---|
29 | <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3> |
---|
30 | <!--★インフォメーション★--> |
---|
31 | <div class="information"> |
---|
32 | <p>This is the list of registered addresses.<p> |
---|
33 | <p>A maximum of <!--{$smarty.const.DELIV_ADDR_MAX|h}--> items can be registered.</p> |
---|
34 | </div> |
---|
35 | <!--{if $tpl_linemax < $smarty.const.DELIV_ADDR_MAX}--> |
---|
36 | <!--{* 退会時非表示 *}--> |
---|
37 | <!--{if $tpl_login}--> |
---|
38 | <!--★ボタン★--> |
---|
39 | <div class="btn_area_top"> |
---|
40 | <a href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery_addr.php" class="btn_sub addbtn" rel="external" target="_blank">Add new delivery destination</a> |
---|
41 | </div> |
---|
42 | <!--{/if}--> |
---|
43 | <!--{/if}--> |
---|
44 | |
---|
45 | <div class="form_area"> |
---|
46 | <!--{if $tpl_linemax > 0}--> |
---|
47 | <form name="form1" id="form1" method="post" action="<!--{$smarty.const.HTTPS_URL|sfTrimURL}-->/mypage/delivery.php" > |
---|
48 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
49 | <input type="hidden" name="mode" value="" /> |
---|
50 | <input type="hidden" name="other_deliv_id" value="" /> |
---|
51 | <input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->" /> |
---|
52 | |
---|
53 | <!--▼フォームボックスここから --> |
---|
54 | <div class="formBox"> |
---|
55 | |
---|
56 | <!--{section name=cnt loop=$arrOtherDeliv max=$dispNumber}--> |
---|
57 | <!--▼お届け先 --> |
---|
58 | <div class="delivBox"> |
---|
59 | <p><em><span class="zip_title">Delivery address<!--{$smarty.section.cnt.iteration}--></span></em>:<br /> |
---|
60 | <!--{* <span class="zip01"><!--{$arrOtherDeliv[cnt].zip01}--></span>-<span class="zip02"><!--{$arrOtherDeliv[cnt].zip02}--></span><br /> *}--> |
---|
61 | <span class="zipcode"><!--{$arrOtherDeliv[cnt].zipcode}--></span><br /> |
---|
62 | <span class="address"><!--{$arrOtherDeliv[cnt].addr01|h}--><!--{$arrOtherDeliv[cnt].addr02|h}--></span><br /> |
---|
63 | <span class="name01"><!--{$arrOtherDeliv[cnt].name01|h}--></span> <span class="name02"><!--{$arrOtherDeliv[cnt].name02|h}--></span></p> |
---|
64 | |
---|
65 | <ul class="edit"> |
---|
66 | <li><a href="#" onClick="win02('./delivery_addr.php?other_deliv_id=<!--{$arrOtherDeliv[cnt].other_deliv_id}-->','deliv_disp','600','640'); return false;" class="b_edit deliv_edit" rel="external">Edit</a></li> |
---|
67 | <li><a href="#" onClick="fnModeSubmit('delete','other_deliv_id','<!--{$arrOtherDeliv[cnt].other_deliv_id}-->'); return false;" class="deliv_delete" rel="external"><img src="<!--{$TPL_URLPATH}-->img/button/btn_delete.png" class="pointer" width="21" height="20" alt="Delete" /></a></li> |
---|
68 | </ul> |
---|
69 | </div> |
---|
70 | <!--▲お届け先--> |
---|
71 | <!--{/section}--> |
---|
72 | |
---|
73 | </div><!--▲formBox --> |
---|
74 | </form> |
---|
75 | <!--{else}--> |
---|
76 | <p class="delivempty"><strong>There are no new delivery destinations.</strong></p> |
---|
77 | <!--{/if}--> |
---|
78 | |
---|
79 | <!--{if count($arrOtherDeliv) > $dispNumber}--> |
---|
80 | <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_delivery" onClick="getDelivery(<!--{$dispNumber}-->); return false;" rel="external">View more (+<!--{$dispNumber}--> items)</a></p> |
---|
81 | <!--{/if}--> |
---|
82 | |
---|
83 | </div><!-- /.form_area --> |
---|
84 | </section> |
---|
85 | |
---|
86 | <!--▼検索バー --> |
---|
87 | <section id="search_area"> |
---|
88 | <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php"> |
---|
89 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
90 | <input type="hidden" name="mode" value="search" /> |
---|
91 | <input type="search" name="name" id="search" value="" placeholder="Enter keywords" class="searchbox" > |
---|
92 | </form> |
---|
93 | </section> |
---|
94 | <!--▲検索バー --> |
---|
95 | |
---|
96 | <script> |
---|
97 | var pageNo = 2; |
---|
98 | |
---|
99 | function getDelivery(limit) { |
---|
100 | $.mobile.showPageLoadingMsg(); |
---|
101 | var i = limit; |
---|
102 | //送信データを準備 |
---|
103 | var postData = {}; |
---|
104 | $('#form1').find(':input').each(function(){ |
---|
105 | postData[$(this).attr('name')] = $(this).val(); |
---|
106 | }); |
---|
107 | postData["mode"] = "getList"; |
---|
108 | postData["pageno"] = pageNo; |
---|
109 | postData["disp_number"] = i; |
---|
110 | |
---|
111 | $.ajax({ |
---|
112 | type: "POST", |
---|
113 | url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/delivery.php", |
---|
114 | data: postData, |
---|
115 | cache: false, |
---|
116 | dataType: "json", |
---|
117 | error: function(XMLHttpRequest, textStatus, errorThrown){ |
---|
118 | alert(textStatus); |
---|
119 | $.mobile.hidePageLoadingMsg(); |
---|
120 | }, |
---|
121 | success: function(result){ |
---|
122 | var count = ((pageNo - 1) * i + 1); //お届け先住所の番号 |
---|
123 | for (var j = 0; j < i; j++) { |
---|
124 | if (result[j] != null) { |
---|
125 | var delivery = result[j]; |
---|
126 | var deliveryHtml = ""; |
---|
127 | var maxCnt = $(".delivBox").length - 1; |
---|
128 | var deliveryEl = $(".delivBox").get(maxCnt); |
---|
129 | deliveryEl = $(deliveryEl).clone(true).insertAfter(deliveryEl); |
---|
130 | maxCnt++; |
---|
131 | |
---|
132 | //住所タイトルをセット |
---|
133 | $($(".delivBox span.zip_title").get(maxCnt)).text('Delivery address' + count); |
---|
134 | //郵便番号1をセット |
---|
135 | // $($(".delivBox span.zip01").get(maxCnt)).text(delivery.zip01); |
---|
136 | //郵便番号2をセット |
---|
137 | // $($(".delivBox span.zip02").get(maxCnt)).text(delivery.zip02); |
---|
138 | //郵便番号をセット |
---|
139 | $($(".delivBox span.zipcode").get(maxCnt)).text(delivery.zipcode); |
---|
140 | //住所をセット |
---|
141 | $($(".delivBox span.address").get(maxCnt)).text(delivery.prefname + delivery.addr01 + delivery.addr02); |
---|
142 | //姓をセット |
---|
143 | $($(".delivBox span.name01").get(maxCnt)).text(delivery.name01); |
---|
144 | //名前をセット |
---|
145 | $($(".delivBox span.name02").get(maxCnt)).text(delivery.name02); |
---|
146 | //編集ボタンをセット |
---|
147 | $($(".delivBox a.deliv_edit").get(maxCnt)).attr("onClick", "win02('./delivery_addr.php?other_deliv_id=" + delivery.other_deliv_id + "','deliv_disp','600','640'); return false;"); |
---|
148 | //削除ボタンをセット |
---|
149 | $($(".delivBox a.deliv_delete").get(maxCnt)).attr("onClick", "fnModeSubmit('delete','other_deliv_id','" + delivery.other_deliv_id + "'); return false;"); |
---|
150 | count++; |
---|
151 | } |
---|
152 | } |
---|
153 | pageNo++; |
---|
154 | |
---|
155 | //すべてのお届け先を表示したか判定 |
---|
156 | if (parseInt(result.delivCount) <= $(".delivBox").length) { |
---|
157 | $("#btn_more_delivery").hide(); |
---|
158 | } |
---|
159 | $.mobile.hidePageLoadingMsg(); |
---|
160 | } |
---|
161 | }); |
---|
162 | } |
---|
163 | </script> |
---|