{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>

<form action="{$scriptName}" method="POST">
  <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" name="updcnt" value="{$action.item_struct_updcnt}">
  <input type="hidden" name="actionnm" value="{$action.actionnm}">
  <input type="hidden" name="from" value="{$action.from}">
  <input type="hidden" name="itemnm"          value="{$action.itemnm}">
  <input type="hidden" name="variationnm"           value="{$action.variationnm}">
  <input type="hidden" name="jancd"           value="{$action.jancd}">
  <input type="hidden" name="isbncd"          value="{$action.isbncd}">
  <input type="hidden" name="makeritemcd"     value="{$action.makeritemcd}">
  <input type="hidden" name="salestartdate"   value="{$action.salestartdate}">
  <input type="hidden" name="makerprice"      value="{$action.makerprice}">
  <input type="hidden" name="orderclosedate"  value="{$action.orderclosedate}">
  <input type="hidden" name="saleformcd"      value="{$action.saleformcd}">
  <input type="hidden" name="rectime"         value="{$action.rectime}">
  <input type="hidden" name="mediacd"         value="{$action.mediacd}">
  <input type="hidden" name="struct_comment"  value="{$action.struct_comment}">
  <input type="hidden" name="item_struct_updcnt" value="{$action.item_struct_updcnt}">
  <input type="hidden" name="itemnm" value="{$action.itemnm}">
  <input type="hidden" name="actionnm" value="{$action.actionnm}">
  <input type="hidden" name="download" value="{$action.download}">
  <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}
  
  <!-- ↓項目（上） --> 
    <table border="0" cellspacing="0" cellpadding="0" class="hyou">
      <tr>
        <th align="left">品目コード</th>
        <td align="left">{$action.cd}</td>
        <td align="right" colspan="2">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_reference'; 
                                        document.getElementById('cd').value='{$action.cd}';" value="詳細画面へ"></td>
      </tr>
      <tr>
        <th align="left">タイトル</th>
        <td align="left" colspan="3">
          {$action.itemnm}</td>
      </tr>
    </table>
  <!-- ↑項目（上） --> 
  
  <!-- ↓項目（下） --> 
    <table border="0" cellspacing="0" cellpadding="0">
{if $action.actionnm == "delete"}
      <tr>
        <td colspan="6">
            <strong><font color="#ff0000">本当に削除しますか?</font></strong>
         </td>
      </tr>
{/if}
    </table>
    
   <table border="0" cellspacing="0" cellpadding="0" class="hyou">
      <tr>
        <th align="left">販売方法</th>
        <td align="left" colspan="3">
{if $action.actionnm == "insert" || $action.actionnm == "delete"}
{if empty($action.download)}
          一般販売
{else}
          ダウンロード販売
{/if}
{elseif $action.actionnm == "update"}
          販売方法の変更はできません。
{/if}
        </td>
      </tr>

{if $action.actionnm == "update"}
      <tr id="dl">
        <th align="left">ダウンロード期間</th>
        <td align="left">
          <input type="hidden" name="download" value="{$action.download}">
          <input type="hidden" name="dlperioddays" value="{$action.dlperioddays}">
          購入日から {$action.dlperioddays} 日
        </td>
        <th align="left">販売価格</th>
        <td align="left">
          <input type="hidden" name="stockcd" value="{$action.stockcd}">
          <input type="hidden" name="sellingprice" value="{$action.sellingprice}">
          {$action.sellingprice|number_format} 円
        </td>
      </tr>
      <script>
      <!--
{if empty($action.download)}
          Element.hide($('dl'));
{else}
          Element.show($('dl'));
{/if}
      -->
      </script>
{/if}
      <tr>
        <th align="left">バリエーション名</th>
        <td align="left" colspan="3">
          {$action.variationnm}</td>
      </tr>
      <tr>
        <th align="left">メーカー品番</th>
        <td align="left">
          {$action.makeritemcd}</td>
        <th align="left">JANコード</th>
        <td align="left">
          {$action.jancd}</td>
      </tr>
      <tr>
{*
        <th align="left">メーカー定価</th>
        <td align="left">
          {$action.makerprice|number_format}円</td>
*}
        <th align="left">発売日</th>
        <td align="left">
          {$action.salestartdate|replace:"-":"/"}</td>
        <th align="left">発注締切日</th>
        <td align="left">
          {$action.orderclosedate|replace:"-":"/"}</td>
      </tr>

<!-- オプション情報 -->
{action->getOption assign=option}
{foreach from=$option item="option" key="key" name="opt"}
      <tr>
        <th align="left">{$option.name}</th>
        <td align="left"  colspan="3">
{assign var="div" value=$smarty.foreach.opt.iteration|string_format:"%02s"}
{assign var="nm" value="option$div"}
{if is_array($option.attributes)}
{assign var="c" value=$action.$nm}
          <input type="hidden" name="{$nm}" value="{$action.$nm}">{$option.attributes.$c}
{else}
          <input type="hidden" name="{$nm}" value="{$action.$nm}">{$action.$nm}
{/if}
        </td>
      </tr>
{/foreach}

      <tr>
        <th align="left">コメント</th>
        <td align="left" colspan="5">
          {$action.struct_comment|nl2br}</td>
      </tr>
      <tr>
        <td align="right" colspan="6">
{if $action.actionnm == "insert"}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_insert_done';
                                        document.getElementById('cd').value='{$action.cd}';
                                        document.getElementById('structcd').value='{$action.structcd}';" value="登録">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_insert_form'; 
                                        document.getElementById('cd').value='{$action.cd}'; 
                                        document.getElementById('structcd').value='{$action.structcd}';" value="戻る">
{elseif $action.actionnm == "delete"}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_delete_done';
                                        document.getElementById('cd').value='{$action.cd}';
                                        document.getElementById('structcd').value='{$action.structcd}';" value="削除">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_reference'; 
                                        document.getElementById('cd').value='{$action.cd}';" value="戻る">
{else}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_update_done';
                                        document.getElementById('cd').value='{$action.cd}';
                                        document.getElementById('structcd').value='{$action.structcd}';" value="更新">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_update_form'; 
                                        document.getElementById('cd').value='{$action.cd}'; 
                                        document.getElementById('structcd').value='{$action.structcd}';" value="戻る">
{/if}
          </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"}
