<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:system.login.Require}
{module:shopping.report.promotion.Payment}
{preset:page_title 'ショップ管理 > プロモーション報酬集計レポート'}

	<div class="panc">
		<a href="../../">管理パネルトップ</a>
		&gt; <a href="../">ショップ管理</a>
		&gt; 会員アフィリエイト未払報酬集計
	</div>
	<h1>ショップ管理 &gt; 成果レポート&gt; 会員アフィリエイト未払報酬集計</h1>

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

	<form name="sform" action="./payment.php" method="get">
	<table style="margin:0 auto;width:95%;">
	<tbody>
	<tr>
		
		<td style="line-height:2em;vertical-align:top;">
			<input type="text" size="5" name="minp" value="{write:shopping.report.promotion.payment.minimumPayment}" />円以上で
			<span style="white-space:nowrap;">{write:SHOPPING_LABEL_ORDER}日が<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.promotion.payment.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.promotion.payment.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.promotion.payment.end_day=day} selected{/if}
					>{write:day}</option>
			<?php } ?>
			</select>日まで <input type="submit" value="検索実行" />
			
			</span>
		</td>
		<td style="text-align:right;line-height:2em;">
			<input type="hidden" name="cmd" value="" />
			<input type="button" value="表示を全て支払済みに変更" onclick="shoppingPromotionToPaied()" />
		</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.promotion.payment.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>
		<th class="list">口座番号</th>
		<th class="list">口座名義</th>
		<th class="list">{write:SHOPPING_LABEL_ORDER}数</th>
		<th class="list">未払金額</th>
	</tr>
	{foreach:shopping.report.promotion.payment.resultHash infoHash}
	<tr>
		<td><a href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/member/member/bank/form.php?mi={write:infoHash['member_id']}">{write:infoHash['member_id']}</a></td>
		<td>{write:infoHash['view_name']}</td>
		<td>{write:infoHash['bank_name']}</td>
		<td>{write:infoHash['bank_branch_name']}</td>
		<td>{if:infoHash['bank_account_type']=='1'}当座預金{else}普通預金{/if}</td>
		<td>{write:infoHash['bank_account_code']}</td>
		<td>{write:infoHash['bank_account_name']}</td>
		<td style='text-align:right;'>{write:infoHash['purchase_count']}</td>
		<td style='text-align:right;'>&yen;{write:number_format(infoHash['payment_fee'])}-</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.promotion.payment.total_count}件
		</td>
	</tr>
	</tbody>
	</table>

<script type="text/javascript"><!--
function shoppingPromotionToPaied() {
	if( confirm('表示中の未払い情報を全て支払済みに変更します。\nこの操作は元に戻せません。\n本当に実行してよろしいですか？') ) {
		document.sform.cmd.value = 'topaied';
		document.sform.submit();
	} else {
		document.sform.cmd.value = '';
	}
}
//--></script>