source: tmp/version-2_5-test/data/Smarty/templates/default/admin/order/product_select.tpl @ 18609

Revision 18609, 7.9 KB checked in by kajiwara, 14 years ago (diff)

正式版にナイトリービルド版をマージしてみるテスト

Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2008 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_DIR`admin_popup_header.tpl"}-->
25
26<script type="text/javascript">
27<!--
28self.moveTo(20,20);self.focus();
29
30function func_submit(product_id, class_name1, class_name2) {
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_classcategory_id1 = 'edit_classcategory_id1';
43  var opner_classcategory_id2 = 'edit_classcategory_id2';
44  fm1.getElementById("no").value = <!--{$tpl_no}-->;
45  <!--{else}-->
46  var opner_product_id = 'add_product_id';
47  var opner_classcategory_id1 = 'add_classcategory_id1';
48  var opner_classcategory_id2 = 'add_classcategory_id2';
49  <!--{/if}-->
50
51  if (document.getElementById(class1).type == 'select-one' && class1_id == '') {
52    err_text = class_name1 + "を選択してください。\n";
53  }
54  if (document.getElementById(class2).type == 'select-one' && class2_id == '') {
55    err_text = err_text + class_name2 + "を選択してください。\n";
56  }
57  if (err_text != '') {
58    alert(err_text);
59    return false;
60  }
61
62  fm1.getElementById(opner_product_id).value = product_id;
63  if (class1_id != '') {
64    fm1.getElementById(opner_classcategory_id1).value = class1_id;
65  }
66  if (class2_id != '') {
67    fm1.getElementById(opner_classcategory_id2).value = class2_id;
68  }
69
70  fm.mode.value = 'select_product_detail';
71  fm.anchor_key.value = 'order_products';
72  fm.submit();
73  window.close();
74
75  return true;
76}
77//-->
78</script>
79
80<script type="text/javascript">//<![CDATA[
81// セレクトボックスに項目を割り当てる。
82function lnSetSelect(name1, name2, id, val) {
83        sele1 = document.form1[name1];
84        sele2 = document.form1[name2];
85        lists = eval('lists' + id);
86        vals = eval('vals' + id);
87
88        if(sele1 && sele2) {
89                index = sele1.selectedIndex;
90
91                // セレクトボックスのクリア
92                count = sele2.options.length;
93                for(i = count; i >= 0; i--) {
94                        sele2.options[i] = null;
95                }
96
97                // セレクトボックスに値を割り当てる
98                len = lists[index].length;
99                for(i = 0; i < len; i++) {
100                        sele2.options[i] = new Option(lists[index][i], vals[index][i]);
101                        if(val != "" && vals[index][i] == val) {
102                                sele2.options[i].selected = true;
103                        }
104                }
105        }
106}
107//]]>
108</script>
109
110
111<script type="text/javascript">//<![CDATA[
112    <!--{$tpl_javascript}-->
113//]]>
114</script>
115
116<!--▼検索フォーム-->
117<form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|escape}-->">
118<input name="mode" type="hidden" value="search" />
119<input name="anchor_key" type="hidden" value="" />
120<input name="search_pageno" type="hidden" value="" />
121<input name="no" type="hidden" value="<!--{$tpl_no}-->" />
122<table class="form">
123  <tr>
124    <th>カテゴリ</th>
125    <td>
126      <select name="search_category_id">
127        <option value="" selected="selected">選択してください</option>
128        <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
129      </select>
130    </td>
131  </tr>
132  <tr>
133    <th>商品名</th>
134    <td><input type="text" name="search_name" value="<!--{$arrForm.search_name}-->" size="35" class="box35" /></td>
135  </tr>
136  <tr>
137    <th>商品コード</th>
138    <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code}-->" size="35" class="box35" /></td>
139  </tr>
140</table>
141<div class="btn">
142  <button type="submit"><span>検索を開始</span></button>
143</div>
144
145<!--▼検索結果表示-->
146<!--{if $tpl_linemax}-->
147<p>
148  <!--{$tpl_linemax}-->件が該当しました。
149  <!--{$tpl_strnavi}-->
150</p>
151
152<!--▼検索後表示部分-->
153<table class="list">
154  <tr>
155    <th class="image">商品画像</th>
156    <th class="id">商品コード</th>
157    <th class="name">商品名</th>
158    <th class="action">決定</th>
159  </tr>
160  <!--{section name=cnt loop=$arrProducts}-->
161  <!--{assign var=id value=$arrProducts[cnt].product_id}-->
162  <!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
163  <tr>
164    <td class="center">
165      <img src="<!--{$smarty.const.URL_DIR}-->resize_image.php?image=<!--{$arrProducts[cnt].main_list_image|sfNoImageMainList|escape}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|escape}-->" />
166    </td> 
167    <td>
168      <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}-->
169      <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}-->
170      <!--{* 商品コード *}-->
171      <!--{if $codemin != $codemax}-->
172        <!--{$codemin|escape}-->~<!--{$codemax|escape}-->
173      <!--{else}-->
174        <!--{$codemin|escape}-->
175      <!--{/if}-->
176    </td>
177    <td>
178      <!--{$arrProducts[cnt].name|escape}-->
179
180      <!--{assign var=class1 value=classcategory_id`$id`_1}-->
181      <!--{assign var=class2 value=classcategory_id`$id`_2}-->
182      <!--{if $tpl_classcat_find1[$id]}-->
183      <dt><!--{$tpl_class_name1[$id]|escape}-->:</dt>
184      <dd>
185        <select name="<!--{$class1}-->" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->"  <!--{if $tpl_classcat_find2[$id]}--> onchange="lnSetSelect('<!--{$class1}-->', '<!--{$class2}-->', '<!--{$id}-->','');"<!--{/if}-->>
186          <option value="">選択してください</option>
187          <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}-->
188        </select>
189        <!--{if $arrErr[$class1] != ""}-->
190        <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span>
191        <!--{/if}-->
192      </dd>
193      <!--{else}-->
194      <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" />
195      <!--{/if}-->
196      <!--{if $tpl_classcat_find2[$id]}-->
197      <dt><!--{$tpl_class_name2[$id]|escape}-->:</dt>
198      <dd>
199        <select name="<!--{$class2}-->" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->">
200          <option value="">選択してください</option>
201        </select>
202        <!--{if $arrErr[$class2] != ""}-->
203        <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span>
204        <!--{/if}-->
205      </dd>
206      <!--{else}-->
207      <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" />
208      <!--{/if}-->
209    </td>
210    <td class="center"><a href="" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->')">決定</a></td>
211  </tr>
212  <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
213  <!--{sectionelse}-->
214  <tr>
215    <td colspan="4">商品が登録されていません</td>
216  </tr> 
217  <!--{/section}-->
218  </table>
219<!--{/if}-->
220<!--▲検索結果表示-->
221
222</form>
223
224<!--{include file="`$smarty.const.TEMPLATE_ADMIN_DIR`admin_popup_footer.tpl"}-->
Note: See TracBrowser for help on using the repository browser.