<?php include_once( "../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:member.history.Correspond}
{preset:page_title MEMBER_PERSONAL_LABEL . '管理 > 対応履歴'}

	<div class="panc">
		<a href="../../">管理パネルトップ</a>
		&gt; <a href="../">{write:MEMBER_PERSONAL_LABEL}情報一覧</a>
		{if:!is_null(member.history.correspond.memberObject)}
		&gt; <a href="./correspond.php">対応履歴検索</a>
		&gt; {write:member.history.correspond.memberObject->'view_name'}さんの対応履歴
		{else}
		&gt; 対応履歴検索
		{/if}
	</div>

	<h1>
		{write:MEMBER_PERSONAL_LABEL}管理 &gt; 対応履歴検索
		{if:!is_null(member.history.correspond.memberObject)}
		&gt; {write:member.history.correspond.memberObject->'view_name'}さんの対応履歴
		{/if}
	</h1>
	
	<form name="sform" action="./correspond.php" method="get">
	<input type="hidden" name="pn" value="{write:member.history.correspond.page_number}" />
	<table style="width:96%;margin:0 auto;border-style:none;">
	<tbody>
	<tr>
		<td style="border-style:none;">
			{write:MEMBER_PERSONAL_LABEL}ID <input type="text" name="mi" size="20" value="{write:member.history.correspond.member_id}" />
			&nbsp;
			対応年月
			<select name="mpty" onchange="document.sform.submit()">
				<option value="">選択</option>
				<?php for( $i=date('Y'); $i>1970; $i-- ) { $request->setAttribute('page.year',$i); ?>
				<option value="{write:page.year}"
					{if:page.year==member.history.correspond.targetYear} selected{/if}
				>{write:page.year}</option>
				<?php } ?>
			</select>年
			<select name="mptm" onchange="document.sform.submit()">
				<option value="">選択</option>
				<?php for( $i=1; $i<=12; $i++ ) { $request->setAttribute('page.month',sprintf('%02d',$i)); ?>
				<option value="{write:page.month}"
					{if:page.month==member.history.correspond.targetMonth} selected{/if}
				>{write:page.month}</option>
				<?php } ?>
			</select>月
		</td>
		<td style="border-style:none;text-align:right;">
			{if:strlen(member.history.correspond.member_id)>0}
			<input type="button" value="新規対応作成" onclick="window.location.href='../member/correspond/form.php?mi={write:member.history.correspond.member_id}'" />
			{/if}
		</td>
	</tr>
	</tbody>
	</table>
	</form>

	{if:IS_ERROR}
	<ul class="error">
	{foreach:errors error}
		<li>{write:error}</li>
	{/foreach}
	</ul>
	{else}
	<table style="width:96%;margin:0 auto;">
	<tbody>
	<tr style="background-color:#606060;">
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">対応日</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">開始日</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">分類</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">発信元</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">概要</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">概要</td>
		<td nowrap style="color:#F0F0F0;text-align:center;border-right:dotted 1px #808080;">登録者ID</td>
		<td nowrap style="color:#F0F0F0;text-align:center;">状態</td>
	</tr>
	{foreach:member.history.correspond.data_array history_data}
	<tr>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">{write:history_data->'correspond_date_day'}日</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">
			{write:history_data->'start_date_year'}-{write:history_data->'start_date_month'}-{write:history_data->'start_date_day'}
		</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">
			{write:MEMBER_CORRESPOND_CATEGORIES[history_data->'category_id']}
		</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">
			{write:MEMBER_CORERSPOND_TYPE_HASH[history_data->'correspond_type']}
		</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">
			{write:MEMBER_CORERSPOND_METHOD_HASH[history_data->'correspond_method']}
		</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;">
			<a href="../member/correspond/form.php?mi={write:member.history.correspond.member_id}&amp;mci={write:history_data->'correspond_id'}">{write:history_data::description}</a>
		</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">{write:history_data->'owner_id'}</td>
		<td style="border-right:dotted 1px #808080;border-bottom:solid 1px #808080;text-align:center;">
			<a href="../member/correspond/comment/?mi={write:member.history.correspond.member_id}&amp;mci={write:history_data->'correspond_id'}">{write:MEMBER_CORERSPOND_STATUS_HASH[history_data->'status_flag']}</a>
			
		</td>
	</tr>
	{/foreach}
	</tbody>
	</table>
	{/if}
	<p>
	</p>
	
	<hr style="width:96%;margin:0 auto;margin-top:1em;" />
	<div style="width:96%;margin:0 auto;text-align:right;">
		{if:!is_null(member.history.correspond.memberObject)}
		&gt;&gt; <a href="../member/detail.php?mi={write:member.history.correspond.memberObject->'member_id'}"
			>{write:member.history.correspond.memberObject->'view_name'}さんの詳細情報へ</a>
		{/if}
		&nbsp;
		&gt;&gt; <a href="../">{write:MEMBER_PERSONAL_LABEL}一覧へ戻る</a>
		&nbsp;
		&gt;&gt; <a href="../../">管理パネルトップへ戻る</a>
	</div>