{include file="admin/header.html"}
{include file="admin/gnavi.html"}

<div id="container">

{include file="admin/menu/submenu_item.html"}

<!-- ↓段組み　メイン側 -->
<div id="main">

<h3>{$action.title}</h3>


{if $action.stocktitlecd==""}
<!-- ↓検索フォーム -->
<table border="0" cellspacing="0" cellpadding="0" class="search-box">
<tr>
  <td>
  <form name="janform" action="{$scriptName}">
    JANコード／品番&nbsp;
    <input type="text" id="jansrc" name="jansearch" value="{$action.jansearch}">&nbsp;
    <input type="submit" name="dispatch_admin_itemmanage_rackid_list" value="検索">&nbsp;
    <input type="button" onClick="document.getElementById('jansrc').value=''" value="クリア">
    <input type="hidden" name="defaultid" value="{$action.defaultid}">&nbsp;&nbsp;
    棚番 ID 最大値：{$action.maxrackid}
    <span style="display: none;"><input type="text" name="dummy"></span>
  </form>
</td>
</tr>
</table>
<!-- ↑検索フォーム -->
{/if}

<!-- ↓棚番 ID リスト -->

<form name="listform" action="{$scriptName}" method="POST">
   <table border="0" cellspacing="0" cellpadding="0" class="hyou">
    <tr>
      <th>チェック</th>
      <th>注文番号</th>
      <th>発注日</th>
      <th>仕入先</th>
      <!-- <th>メーカー</th> -->
      <th>品番</th>
      <th>商品名</th>
      <!-- <th>メディア</th> -->
      <th>棚番 ID</th>
    </tr>
{foreach from=$action.returndata item=item key=key name=ret}
    <tr>
      <td align="center"><input type="checkbox" name="check[{$key}]" checked>
                        <input type="hidden" name="es_updcnt[{$key}]" value="{$item.es_updcnt}">
                        <input type="hidden" name="itemc[{$key}]" value="{$item.itemcd}">
                        <input type="hidden" name="structc[{$key}]" value="{$item.structcd}">
                        <input type="hidden" name="stockc[{$key}]" value="{$item.stockcd}"></td>
      <td>{$item.st_orderno}
                        <input type="hidden" name="st_orderno[{$key}]" value="{$item.st_orderno}"></td>
      <td>{$item.orderdate|date_format:"%Y/%m/%d"}
                        <input type="hidden" name="orderdate[{$key}]" value="{$item.orderdate|date_format:"%Y/%m/%d"}"></td>
      <td>{$item.suppliernm}
                        <input type="hidden" name="suppliernm[{$key}]" value="{$item.suppliernm}"></td>
      <!-- <td>{$item.makernm}
                        <input type="hidden" name="makernm[{$key}]" value="{$item.makernm}"></td> -->
      <td>{$item.makeritemcd}
                        <input type="hidden" name="makeritemcd[{$key}]" value="{$item.makeritemcd}"></td>
      <td>{$item.itemnm}&nbsp;{$item.variationnm}
                        <input type="hidden" name="itemnm[{$key}]" value="{$item.itemnm}&nbsp;{$item.variationnm}"></td>
      <!-- <td>{$item.medianm}
                        <input type="hidden" name="medianm[{$key}]" value="{$item.medianm}"></td> -->
      <td align="center"><input type="text" name="rackid[{$key}]" value="{foreach from=$action.itemc item=ret key=k}{if $action.itemc[$k]==$item.itemcd&&$action.structc[$k]==$item.structcd&&$action.stockc[$k]==$item.stockcd}{$action.rackid[$k]}{/if}{foreachelse}{if $smarty.foreach.ret.first&&$action.defaultid!=""&&$item.rackid==""}{$action.defaultid+1}{else}{$item.rackid}{/if}{/foreach}" size="7"></td>
    </tr>
{foreachelse}
    <tr>
      <td colspan="9">データがありません</td>
    </tr>
{/foreach}
  </table>

   <table border="0" cellspacing="0" cellpadding="0" class="hyou">
    <tr>
      <td>チェックしたものを
  
        <input type="hidden" name="jansearch" value="{$action.jansearch}">
        <input type="hidden" name="stocktitlecd" value="{$action.stocktitlecd}">
        <input type="hidden" name="defaultid" value="{$action.defaultid}">
        
