{action->getFrom assign=from}

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

<div id="container">

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

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

<!-- ↓タイトル 07/05/03 tominaga add-->
{*　変数設定 *}
{assign var="change" value=$action.change|default:0}
{assign var="kubun"  value=$action.kubun|default:1}

<h3>お知らせ</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}
<!-- ↑エラーメッセージ -->

{* カレンダー設定 *}
{literal}
<script language="JavaScript">
var cal1 = new JKL.Calendar("calendar","form1","sale-date");
</script>
{/literal}

{*　LISTから飛んできたとき *}
{if $change == 0}
    {assign var="date" value=$action.data.date|default:""}
    {assign var="newstitle" value=$action.data.title|default:""}
    {assign var="body" value=$action.data.body|default:""}
    {assign var="releasediv" value=$action.data.releasediv|default:1}
    {if $kubun == 2}
        {assign var="newscd" value=$action.data.newscd|default:-1}
        {assign var="updcnt" value=$action.data.updcnt|default:-1}
    {/if}
{*　CONFIRMから戻ってきたとき *}
{else}
    {assign var="date" value=$action.date}
    {assign var="newstitle" value=$action.newstitle}
    {assign var="body" value=$action.body}
    {assign var="releasediv" value=$action.releasediv}
    {if $kubun == 2}
        {assign var="newscd" value=$action.newscd|default:-1}
        {assign var="updcnt" value=$action.updcnt|default:-1}
    {/if}
{/if}

<script><!--
var cal_start,cal_close;
cal1 = new JKL.Calendar("calendar","form1","date");
//--></script>
 
 <!-- ↓記入欄 -->
<form name="form1" id="form1" method="POST" action="{$scriptName}">

<table border="0" cellspacing="0" cellpadding="0" class="hyou">
<tr>
    <th>お知らせ日</th>
    <td>
        <input type="text" name="date" id="sale-date" value="{$date}"><img id="calendar-button" src="./images/calendar.png" width="16" height="16" align="middle" onClick="cal1.write();">
        <div id="calendar"></div>
    </td>
</tr><tr>
    <th>タイトル</th>
    <td><input type="text" name="newstitle" size="50" value="{$newstitle}"></td>
</tr><tr>
    <th>本文</th>
    <td><textarea name="body" rows="20" cols="60">{$body}</textarea></td>
</tr><tr>
    <th>公開区分</th>
    <td>
        <input type="checkbox" id="releasediv" name="releasediv" value="1" {if $releasediv == 1}checked{/if}><label for="releasediv">公開する</label>
    </td>
</tr>
<tr>
<td align="right" colspan="2">
<input type="hidden" name="kubun" value="{$kubun}">
<input type="hidden" name="change" value="1">
{if $kubun==2} 
<input type="hidden" name="newscd" value="{$newscd}">
<input type="hidden" name="updcnt" value="{$updcnt}">
{/if}
<input type="hidden" name="action" value="admin_portalmanage_news_confirm">
<input type="hidden" name="from" value="{$action.from}">
<input type="submit" value="確認">
<input type="button" onclick="location.href='{$scriptName}?action={$from}'" 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"}
