{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="admin.php">
  <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="fromlist_salestartdate" name="fromlist_salestartdate" value="">
    <input type="hidden" id="fromlist_orderclosedate" name="fromlist_orderclosedate" 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" 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" id="imcd" name="itemcd" value="">
  <input type="hidden" name="fromdetai" value="{$action.fromdetai}">
  <input type="hidden" name="cas" value="{action->getCastname itemcd=$action.result.0.itemcd|escape}">
  <input type="hidden" name="jcd" value="{action->getGenrename itemcd=$action.result.0.itemcd|escape} ">
  <input type="hidden" name="from" value="{$action.from}">
  
  
  
  <table border="0" cellspacing="0" cellpadding="0" class="search-box">
  　<tr>
  　　<td align="right">
          <input type="submit" onclick="document.getElementById('ac').value='admin_itemmanage_search';" value="検索画面へ">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_search_result';" value="一覧画面へ">
       </td>
    </tr>
  </table>
        
  
  <!-- ↓画像、項目などの内容 --> 

  
  <!-- ↓画像 --> 
{action->getImage itemcd=$action.result.0.itemcd|escape size=S assign=imgS}
{action->getImage itemcd=$action.result.0.itemcd|escape size=M assign=imgM}
{action->getImage itemcd=$action.result.0.itemcd|escape size=L assign=imgL}
{if $imgS == ""}
    {assign var="imgS" value="./images/image.gif"}
{/if}


<table border="0" cellspacing="0" cellpadding="0" style="width:680px;">
      <tr>
        <td style="text-align:center;">
          <img src="{$imgS|escape}" alt="画像小" title="画像小"></td>
      </tr>
      <tr>
        <td style="text-align:center;">
{if $imgL != ""}
          <a target="_blank" href="{$imgL|escape}" title="画像大">画像大</a>
{else}
          画像大
{/if}
          / 
{if $imgM != ""}
          <a target="_blank" href="{$imgM|escape}" title="画像中">画像中</a>
{else}
          画像中
{/if}
          </td>
      </tr>
      <tr>
        <td style="text-align:center; vertical-align:top;">
{assign var='inm' value=$action.result.0.itemnm|smarty:nodefaults}
{action->getGenrename itemcd=$action.result.0.itemcd|escape assign=jcd}


{* 品番を連結 *}
{capture name=makeritemcd}
{foreach name=list item=item from=$action.result}
  {$item.makeritemcd}
{/foreach}
{/capture}

          <input type="button"  onClick="window.open('{$scriptName}?div={$action.div}&action=admin_imguploader_form&imgtypediv=1&generalcd={$action.result.0.itemcd}&itemcd=&imgintotitle={$inm|escape:url}&fromaction=admin_itemmanage_reference&fromdetai={$action.fromdetai}&cas={$cas|escape:url}&jcd={$jcd|escape:url}&from={$action.from}&makeritemcd={$smarty.capture.makeritemcd|escape:url}', '_blank');" value="画像登録画面へ"></td>
      </tr>
    </table>
  <!-- ↑画像 --> 

  <!-- ↓項目（上） --> 
<table border="0" cellspacing="0" cellpadding="0" class="hyou">
 	  <tr><td colspan="3"><h4>基本情報</h4></td></tr>

      <tr>
        <th align="left">出品者：</th>
{if $action.seller.0.sellernm}
        <td align="left" colspan="2"><a href="{$dirName}?action=seller_infomation&cd={$action.seller.0.sellercd}">{$action.seller.0.sellernm}</a></td>
{else}
        <td align="left" colspan="2">運営者</td>
{/if}
      </tr>
      <tr>
        <th align="left">品目コード</th>
        <td align="left">{$action.result.0.itemcd}</td>
        <td align="right">

          <input type="submit" onClick="document.getElementById('ac').value='admin_portalmanage_recommend_regist'; 
                                        document.getElementById('imcd').value='{$action.result.0.itemcd}';" value="おすすめ商品登録画面へ">
           <input value="基本情報変更" type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_update_form'; 
                                                             document.getElementById('cd').value='{$action.result.0.itemcd}';">
          <input value="削除" type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_delete_form'; 
                                                     document.getElementById('cd').value='{$action.result.0.itemcd}';" ></td>
                                        
                                        </td>
      </tr>
      <tr>
        <th align="left">タイトル</th>
        <td align="left" colspan="2">{$action.result.0.itemnm}</td>
      </tr>
      <tr>
        <th align="left">タイトルかな</th>
        <td align="left" colspan="2">{$action.result.0.itemnmkana}</td>
      </tr>
       <tr>
        <th align="left">ジャンル</th>
        <td align="left" class="reference4" colspan="5">
{foreach from=$action.genrenm item=g1 name=g}{foreach from=$g1 item=g2 name=k}
{$g2.genrenm}{if $smarty.foreach.k.last}<br />{else}&nbsp;&gt;&nbsp;{/if}
{/foreach}{/foreach}
        </td>
      </tr>
      
{*      <tr>
        <th align="left">メーカー</th>
        <td align="left" colspan="2">{$action.result.0.makernm}</td>
      </tr>
*}
{*
      <tr>
        <th align="left">ランク</th>
        <td align="left">{section name=rank loop=$action.result.0.rankingrate max=5}★{/section}</td>
      </tr>
*}
      <tr>
        <th align="left">商品説明</th>
        <td align="left" colspan="2">{$action.result.0.itemexp}</td>
      </tr>

      <tr>
        <th align="left">お店のコメント</th>
        <td align="left" colspan="2">{$action.result.0.comment|nl2br}</td>
      </tr>
      
      <tr>
        <th align="left">公開日</th>
        <td align="left" colspan="2">{$action.result.0.releasedate|replace:"-":"/"}
        {if (strtotime($action.result.0.releasedate) > $smarty.now) 
	  OR ($action.result.0.releasedate == "") 
	  OR ((!strtotime($action.result.0.releasedate))
	  AND (strpos($action.result.0.releasedate, '1') !== 0))}
	  <span class="red">(非公開)</span>
	{/if}
        </td>
      </tr>
 	  
<!-- オプション情報 -->
{foreach from=$action.basic_option item="option" key="key" name="opt"}
      <tr>
        <th align="left">{$option.name}</th>
{assign var="div" value=$smarty.foreach.opt.iteration|string_format:"%02s"}
{assign var="nm" value="basic_option$div"}
{if is_array($option.attributes)}
{assign var="c" value=$action.result.0.$nm}
        <td align="left"  colspan="2">{$option.attributes.$c}</td>
{else}
        <td align="left"  colspan="2">{$action.result.0.$nm}</td>
{/if}
      </tr>
{/foreach}

    </table>
  <!-- ↑項目（上） --> 


  <!-- ↑画像、項目などの内容 -->  

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

 	  <tr><td colspan="3"><h4>構成情報</h4></td>
 	  <td align="right" colspan="3">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_insert_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';" value="新規構成情報追加"></td>
 	  </tr>

{foreach name=list item=item from=$action.result}

{* 商品構成画像 *}  
{action->getImageExists itemcd=$item.itemcd structcd=$item.structcd size=S assign=img1}  
{action->getImageExists itemcd=$item.itemcd structcd=$item.structcd size=M assign=img2}  
{action->getImageExists itemcd=$item.itemcd structcd=$item.structcd size=L assign=img3}  
		<tr>  
			<th align="left">構成情報画像<br />サイズ小</th>  
			<td align="left">{if !empty($img1)}登録済み{else}未登録{/if}</td>  
			<th align="left">構成情報画像<br />サイズ中</th>  
			<td align="left">{if !empty($img2)}登録済み{else}未登録{/if}</td>  
			<th align="left">構成情報画像<br />サイズ大</th>  
			<td align="left">{if !empty($img3)}登録済み{else}未登録{/if}</td>  
		</tr>  

{* 商品紹介用動画 *}  
{action->getMovieExists itemcd=$item.itemcd structcd=$item.structcd assign=mov}  
		<tr>  
			<th align="left">商品紹介用動画</th>  
			<td align="left" colspan="5">{if !empty($mov)}登録済み{else}未登録{/if}</td>  
		</tr> 

{action->getDlitemData itemcd=$item.itemcd structcd=$item.structcd assign=dl}

      <tr>
        <th align="left">販売方法</th>
        <td align="left" colspan="5">{if !empty($dl)}ダウンロード販売{else}一般販売{/if}</td>
      </tr>
{if !empty($dl)}
      <tr>
        <th align="left">ダウンロード期間</th>
        <td align="left" colspan="2">購入日から {$dl.dlperioddays} 日</td>
{action->getDlitemStock itemcd=$item.itemcd structcd=$item.structcd assign=dlstock}
        <th align="left">販売価格</th>
        <td align="left" colspan="2">{$dlstock.sellingprice|number_format} 円</td>
      </tr>
{/if}
      <tr>
        <th align="left">バリエーション名</th>
        <td align="left" colspan="5">{$item.variationnm}</td>
      </tr>
      <tr>
        <th align="left">JANコード</th>
        <td align="left">{$item.jancd}</td>
        <th align="left">品番</th>
        <td align="left">{$item.makeritemcd}</td>
        <th align="left">発売日</th>
        <td align="left">{$item.salestartdate|replace:"-":"/"}</td>
      </tr>
      <tr>
{*
        <th align="left">メーカー定価</th>
        <td align="left">{if $item.makerprice==0}オープンプライス{else}{$item.makerprice|number_format}&nbsp;円{/if}</td>
*}
        <th align="left">発注締切日</th>
        <td align="left" colspan="5">{$item.orderclosedate|replace:"-":"/"}</td>
      </tr>
      <tr>
        <th align="left">コメント</th>
        <td align="left" colspan="5">{$item.struct_comment|nl2br}</td>

      </tr>
			
			
<!-- オプション情報 -->
{foreach from=$action.struct_option item="option" key="key" name="opt"}

      <tr>
        <th align="left">{$option.name}</th>
{assign var="div" value=$smarty.foreach.opt.iteration|string_format:"%02s"}
{assign var="nm" value="struct_option$div"}
{assign var="c" value=$item.$nm}
{if is_array($option.attributes)}
        <td align="left"  colspan="5">{$option.attributes.$c}</td>
{else}
        <td align="left" colspan="5">{$item.$nm}</td>
{/if}
      </tr>
{/foreach}


      <tr>
        <td align="right" colspan="6">
{if !empty($dl)} {* ダウンロード販売のみ表示 *}
          <input type="button"  onClick="window.open('{$scriptName}?&action=admin_itemmanage_download_upload_form&itemcd={$action.result.0.itemcd}&structcd={$item.structcd}', '_blank');" value="ダウンロード商品ファイル登録">
{/if}
          <input type="button"  onClick="window.open('{$scriptName}?&action=admin_imguploader_form&imgtypediv=3&generalcd={$action.result.0.itemcd}&generalsub={$item.structcd}&itemcd=&imgintotitle={$inm|escape:url}&fromaction=admin_itemmanage_reference&fromdetai={$action.fromdetai}&cas={$cas|escape:url}&jcd={$jcd|escape:url}&from={$action.from}&makeritemcd={$item.makeritemcd|escape:url}', '_blank');" value="構成情報画像、動画登録">

{if empty($dl)} {* ダウンロード販売以外のみ在庫入力ボタンを表示 *}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_stock_list'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';
                                        document.getElementById('fromlist_salestartdate').value='{$item.salestartdate}';
                                        document.getElementById('fromlist_orderclosedate').value='{$item.orderclosedate}';
                                        " value="在庫入力">
{/if}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_update_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';" value="構成情報変更">
{if $action.structcount!=1}
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_change_struct_delete_form'; 
                                        document.getElementById('cd').value='{$action.result.0.itemcd}'; 
                                        document.getElementById('structcd').value='{$item.structcd}';" value="削除">
{/if}
          </td>
      </tr>
{/foreach}

    </table>
  <!-- ↑項目（下） -->
  
  <table border="0" cellspacing="0" cellpadding="0" class="search-box">
  　<tr>
  　　<td align="right">
          <input type="submit" onclick="document.getElementById('ac').value='admin_itemmanage_search';" value="検索画面へ">
          <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_search_result';" 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"}
