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

<div id="container">

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

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

<form action="{$scriptName}">
  <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="structcd" name="structcd" value="">
  <input type="hidden" id="stockcd" name="stockcd" value="">
  <input type="hidden" id="stocktitlecd" name="stocktitlecd" 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" name="genre_select[]" value="{$genre}">
{/foreach}
  <input type="hidden" id="itd" name="imgtypediv" value="">
  <input type="hidden" id="gcd" name="generalcd" value="">
  <input type="hidden" id="iit" name="imgintotitle" value="{$action.result.0.itemnm}">
  <input type="hidden" id="frac" name="fromaction" value="admin_itemmanage_reference">
  
  <input type="hidden" name="fromlist_salestartdate" value="{$action.fromlist_salestartdate}">
  <input type="hidden" name="fromlist_orderclosedate" value="{$action.fromlist_orderclosedate}">
  <input type="hidden" name="from" value="{$action.from}">

  <!-- ↓項目（上） -->
    <table border="0" cellspacing="0" cellpadding="0" class="hyou">
      <tr>
        <th align="left">品目コード</th>
        <td align="left" class="name" colspan="2">{$action.result.0.itemcd}</td>
        <td align="right" class="name2">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_reference'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}';" value="詳細画面へ"></td>
      </tr>
      <tr>
        <th align="left">タイトル</th>
        <td align="left" colspan="3">{$action.result.0.itemnm}</td>
      </tr>
{foreach name=list item=item from=$action.struct}
      <tr>
        <th align="left">品番</th>
        <td align="left" colspan="3">{$item.makeritemcd}</td>
        

      </tr>
 {*     
      <tr>
        <th align="left">メーカー定価</th>
        <td align="left" colspan="3">
          {if $item.makerprice==0}オープンプライス{else}{$item.makerprice}円{/if}
        </td>
      </tr>
 *}
{/foreach}
    </table>
  <!-- ↑項目（上） --> 

  <!-- ↓項目（下） --> 
    <table border="0" cellspacing="0" cellpadding="0" class="hyou">

      <tr>
{if $action.st <> 5 AND $action.st <> 1}
        <td align="right" colspan="12">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_stock_insert_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';" value="追加"></td>
{/if}
      </tr>

      <tr>
        <th rowspan="2">No</th>
        <th>販売価格</th>
        <th>送料</th>
        <th>仕入単価</th>
        {*<th>仕入区分</th>*}
        <th>在庫数</th>
        {*<th>コンディション</th>*}
        <th>ステータス</th>
        <th>操作</th>
      </tr>
      <tr>
        <th align="left" class="th6" colspan="11">
        在庫コメント（ポータルにて複数在庫の表示を許可している場合のみ、在庫ごとのメッセージとして表示されます。<br />
        許可していない場合は、内部的なコメントとしてお使いください。）
        </th>
      </tr>
      
{foreach name=list item=item from=$action.stock}
<input type="hidden" name="stocktype" value="{$item.stockstate}">


      <tr>
      {* {if $smarty.foreach.list.iteration is even}class="tr3"{else}class="tr2"{/if}*}
        <td rowspan="2">{$smarty.foreach.list.iteration}</td>
        <td>{$item.sellingprice|number_format} &nbsp;{if $item.sellingprice|number_format}円{/if}</td>
        <td>{$item.souryouprc|number_format} &nbsp;{if $item.souryouprc|number_format}円{/if}</td>
        <td>{$item.costprice|number_format} &nbsp;{if $item.costprice|number_format}円{/if}</td>
        {*<td>{$item.supplidivnm}</td>*}
        <td>{if $item.stockstate == 1}0{else}{$item.stocktitlecdcont|number_format}{/if}</td>
        {*<td>{$item.conditionnm}</td>*}
        <td>{$item.stockstatenm}</td>
        <td align="center">
{action->getStockOrderCount itemcd=$item.itemcd structcd=$item.structcd stocktitlecd=$item.stocktitlecd stockstate=$item.stockstate assign=cnt}
{if $cnt<=0}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_stock_update_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}'; 
                                        document.getElementById('stockcd').value='{$item.stockcd}';" value="変更">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_stock_delete_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}'; 
                                        document.getElementById('stockcd').value='{$item.stockcd}';" value="削除">
{/if}
{if $item.stocktitlecd!=""}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_rackid_list';
                                        document.getElementById('cd').value='{$action.result.0.itemcd}';
                                        document.getElementById('structcd').value='{$item.structcd}';
                                        document.getElementById('stocktitlecd').value='{$item.stocktitlecd}';" value="棚番ID変更">
{/if}
          </td>
      </tr>
      <tr>
      {* {if $smarty.foreach.list.iteration is even}class="tr3"{else}class="tr2"{/if}*}
        <td class="td6" colspan="11">{$item.itemexp|nl2br|default:"　"}</td>
      </tr>
{/foreach}
      <tr>
{if $action.st <> 5 AND $action.st <> 1}
        <td align="right" colspan="12">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_stock_insert_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';" value="追加"></td>
{/if}
      </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"}
