<?php include_once( "../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_innerblock.tpl}
{module:database2.Connect}
{module:member.mail.Send}
{module:member.mail.LoadList get(mmst=1&mpstrsv=t)}
<div style="text-align:left;">
{if:IS_ERROR}
	<h1>メール送信処理失敗</h1>
	<ul class="error">
	{foreach:errors error}
		<li>{write:error}</li>
	{/foreach}
	</ul>
	<img src="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/images/bg.gif"
		onload="memberMailSendMailPostEnd()"
		/>
	<p>
		<input type="button" value="閉じる"
			onclick="membarMailSendPanelClose()"
			onkeypress="membarMailSendPanelClose()"
		/>
	</p>
{else}

	{if:count(member.mail.data_array)==0}
		<h1>メール送信完了</h1>
		<p>全てのメール送信が完了しました。</p>
		<img src="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/images/bg.gif"
			onload="memberMailSendMailPostEnd()"
			/>
		<p>
			<input type="button" value="閉じる"
				onclick="membarMailSendPanelClose()"
				onkeypress="membarMailSendPanelClose()"
			/>
		</p>
	{else}
		<h1>メール送信中</h1>
		<p>
			メール送信処理中です。ウィンドウを閉じないでください。
		</p>
		{if:count(member.mail.data_array)==1}
			{set:mailObject member.mail.data_array[0]}
			{set:remainCount mailObject->'total_count' - mailObject->'delivery_status_hash'[0]}
			{set:readyRate ceil((remainCount / mailObject->'total_count')*100)}
			<div style="width:50%;margin:0 auto;border:solid 1px #808080;background-color:#ffffff;padding:0px;">
				<div style="width:{write:readyRate}%;height:24px;background-color:#0000ff;">&nbsp;</div>
			</div>
			<div>
				{write:mailObject->'total_count'}件中 {write:mailObject->'delivery_status_hash'[0]}件が未配信です
			</div>
		{else}
			{foreach:member.mail.data_array mailObject}
			{set:remainCount mailObject->'total_count' - mailObject->'delivery_status_hash'[0]}
			{set:readyRate ceil((remainCount / mailObject->'total_count')*100)}
			<div style="width:50%;margin:0 auto;border:solid 1px #808080;background-color:#ffffff;padding:0px;">
				<div style="width:{write:readyRate}%;height:24px;background-color:#0000ff;">&nbsp;</div>
			</div>
			<div>
				{write:mailObject->'subject'} (作成:{write:mailObject->'registered_date'}) &nbsp;
				{write:mailObject->'total_count'}件中 {write:mailObject->'delivery_status_hash'[0]}件が未配信です
			</div>
			{/foreach}
		{/if}
	{/if}
{/if}
</div>