{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}" id="form1">
  <input type="hidden" name="div" value="{$action.div}">
  <input type="hidden" id="ac" name="action" value="">
  <input type="hidden" id="cd" name="cd" value="{$action.result.0.itemcd}">
  <input type="hidden" id="janc" name="jancode" value="{$action.jancode}">
  <input type="hidden" id="hb" name="hinban" value="{$action.hinban}">
  <input type="hidden" id="it" 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="castcd" name="castcd" value="">
  <input type="hidden" id="updcnt" name="updcnt" value="">
  <input type="hidden" id="mde" name="mode" value="">
  
  <h3>{$action.title}</h3>
  <br />
  <br />
  <h4>{$action.result.0.itemnm}</h4>
  <br />
  <br />
  
  <!-- ↓キャストリスト -->
  <div class="castlist">
    <table class="hyou">
      <tr>
        <th>コード</th>
        <th>役割</th>
        <th>名前</th>
        <th>表示順</th>
        <th>操作</th>
      </tr>
{foreach from=$action.perfcastlist item=item}
      <tr>
        <td>{$item.castcd}</td>
        <td>{$item.name}</td>
        <td>{$item.castnm}</td>
        <td>{$item.disppriority}</td>
        <td><input type="button" onClick="castItemDelCheck(this.form, 'admin_itemmanage_castitem_done', 'delete', {$item.castcd}, {$item.updcnt});" value="削除"></td>
      </tr>
{/foreach}
    </table>
  </div>
  <!-- ↑キャストリスト -->
  
  <br />
  
  <!-- ↓キャスト追加 -->
  <div class="castinsert">
    <table class="hyou">
      <tr>
        <th>役割</th>
        <th>頭文字</th>
        <th>名前</th>
        <th>表示順</th>
        <th>操作</th>
      </tr>
      <tr>
        <td>
          <select name="cast_div" id="cast_div" onChange="castDivSelect()">
{foreach from=$action.castdivlist item=item name="castdivfch"}
            <option value="{$item.disppriority}">{$item.name}</option>
{/foreach}
          </select></td>
        <td>
          <select name="cast_capital" id="cast_capital" onChange="changeCastCapital('cast_capital', 'cast_name', '{$action.div}');">
            <option value="">未選択</option>
            <option value="a">あ行</option>
            <option value="ka">か行</option>
            <option value="sa">さ行</option>
            <option value="ta">た行</option>
            <option value="na">な行</option>
            <option value="ha">は行</option>
            <option value="ma">ま行</option>
            <option value="ya">や行</option>
            <option value="ra">ら行</option>
            <option value="wa">わ行</option>
          </select>
          <script>loadCast('cast_name', '{$action.cast_capital}', '{$action.cast_name}', '{$action.castdiv}', '{$action.div}');</script></td>
        <td>
          <select name="cast_name" id="cast_name">
            <option value="">キャスト名</option>
          </select></td>
        <td><input type="text" name="disppriority" size="4" value=""></td>
        <td>
          <input type="button" onClick="castItemInsCheck(this.form, 'admin_itemmanage_castitem_done', 'insert');" value="追加"></td>
      </tr>
    </table>
  </div>
  <!-- ↑キャスト追加 -->
  <input type="submit" onClick="document.getElementById('ac').value='admin_itemmanage_reference';" value="詳細画面へ">
</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"}
