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

<div id="container">

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

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

<h3>商品一覧</h3>


<!--↓エラーメッセージ -->
{errorList->getMessages assign=errmsg}
{if $errmsg}
<div class="error">
  <ul class="alert">
  {foreach from=$errmsg item=msg}
    <li>{$msg|escape}</li>
  {/foreach}
  </ul>
</div>
{/if}
<!--↑エラーメッセージ -->


<!--↓メニュー -->
<table border="0" cellspacing="0" cellpadding="0" class="sort-box">
 <tr>
   <td>
<strong>並び替え</strong>&nbsp;&nbsp;
  <a href="admin.php?action=admin_itemmanage_search_result{action->getSearchQuery|escape}">{if $action.sort==''}<b>品番（昇順）</b>{else}品番（昇順）{/if}</a>&nbsp;&nbsp;
  <a href="admin.php?action=admin_itemmanage_search_result{action->getSearchQuery|escape}&sort=title">{if $action.sort=='title'}<b>商品名（昇順）</b>{else}商品名（昇順）{/if}</a>&nbsp;&nbsp;
  <a href="admin.php?action=admin_itemmanage_search_result{action->getSearchQuery|escape}&sort=release">{if $action.sort=='release'}<b>発売日（降順）</b>{else}発売日（降順）{/if}</a>&nbsp;&nbsp;
   </td>
 </tr>
</table>

<!--↑メニュー -->

<form action="admin.php">
  <input type="hidden" name="div" value="{$action.div}">
  <input type="hidden" id="ac" name="action" value="">
  <input type="hidden" id="cd" name="cd" value="">
  <input type="hidden" id="janc" name="jancode" value="{$action.jancode}">
  <input type="hidden" id="hb" name="hinban" value="{$action.hinban}">
  <input type="hidden" id="t" name="itemtitle" value="{$action.itemtitle}">
  <input type="hidden" id="rds" name="release_date_start" value="{$action.release_date_start}">
  <input type="hidden" id="rde" name="release_date_end" value="{$action.release_date_end}">
  <input type="hidden" id="pds" name="publish_date_start" value="{$action.publish_date_start}">
  <input type="hidden" id="pde" name="publish_date_end" value="{$action.publish_date_end}">
  <input type="hidden" id="mc" name="maker_capital" value="{$action.maker_capital}">
  <input type="hidden" id="mn" name="maker_name" value="{$action.maker_name}">
  <input type="hidden" id="mda" name="media" value="{$action.media}">
  <input type="hidden" id="cst" name="cast" value="{$action.cast}">
  <input type="hidden" id="stut" name="situation" value="{$action.situation}">
  <input type="hidden" id="phs" name="photo_situation" value="{$action.photo_situation}">
  <input type="hidden" id="pus" name="publish_situation" value="{$action.publish_situation}">
  <input type="hidden" id="srt" name="sort" value="{$action.sort}">
{foreach name=list from=$action.genre_select item=genre}
  <input type="hidden" id="gnr" name="genre_select[]" value="{$genre}">
{/foreach}
  <input type="hidden" name="from"    value="{$action.from}">


<!-- ↓ページナビ、データ件数、追加ボタン（上） -->
<table border="0" cellspacing="0" cellpadding="0" class="border-non">
  <tr>
    <td>
        {action->getLink assign=link}
        {$link.all} &nbsp; &nbsp;
        {$action.cont}件のデータ
    </td>
    <td align="right">
      <input type="submit" onclick="document.getElementById('ac').value='admin_itemmanage_search';" value="検索画面へ">
    </td>
  </tr>
</table>
<!-- ↑ページナビ、データ件数、追加ボタン（上） -->

<!-- ↓アイテム -->
<table border="0" cellspacing="0" cellpadding="0" class="hyou">
  <tr>
    <th>コード</th>
    <th>出品者</th>
    {* <th>品番</th> *}
    {*  <th>メーカー</th> *}
    <th>発売日</th>
    <th>商品名<br />(バリエーション名)</th>
    {*  <th>キャスト</th> *}
    <th>在庫数</th>
    <th>操作</th>
  </tr>

  <!--ここから検索結果内容-->

{foreach from=$action.results item="item" name="item" key="key" }
   <tr>
    <td>{$item.itemcd}</td>
    <td>{action->getSellerName itemcd=$item.itemcd structcd=$item.structcd assign=name}
 {if $item.sellercd != ""}
    <a href="{$dirName}?action=seller_infomation&cd={$item.sellercd}">{$name|default:""}</a>
 {/if}
    </td>
    {* <td>{$item.makeritemcd}</td> *}
    {* <td>{action->getMakername makercd=$item.makercd|escape}</td> *}
    <td>{$item.salestartdate|replace:"-":"/"}</td>
    <td>
      {$item.itemnm}
      {if $item.variationnm!=""}<br />({$item.variationnm}){/if}
    </td>
    {* <td>{action->getCastname itemcd=$item.itemcd|escape}</td> *}
    <td>
    {action->getStockStyle itemcd=$item.itemcd structcd=$item.structcd assign=style}
    {if $style == ""}
    {action->getStockcount itemcd=$item.itemcd structcd=$item.structcd assign=sc}{$sc|default:0}
    {else}
    {action->getStockcount2 itemcd=$item.itemcd structcd=$item.structcd assign=sc2}{$sc2|default:2}
    {/if}
 
    </td>
    <td>
{* 検索条件 *}
{* 検索条件 ここまで *}
      <input type="submit" onclick="document.getElementById('ac').value='admin_itemmanage_reference'; document.getElementById('cd').value='{$item.itemcd}';" value="参照">
    </td>
  </tr>
{/foreach}
</table>

<!-- ↑アイテム -->

<!-- ↓ページナビ、データ件数、追加ボタン（下） -->
<table border="0" cellspacing="0" cellpadding="0" class="border-non">
  <tr>
    <td>
        {action->getLink assign=link}
        {$link.all}&nbsp;&nbsp;
        {$action.cont}件のデータ
    </td>
    <td align="right">
      <input type="submit" onclick="document.getElementById('ac').value='admin_itemmanage_search';" value="検索画面へ">
    </td>
  </tr>
</table>
</form>

<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"}
