1 | <!--{* |
---|
2 | /* |
---|
3 | * This file is part of EC-CUBE |
---|
4 | * |
---|
5 | * Copyright(c) 2000-2010 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 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_header.tpl"}--> |
---|
25 | |
---|
26 | <script type="text/javascript"> |
---|
27 | <!-- |
---|
28 | self.moveTo(20,20);self.focus(); |
---|
29 | $(function() { |
---|
30 | |
---|
31 | var product_class_id = window.opener.jQuery('input[id^=product_class_id_]'); |
---|
32 | var product_code = window.opener.jQuery('input[id^=product_code_]'); |
---|
33 | var product_name = window.opener.jQuery('input[id^=product_name_]'); |
---|
34 | var classcategory_name1 = window.opener.jQuery('input[id^=classcategory_name1_]'); |
---|
35 | var classcategory_name2 = window.opener.jQuery('input[id^=classcategory_name2_]'); |
---|
36 | var price = window.opener.jQuery('input[id^=price_]'); |
---|
37 | var quantity = window.opener.jQuery('input[id^=quantity_]'); |
---|
38 | var shipping_id = window.opener.jQuery('input[id^=shipping_id_]'); |
---|
39 | var shipping_name01 = window.opener.jQuery('input[name^=shipping_name01_]'); |
---|
40 | var shipping_name02 = window.opener.jQuery('input[name^=shipping_name02_]'); |
---|
41 | var shipping_pref = window.opener.jQuery('select[name^=shipping_pref_] option:selected'); |
---|
42 | var shipping_addr01 = window.opener.jQuery('input[name^=shipping_addr01_]'); |
---|
43 | var shipping_addr02 = window.opener.jQuery('input[name^=shipping_addr02_]'); |
---|
44 | |
---|
45 | var index = 0; |
---|
46 | for (var i = 0; i < product_class_id.length; i++) { |
---|
47 | |
---|
48 | for (var j = 0; j < $(quantity[i]).val(); j++) { |
---|
49 | |
---|
50 | // 商品規格ID |
---|
51 | var idfield = jQuery('<input />') |
---|
52 | .attr({'name': 'multiple_product_class_id' + index, |
---|
53 | 'type': 'hidden'}) |
---|
54 | .val($(product_class_id[i]).val()); |
---|
55 | |
---|
56 | // 商品コード |
---|
57 | var codefield = jQuery('<input />') |
---|
58 | .attr({'name': 'multiple_product_code' + index, |
---|
59 | 'type': 'hidden'}) |
---|
60 | .val($(product_code[i]).val()); |
---|
61 | |
---|
62 | // 商品名 |
---|
63 | var namefield = jQuery('<input />') |
---|
64 | .attr({'name': 'multiple_product_name' + index, |
---|
65 | 'type': 'hidden'}) |
---|
66 | .val($(product_name[i]).val()); |
---|
67 | |
---|
68 | // 規格1 |
---|
69 | var class1field = jQuery('<input />') |
---|
70 | .attr({'name': 'multiple_classcategory_name1' + index, |
---|
71 | 'type': 'hidden'}) |
---|
72 | .val($(classcategory_name1[i]).val()); |
---|
73 | |
---|
74 | // 規格2 |
---|
75 | var class2field = jQuery('<input />') |
---|
76 | .attr({'name': 'multiple_classcategory_name2' + index, |
---|
77 | 'type': 'hidden'}) |
---|
78 | .val($(classcategory_name2[i]).val()); |
---|
79 | |
---|
80 | // 単価 |
---|
81 | var pricefield = jQuery('<input />') |
---|
82 | .attr({'name': 'multiple_price' + index, |
---|
83 | 'type': 'hidden'}) |
---|
84 | .val($(price[i]).val()); |
---|
85 | |
---|
86 | |
---|
87 | // 数量 |
---|
88 | var qfield = jQuery('<input />') |
---|
89 | .attr({'name': 'multiple_quantity' + index, |
---|
90 | 'type': 'text', |
---|
91 | 'size': 4}) |
---|
92 | .val(1); |
---|
93 | |
---|
94 | // 数量と hidden を設定 |
---|
95 | var q = jQuery('<td />').addClass('center') |
---|
96 | .append(idfield) |
---|
97 | .append(namefield) |
---|
98 | .append(class1field) |
---|
99 | .append(class2field) |
---|
100 | .append(pricefield) |
---|
101 | .append(qfield); |
---|
102 | |
---|
103 | // お届け先 |
---|
104 | var select = jQuery('<select />').attr('name', 'multiple_shipping' + index); |
---|
105 | var s = jQuery('<td />').append(select); |
---|
106 | |
---|
107 | // 行を生成 |
---|
108 | var tr = jQuery('<tr />') |
---|
109 | .append(jQuery('<td />').text($(product_code[i]).val())) |
---|
110 | .append(jQuery('<td />').text($(product_name[i]).val())) |
---|
111 | .append(q) |
---|
112 | .append(s); |
---|
113 | |
---|
114 | jQuery(tr).appendTo('tbody'); |
---|
115 | index++; |
---|
116 | } |
---|
117 | } |
---|
118 | |
---|
119 | // プルダウンを生成 |
---|
120 | for (var i = 0; i < shipping_id.length; i++) { |
---|
121 | var text = $(shipping_name01[i]).val() + $(shipping_name02[i]).val() |
---|
122 | + ' ' + $(shipping_pref[i]).text() |
---|
123 | + $(shipping_addr01[i]).val() + $(shipping_addr02[i]).val(); |
---|
124 | var option = jQuery('<option />') |
---|
125 | .val($(shipping_id[i]).val()) |
---|
126 | .text(text); |
---|
127 | $('select').append(option); |
---|
128 | } |
---|
129 | }); |
---|
130 | function func_submit() { |
---|
131 | var err_text = ''; |
---|
132 | var fm = window.opener.jQuery('form');; |
---|
133 | |
---|
134 | fm.get(0).mode.value = 'multiple_set_to'; |
---|
135 | fm.get(0).anchor_key.value = 'shipping'; |
---|
136 | |
---|
137 | $('input[name^=multiple_], select[name^=multiple_]').each(function() { |
---|
138 | var input = jQuery('<input />') |
---|
139 | .attr({'name': $(this).attr('name'), |
---|
140 | 'type': 'hidden'}) |
---|
141 | .val($(this).val()); |
---|
142 | fm.append(input); |
---|
143 | }); |
---|
144 | fm.append(jQuery('<input />') |
---|
145 | .attr({'name': 'multiple_size', |
---|
146 | 'type': 'hidden'}) |
---|
147 | .val($('input[name^=multiple_product_class_id]').length)); |
---|
148 | fm.submit(); |
---|
149 | window.close(); |
---|
150 | |
---|
151 | return true; |
---|
152 | } |
---|
153 | //--> |
---|
154 | </script> |
---|
155 | |
---|
156 | <!--▼検索フォーム--> |
---|
157 | <form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|h}-->"> |
---|
158 | <input name="mode" type="hidden" value="search" /> |
---|
159 | <input name="anchor_key" type="hidden" value="" /> |
---|
160 | <input name="search_pageno" type="hidden" value="" /> |
---|
161 | <input name="no" type="hidden" value="<!--{$tpl_no}-->" /> |
---|
162 | <table summary="配送情報" class="list"> |
---|
163 | <thead> |
---|
164 | <tr> |
---|
165 | <th>商品コード</th> |
---|
166 | <th>商品名/規格1/規格2</th> |
---|
167 | <th>数量</th> |
---|
168 | <th>お届け先</th> |
---|
169 | </tr> |
---|
170 | </thead> |
---|
171 | <tbody> |
---|
172 | </tbody> |
---|
173 | </table> |
---|
174 | <div class="btn-area"> |
---|
175 | <ul> |
---|
176 | <li><a class="btn-action" href="javascript:;" onclick="func_submit();"><span class="btn-next">決定</span></a></li> |
---|
177 | </ul> |
---|
178 | </div> |
---|
179 | </form> |
---|
180 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}--> |
---|