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