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

<div id="container">

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

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

  <h3>{$action.title}</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}
<!--↑エラーメッセージ -->


<form action="{$scriptName}" method="POST">
  <table border="0" cellspacing="0" cellpadding="0" class="hyou">

{if $action.sendstate != "" && $action.sendstate != 0}
{* 送信済参照 *}
    <tr>
      <th>コード</th>
      <td>{$action.mailcd}</td>
      <th>送信日時</th>
      <td>{$action.senddate}</td></tr>
    <tr>
      <th>対象者</th>
      <td>{$action.target_str}</td>
      <th>送信状態</th>
      <td>{$action.sendstate_str}</td></tr>
    <tr>
      <th>タイトル</th>
      <td colspan="3">{$action.mailtitle}</td></tr>
    <tr>
      <th>本文</th>
      <td colspan="3">{$action.mailbody|nl2br}</td></tr>
    <tr>
      <td align="right" colspan="4">
        <input type="button" value="一覧に戻る" onclick="javascript:location.href='{$scriptName}?action=admin_mailmanage_mailmagazine_list'">
      </td></tr>
{else}
{* 新規・未送信更新 *}
    <tr>
      <th>コード</th>
      <td>{if $action.mailcd != ""}{$action.mailcd}{else}＜新規登録＞{/if}</td>
      <th>送信日時</th>
      <td>{if $action.senddate != ""}{$action.senddate}{else}＜未送信＞{/if}</td></tr>
    <tr>
      <th>対象者</th>
      <td><input name="target" type="radio" value="2" {if $action.target == 2 || $action.target == ""}checked{/if} />希望者のみ
          <input name="target" type="radio" value="1" {if $action.target == 1}checked{/if} />全会員</td>
      <th>送信状態</th>
      <td>未送信</td></tr>
    <tr>
      <th>タイトル</th>
      <td colspan="3"><input type="text" name="mailtitle" size="60" value="{$action.mailtitle}"></td></tr>
    <tr>
      <th>本文</th>
      <td colspan="3"><textarea cols=70 rows=20 name="mailbody">{$action.mailbody}</textarea></td></tr>
    <tr>
      <td align="right" colspan="4">
        <input type="hidden" name="mailcd" value="{$action.mailcd}">
        <input type="hidden" name="sendstate" value="0">
        <input type="hidden" name="updcnt" value="{$action.updcnt}">
        <input type="submit" name="dispatch_admin_mailmanage_mailmagazine_check" value="確認">
        <input type="button" value="一覧に戻る" onclick="javascript:location.href='{$scriptName}?action=admin_mailmanage_mailmagazine_list'">
      </td></tr>
{/if}
  </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"}
