<?php include_once( "../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:member.history.Login}
{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.login.memberObject)}
		&gt; <a href="./login.php">ログイン履歴検索</a>
		&gt; {write:member.history.login.memberObject->'view_name'}さんのログイン履歴
		{else}
		&gt; ログイン履歴検索
		{/if}
	</div>

	<h1>
		{write:MEMBER_PERSONAL_LABEL}管理 &gt; ログイン履歴検索
		{if:!is_null(member.history.login.memberObject)}
		&gt; {write:member.history.login.memberObject->'view_name'}さんのログイン履歴
		{/if}
	</h1>
	
	<form name="sform" action="./login.php" method="get">
	<input type="hidden" name="pn" value="{write:member.history.login.page_number}" />
	<p style="text-align:left;">
		{write:MEMBER_PERSONAL_LABEL}ID <input type="text" name="mi" size="15" value="{write:member.history.login.member_id}" />
		西暦 <select name="mlty" 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.login.targetYear} selected{/if}
			>{write:page.year}</option>
			<?php } ?>
		</select>年
		<select name="mltm" 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.login.targetMonth} selected{/if}
			>{write:page.month}</option>
			<?php } ?>
		</select>月
	</p>
	</form>

	{if:IS_ERROR}
	<ul class="error">
	{foreach:errors error}
		<li>{write:error}</li>
	{/foreach}
	</ul>
	{else}
	<table class="list" style="width:96%;margin:0 auto;">
	<tbody>
	<tr>
		{if:member.history.login.member_id==''}<th>ID</th>{/if}
		<th>ログイン日時</th>
		<th>ログイン時の情報</th>
	</tr>
	{foreach:member.history.login.data_array history_data}
	<tr>
		{if:member.history.login.member_id==''}<td>{write:history_data::member_id}</td>{/if}
		<td>{write:history_data::login_date}</td>
		<td style="font-size:x-small;">
			IP&nbsp;&nbsp; : {write:history_data::remote_address}<br />
			HOST : {write:history_data::remote_host}<br />
			UA&nbsp;&nbsp; : {write:history_data::user_agent}<br />
			TI&nbsp;&nbsp; : {write:history_data::terminal_id}<br />
		</td>
	</tr>
	{/foreach}
	</tbody>
	</table>
	{/if}

	<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.login.memberObject)}
		&gt;&gt; <a href="../member/detail.php?mi={write:member.history.login.memberObject->'member_id'}"
			>{write:member.history.login.memberObject->'view_name'}さんの詳細情報へ</a>
		{/if}
		&nbsp;
		&gt;&gt; <a href="../">{write:MEMBER_PERSONAL_LABEL}一覧へ戻る</a>
		&nbsp;
		&gt;&gt; <a href="../../">管理パネルトップへ戻る</a>
	</div>