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 | |
---|
30 | function func_submit(product_id, class_name1, class_name2, product_class_id) { |
---|
31 | var err_text = ''; |
---|
32 | var fm = window.opener.document.form1; |
---|
33 | var fm1 = window.opener.document; |
---|
34 | var class1 = "classcategory_id" + product_id + "_1"; |
---|
35 | var class2 = "classcategory_id" + product_id + "_2"; |
---|
36 | |
---|
37 | var class1_id = document.getElementById(class1).value; |
---|
38 | var class2_id = document.getElementById(class2).value; |
---|
39 | |
---|
40 | <!--{if $tpl_no != ''}--> |
---|
41 | var opner_product_id = 'edit_product_id'; |
---|
42 | var opner_product_class_id = 'edit_product_class_id'; |
---|
43 | fm1.getElementById("no").value = <!--{$tpl_no}-->; |
---|
44 | <!--{else}--> |
---|
45 | var opner_product_id = 'add_product_id'; |
---|
46 | var opner_product_class_id = 'add_product_class_id'; |
---|
47 | <!--{/if}--> |
---|
48 | |
---|
49 | if (document.getElementById(class1).type == 'select-one' && class1_id == '') { |
---|
50 | err_text = class_name1 + "を選択してください。\n"; |
---|
51 | } |
---|
52 | if (document.getElementById(class2).type == 'select-one' && class2_id == '') { |
---|
53 | err_text = err_text + class_name2 + "を選択してください。\n"; |
---|
54 | } |
---|
55 | if (err_text != '') { |
---|
56 | alert(err_text); |
---|
57 | return false; |
---|
58 | } |
---|
59 | |
---|
60 | fm1.getElementById(opner_product_id).value = product_id; |
---|
61 | fm1.getElementById(opner_product_class_id).value = product_class_id; |
---|
62 | |
---|
63 | fm.mode.value = 'select_product_detail'; |
---|
64 | fm.anchor_key.value = 'order_products'; |
---|
65 | fm.submit(); |
---|
66 | window.close(); |
---|
67 | |
---|
68 | return true; |
---|
69 | } |
---|
70 | //--> |
---|
71 | </script> |
---|
72 | |
---|
73 | |
---|
74 | <script type="text/javascript">//<![CDATA[ |
---|
75 | // 規格2に選択肢を割り当てる。 |
---|
76 | function fnSetClassCategories(form, classcat_id2_selected) { |
---|
77 | sele1 = form.classcategory_id1; |
---|
78 | sele2 = form.classcategory_id2; |
---|
79 | product_id = form.product_id.value; |
---|
80 | |
---|
81 | if (sele1) { |
---|
82 | if (sele2) { |
---|
83 | // 規格2の選択肢をクリア |
---|
84 | count = sele2.options.length; |
---|
85 | for(i = count; i >= 0; i--) { |
---|
86 | sele2.options[i] = null; |
---|
87 | } |
---|
88 | |
---|
89 | // 規格2に選択肢を割り当てる |
---|
90 | classcats = productsClassCategories[product_id][sele1.value]; |
---|
91 | i = 0; |
---|
92 | for (var classcat_id2_key in classcats) { |
---|
93 | sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcat_id2_key); |
---|
94 | if (classcat_id2_key == classcat_id2_selected) { |
---|
95 | sele2.options[i].selected = true; |
---|
96 | } |
---|
97 | i++; |
---|
98 | } |
---|
99 | } |
---|
100 | fnCheckStock(form); |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | function fnCheckStock(form) { |
---|
105 | product_id = form.product_id.value; |
---|
106 | classcat_id1 = form.classcategory_id1.value; |
---|
107 | classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : 0; |
---|
108 | classcat2 = productsClassCategories[product_id][classcat_id1][classcat_id2]; |
---|
109 | // 商品規格 |
---|
110 | eleDynamic = document.getElementById('product_class_id' + product_id); |
---|
111 | if ( |
---|
112 | classcat2 |
---|
113 | && typeof classcat2.product_class_id != 'undefined' |
---|
114 | && String(classcat2.product_class_id).length >= 1 |
---|
115 | ) { |
---|
116 | eleDynamic.value = classcat2.product_class_id; |
---|
117 | } else { |
---|
118 | eleDynamic.value = '' |
---|
119 | } |
---|
120 | } |
---|
121 | //]]> |
---|
122 | </script> |
---|
123 | |
---|
124 | <!--▼検索フォーム--> |
---|
125 | <form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|h}-->"> |
---|
126 | <input name="mode" type="hidden" value="search" /> |
---|
127 | <input name="anchor_key" type="hidden" value="" /> |
---|
128 | <input name="search_pageno" type="hidden" value="" /> |
---|
129 | <input name="no" type="hidden" value="<!--{$tpl_no}-->" /> |
---|
130 | <table class="form"> |
---|
131 | <tr> |
---|
132 | <th>カテゴリ</th> |
---|
133 | <td> |
---|
134 | <select name="search_category_id"> |
---|
135 | <option value="" selected="selected">選択してください</option> |
---|
136 | <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}--> |
---|
137 | </select> |
---|
138 | </td> |
---|
139 | </tr> |
---|
140 | <tr> |
---|
141 | <th>商品名</th> |
---|
142 | <td><input type="text" name="search_name" value="<!--{$arrForm.search_name}-->" size="35" class="box35" /></td> |
---|
143 | </tr> |
---|
144 | <tr> |
---|
145 | <th>商品コード</th> |
---|
146 | <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code}-->" size="35" class="box35" /></td> |
---|
147 | </tr> |
---|
148 | </table> |
---|
149 | <div class="btn-area"> |
---|
150 | <ul> |
---|
151 | <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'search', '', ''); return false;"><span class="btn-next">検索を開始</span></a></li> |
---|
152 | </ul> |
---|
153 | </div> |
---|
154 | </form> |
---|
155 | <!--▼検索結果表示--> |
---|
156 | <!--{if $tpl_linemax}--> |
---|
157 | <p> |
---|
158 | <!--{$tpl_linemax}-->件が該当しました。 |
---|
159 | <!--{$tpl_strnavi}--> |
---|
160 | </p> |
---|
161 | |
---|
162 | <!--▼検索後表示部分--> |
---|
163 | <table class="list"> |
---|
164 | <tr> |
---|
165 | <th class="image">商品画像</th> |
---|
166 | <th class="id">商品コード</th> |
---|
167 | <th class="name">商品名</th> |
---|
168 | <th class="action">決定</th> |
---|
169 | </tr> |
---|
170 | <!--{section name=cnt loop=$arrProducts}--> |
---|
171 | <!--{assign var=id value=$arrProducts[cnt].product_id}--> |
---|
172 | <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;"> |
---|
173 | <!--▼商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
174 | <!--{assign var=status value="`$arrProducts[cnt].status`"}--> |
---|
175 | <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;"> |
---|
176 | <td class="center"> |
---|
177 | <img src="<!--{$smarty.const.URL_PATH}-->resize_image.php?image=<!--{$arrProducts[cnt].main_list_image|sfNoImageMainList|h}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|h}-->" /> |
---|
178 | </td> |
---|
179 | <td> |
---|
180 | <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}--> |
---|
181 | <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}--> |
---|
182 | <!--{* 商品コード *}--> |
---|
183 | <!--{if $codemin != $codemax}--> |
---|
184 | <!--{$codemin|h}-->~<!--{$codemax|h}--> |
---|
185 | <!--{else}--> |
---|
186 | <!--{$codemin|h}--> |
---|
187 | <!--{/if}--> |
---|
188 | </td> |
---|
189 | <td> |
---|
190 | <!--{$arrProducts[cnt].name|h}--> |
---|
191 | |
---|
192 | <!--{assign var=class1 value=classcategory_id`$id`_1}--> |
---|
193 | <!--{assign var=class2 value=classcategory_id`$id`_2}--> |
---|
194 | <!--{if $tpl_classcat_find1[$id]}--> |
---|
195 | <dt><!--{$tpl_class_name1[$id]|h}-->:</dt> |
---|
196 | <dd> |
---|
197 | <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);"> |
---|
198 | <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> |
---|
199 | </select> |
---|
200 | <!--{if $arrErr[$class1] != ""}--> |
---|
201 | <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span> |
---|
202 | <!--{/if}--> |
---|
203 | </dd> |
---|
204 | <!--{else}--> |
---|
205 | <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" /> |
---|
206 | <!--{/if}--> |
---|
207 | <!--{if $tpl_classcat_find2[$id]}--> |
---|
208 | <dt><!--{$tpl_class_name2[$id]|h}-->:</dt> |
---|
209 | <dd> |
---|
210 | <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select> |
---|
211 | <!--{if $arrErr[$class2] != ""}--> |
---|
212 | <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span> |
---|
213 | <!--{/if}--> |
---|
214 | </dd> |
---|
215 | <!--{else}--> |
---|
216 | <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> |
---|
217 | <!--{/if}--> |
---|
218 | <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> |
---|
219 | <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> |
---|
220 | <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> |
---|
221 | </td> |
---|
222 | <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->', '<!--{$tpl_product_class_id[$id]}-->'); return false;">決定</a></td> |
---|
223 | </tr> |
---|
224 | <!--▲商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
225 | </form> |
---|
226 | <!--{sectionelse}--> |
---|
227 | <tr> |
---|
228 | <td colspan="4">商品が登録されていません</td> |
---|
229 | </tr> |
---|
230 | <!--{/section}--> |
---|
231 | </table> |
---|
232 | <!--{/if}--> |
---|
233 | <!--▲検索結果表示--> |
---|
234 | |
---|
235 | |
---|
236 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}--> |
---|