<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:system.login.Require}
{module:shopping.report.member.Sales}
{preset:page_title 'ショップ管理 > ' . MEMBER_PERSONAL_LABEL . '売上レポート'}

	<div class="panc">
		<a href="../../">管理パネルトップ</a>
		&gt; <a href="../">ショップ管理</a>
		&gt; 会員売上レポート
	</div>
	<h1>ショップ管理 &gt; 会員売上レポート</h1>

	{if:IS_ERROR}
		<ul class="error">
		{foreach:errors error}
			<li>{write:error}</li>
		{/foreach}
	</ul>
	{/if}

	<form name="sform" action="./statistic.php" method="get">
	<table style="margin:0 auto;width:95%;">
	<tbody>
	<tr>
		<td style="line-height:2em;vertical-align:top;">
			<span style="white-space:nowrap;"><select name="sy">
			<option value=""></option>
			<?php for($i=2009;$i<=date('Y');$i++) { $request_object->setAttribute('year',$i); ?>
				<option value="{write:year}"
					{if:shopping.report.member.sales.start_year=year} selected{/if}
					>{write:year}</option>
			<?php } ?>
			</select>年
			<select name="sm">
			<option value=""></option>
			<?php for($i=1;$i<=12;$i++) { $request_object->setAttribute('month',$i); ?>
				<option value="{write:month}"
					{if:shopping.report.member.sales.start_month=month} selected{/if}
					>{write:month}</option>
			<?php } ?>
			</select>月
			<select name="sd" tabindex="150">
			<option value=""></option>
			<?php for($i=1;$i<=31;$i++) { $request_object->setAttribute('day',$i); ?>
				<option value="{write:day}"
					{if:shopping.report.member.sales.start_day=day} selected{/if}
					>{write:day}</option>
			<?php } ?>
			</select>日～<select name="ey">
			<option value=""></option>
			<?php for($i=2009;$i<=date('Y');$i++) { $request_object->setAttribute('year',$i); ?>
				<option value="{write:year}"
					{if:shopping.report.member.sales.end_year=year} selected{/if}
					>{write:year}</option>
			<?php } ?>
			</select>年
			<select name="em">
			<option value=""></option>
			<?php for($i=1;$i<=12;$i++) { $request_object->setAttribute('month',$i); ?>
				<option value="{write:month}"
					{if:shopping.report.member.sales.end_month=month} selected{/if}
					>{write:month}</option>
			<?php } ?>
			</select>月
			<select name="ed" tabindex="150">
			<option value=""></option>
			<?php for($i=1;$i<=31;$i++) { $request_object->setAttribute('day',$i); ?>
				<option value="{write:day}"
					{if:shopping.report.member.sales.end_day=day} selected{/if}
					>{write:day}</option>
			<?php } ?>
			</select>日<input type="submit" value="検索実行" /></span>
		</td>
	</tr>
	</tbody>
	</table>
	</form>
	
	<br />
	<table class="paging" style="margin:0 auto;width:95%;border-style:none;">
	<tbody>
	<tr>
		<td style="text-align:center;">
			{write:shopping.report.member.sales.total_count}件
		</td>
	</tr>
	</tbody>
	</table>
	<table class="list" style="margin:0 auto;width:95%;">
	<tbody>
	<tr class="list">
		<th class="list">会員ID</th>
		<th class="list">ニックネーム</th>
		<th class="list">販売数</th>
		<th class="list">合計金額</th>
		<th class="list">確認</th>
	</tr>
	{foreach:shopping.report.member.sales.resultHash reportDataHash}
	<tr>
		<td>{write:reportDataHash['member_id']}</td>
		<td>{write:reportDataHash['view_name']}</td>
		<td style='text-align:right;'>
			{write:reportDataHash['total_count']}
		</td>
		<td style='text-align:right;'>
			&yen;{write:number_format(reportDataHash['total_sales'])}
		</td>
		<td style='text-align:right;'>
			<a href="../../order/?shpiom={write:reportDataHash['member_id']}&amp;shpsy={write:shopping.report.member.sales.start_year}&amp;shpsm={write:shopping.report.member.sales.start_month}&amp;shpsd={write:shopping.report.member.sales.start_day}&amp;shpey={write:shopping.report.member.sales.end_year}&amp;shpem={write:shopping.report.member.sales.end_month}&amp;shped={write:shopping.report.member.sales.end_day}"
			target="_blank">関連{write:SHOPPING_LABEL_ORDER}表示</a>
		</td>
	</tr>
	{/foreach}
	</tbody>
	</table>
	<table class="paging" style="margin:0 auto;width:95%;border-style:none;">
	<tbody>
	<tr>
		<td style="text-align:center;">
			{write:shopping.report.member.sales.total_count}件
		</td>
	</tr>
	</tbody>
	</table>