{if $action.stocktitlecd}
        <input type="hidden" name="div" value="{$action.div}">
        <input type="hidden" name="cd" value="{$action.cd}">
        <input type="hidden" name="structcd" value="{$action.structcd}">
        <input type="hidden" name="stockcd" value="">
        <input type="hidden" name="jancode" value="{$action.jancode}">
        <input type="hidden" name="hinban" value="{$action.hinban}">
        <input type="hidden" name="itemtitle" value="{$action.itemtitle}">
        <input type="hidden" name="release_date_start" value="{$action.release_date_start}">
        <input type="hidden" name="release_date_end" value="{$action.release_date_end}">
        <input type="hidden" name="publish_date_start" value="{$action.publish_date_start}">
        <input type="hidden" name="publish_date_end" value="{$action.publish_date_end}">
        <input type="hidden" name="maker_capital" value="{$action.maker_capital}">
        <input type="hidden" name="maker_name" value="{$action.maker_name}">
        <input type="hidden" name="media" value="{$action.media}">
        <input type="hidden" name="cast" value="{$action.cast}">
        <input type="hidden" name="situation" value="{$action.situation}">
        <input type="hidden" name="photo_situation" value="{$action.photo_situation}">
        <input type="hidden" name="publish_situation" value="{$action.publish_situation}">
        <input type="hidden" name="sort" value="{$action.sort}">
      {foreach name=list from=$action.genre_select item=genre}
        <input type="hidden" name="genre_select[]" value="{$genre}">
      {/foreach}
{/if}
        <input type="submit" name="dispatch_admin_itemmanage_rackid_check" value="変更確認">
      </form>
    </td>
{if $action.stocktitlecd}
    <td align="right">
      <form name="returnform" action="{$scriptName}" method="GET">
        <input type="hidden" name="div" value="{$action.div}">
        <input type="hidden" name="cd" value="{$action.cd}">
        <input type="hidden" name="structcd" value="{$action.structcd}">
        <input type="hidden" name="stockcd" value="">
        <input type="hidden" name="jancode" value="{$action.jancode}">
        <input type="hidden" name="hinban" value="{$action.hinban}">
        <input type="hidden" name="itemtitle" value="{$action.itemtitle}">
        <input type="hidden" name="release_date_start" value="{$action.release_date_start}">
        <input type="hidden" name="release_date_end" value="{$action.release_date_end}">
        <input type="hidden" name="publish_date_start" value="{$action.publish_date_start}">
        <input type="hidden" name="publish_date_end" value="{$action.publish_date_end}">
        <input type="hidden" name="maker_capital" value="{$action.maker_capital}">
        <input type="hidden" name="maker_name" value="{$action.maker_name}">
        <input type="hidden" name="media" value="{$action.media}">
        <input type="hidden" name="cast" value="{$action.cast}">
        <input type="hidden" name="situation" value="{$action.situation}">
        <input type="hidden" name="photo_situation" value="{$action.photo_situation}">
        <input type="hidden" name="publish_situation" value="{$action.publish_situation}">
        <input type="hidden" name="sort" value="{$action.sort}">
      {foreach name=list from=$action.genre_select item=genre}
        <input type="hidden" name="genre_select[]" value="{$genre}">{/foreach}
        <input type="submit" name="dispatch_admin_itemmanage_change_stock_list" value="戻る">
{/if}
      </form>
    </td>
  </tr>
</table>


<!-- ↑棚番 ID リスト -->

<div class="pagetop" title="ページトップへ"><a href="#top">ページトップへ</a></div>

</div>
<!--End of main-->

<div class="cr"></div>
</div>
<!--End of container-->

{include file="admin/footer.html"}
