<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:system.login.Require}
{module:shopping.order.settlement.LoadListExists}
{preset:page_title 'ショップ管理 > 支払方法設定'}

	<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="mform" action="./execute.php" method="post" enctype="multipart/form-data">
	{foreach:shopping.order.settlement.methodExistsObjectArray settleMethodObject}
	<h2 class="global">
		{write:settleMethodObject->getMethodName()}
		&nbsp;&nbsp;
		<span style="font-size:small;">
		<input type="radio" id="enable{write:settleMethodObject->getMethodNumber()}_0" name="enable[{write:settleMethodObject->getMethodNumber()}]" value="true"
			{if:settleMethodObject->'enable'} checked{/if}
			onclick="shoppingSettingSettleChangeEnable{write:settleMethodObject->getMethodNumber()}(this)"
			/><label for="enable_{write:settleMethodObject->getMethodNumber()}_0" style="cursor:pointer;"
			>有効</label>
		<input type="radio" id="enable_{write:settleMethodObject->getMethodNumber()}_1" name="enable[{write:settleMethodObject->getMethodNumber()}]" value="false"
			{if:false===settleMethodObject->'enable'} checked{/if}
			onclick="shoppingSettingSettleChangeEnable{write:settleMethodObject->getMethodNumber()}(this)"
			/><label for="enable_{write:settleMethodObject->getMethodNumber()}_1" style="cursor:pointer;"
			>無効</label>
		</span>
	</h2>
	<div id="shopping-setting-settlement-block-{write:settleMethodObject->getMethodNumber()}"{if:settleMethodObject->'enable'}{else} style="display:none;visibility:hidden;position:absolute;top:0px;left:0px;z-index:-99;"{/if}>
	<table class="detail" style="width:96%;margin:0 auto;">
	<tbody>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			携帯電話での利用
		</th>
		<td>
			<input type="radio" id="enable{write:settleMethodObject->getMethodNumber()}_0" name="canMobile[{write:settleMethodObject->getMethodNumber()}]" value="true"
				{if:settleMethodObject->'canMobile'} checked{/if}
				/><label for="canMobile_{write:settleMethodObject->getMethodNumber()}_0" style="cursor:pointer;"
				>可</label>
			<input type="radio" id="canMobile_{write:settleMethodObject->getMethodNumber()}_1" name="canMobile[{write:settleMethodObject->getMethodNumber()}]" value="false"
				{if:false===settleMethodObject->'canMobile'} checked{/if}
				/><label for="canMobile_{write:settleMethodObject->getMethodNumber()}_1" style="cursor:pointer;"
				>不可</label>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			表示名
		</th>
		<td>
			<input type="text" name="viewName[{write:settleMethodObject->getMethodNumber()}]" size="30"
				value="{write:settleMethodObject->'viewName'}" />
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			処理前後の<br />{write:SHOPPING_LABEL_ORDER}状態
		</th>
		<td>
			決済動作前=<select name="statusReady[{write:settleMethodObject->getMethodNumber()}]">
				{foreach:SHOPPING_ORDER_STATUS_HASH key val}
				<option value="{write:key}"
					{if:strlen(settleMethodObject->'statusReady')>0 && key==settleMethodObject->'statusReady'} selected{/if}
					>{write:val}</option>
				{/foreach}
			</select>
			&nbsp;
			正常終了時=<select name="statusNomal[{write:settleMethodObject->getMethodNumber()}]">
				{foreach:SHOPPING_ORDER_STATUS_HASH key val}
				<option value="{write:key}"
					{if:strlen(settleMethodObject->'statusNomal')>0 && key==settleMethodObject->'statusNomal'} selected{/if}
					>{write:val}</option>
				{/foreach}
			</select>
			&nbsp;
			異常終了時=<select name="statusError[{write:settleMethodObject->getMethodNumber()}]">
				{foreach:SHOPPING_ORDER_STATUS_HASH key val}
				<option value="{write:key}"
					{if:strlen(settleMethodObject->'statusError')>0 && key==settleMethodObject->'statusError'} selected{/if}
					>{write:val}</option>
				{/foreach}
			</select><br />
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			正常終了時の<br />決済状態
		</th>
		<td>
			<select name="statusSettle[{write:settleMethodObject->getMethodNumber()}]">
				{foreach:SHOPPING_ORDER_STATUS_SETTLE_HASH key val}
				<option value="{write:key}"
					{if:strlen(settleMethodObject->'statusSettle')>0 && key==settleMethodObject->'statusSettle'} selected{/if}
					>{write:val}</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">決済手数料</th>
		<td>
			<input type="radio" id="feeType_{write:settleMethodObject->getMethodNumber()}_0" name="feeType[{write:settleMethodObject->getMethodNumber()}]" value="0"
				{if:'0'==settleMethodObject->'feeType'} checked{/if}
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				/><label for="feeType_{write:settleMethodObject->getMethodNumber()}_0" style="cursor:pointer;"
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				>なし</label>
			<input type="radio" id="feeType_{write:settleMethodObject->getMethodNumber()}_1" name="feeType[{write:settleMethodObject->getMethodNumber()}]" value="1"
				{if:'1'==settleMethodObject->'feeType'} checked{/if}
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				/><label for="feeType_{write:settleMethodObject->getMethodNumber()}_1" style="cursor:pointer;"
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				>固定額</label>
			<input type="radio" id="feeType_{write:settleMethodObject->getMethodNumber()}_2" name="feeType[{write:settleMethodObject->getMethodNumber()}]" value="2"
				{if:'2'==settleMethodObject->'feeType'} checked{/if}
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				/><label for="feeType_{write:settleMethodObject->getMethodNumber()}_2" style="cursor:pointer;"
				onclick="changeFeeType{write:settleMethodObject->getMethodNumber()}()"
				>お買い上げ額に対するパーセンテージ</label>
			<br />
			<input type="text" id="feeValue_{write:settleMethodObject->getMethodNumber()}" name="feeValue[{write:settleMethodObject->getMethodNumber()}]" size="5" value="{write:settleMethodObject->'feeValue'}"
				style="text-align:right;"{if:'0'==settleMethodObject->'feeType'} disabled="disabled"{/if}
				/><div id="feeUnit_{write:settleMethodObject->getMethodNumber()}" style="display:inline;">
				{if:'0'==settleMethodObject->'feeType'}
				{else-if:'1'==settleMethodObject->'feeType'}
				円
				{else-if:'2'==settleMethodObject->'feeType'}
				％
				{/if}
			</div>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			利用条件
		</th>
		<td>
			▼{write:SHOPPING_LABEL_ORDER}金額条件 ... 入力しない場合は条件なし<br />
			<input type="text" name="priceMinimum[{write:settleMethodObject->getMethodNumber()}]" size="5" style="text-align:right;"
				value="{write:settleMethodObject->'priceMinimum'}" />円以上<br />
			<input type="text" name="priceMaximum[{write:settleMethodObject->getMethodNumber()}]" size="5" style="text-align:right;"
				value="{write:settleMethodObject->'priceMaximum'}" />円以下<br />
			<br />
			▼利用可能な会員種別 ... 全てチェックを外すことはできません<br />
			{foreach:MEMBER_MEMBER_CLASS_HASH classNumber className}
			<input type="checkbox" id="memberClassArray_{write:settleMethodObject->getMethodNumber()}_{write:classNumber}"
				name="memberClassArray[{write:settleMethodObject->getMethodNumber()}][]"
				value="{write:classNumber}"
				{if:in_array(classNumber,settleMethodObject->'memberClassArray')} checked{/if}
			/><label for="memberClassArray_{write:settleMethodObject->getMethodNumber()}_{write:classNumber}" style="cursor:pointer;">{write:className}</label>
			{/foreach}
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			説明文<br />
			<span style="font-size:x-small;font-weight:100;">※HTML可</span>
		</th>
		<td>
			<textarea name="explanation[{write:settleMethodObject->getMethodNumber()}]" cols="60" rows="7" style="width:99%;"
				>{write:settleMethodObject->'explanation'}</textarea>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			確認ボタン前<br />
			注意書き<br />
			<span style="font-size:x-small;font-weight:100;">※HTML可</span>
		</th>
		<td>
			<textarea name="attention[{write:settleMethodObject->getMethodNumber()}]" cols="60" rows="7" style="width:99%;"
				>{write:settleMethodObject->'attention'}</textarea>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			サンキューメール用<br />
			個別コメント
		</th>
		<td>
			<textarea name="mailComment[{write:settleMethodObject->getMethodNumber()}]" cols="60" rows="7" style="width:99%;"
				>{write:settleMethodObject->'mailComment'}</textarea>
		</td>
	</tr>
	<tr>
		<th style="width:10em;white-space:nowrap;">
			発注メール用<br />
			個別コメント
		</th>
		<td>
			<textarea name="mailOrder[{write:settleMethodObject->getMethodNumber()}]" cols="60" rows="7" style="width:99%;"
				>{write:settleMethodObject->'mailOrder'}</textarea>
		</td>
	</tr>
	{foreach:settleMethodObject::settingLabels key settingName}
	<tr>
		<th style="width:10em;white-space:nowrap;">
			{write:settingName}
		</th>
		<td>
			<input type="text" name="settingValues[{write:settleMethodObject->getMethodNumber()}][{write:key}]" size="80" value="{write:settleMethodObject->'settingValues'[key]}" />
		</td>
	</tr>
	{/foreach}
	</tbody>
	</table>
	</div>
	<br />
<script language="JavaScript" type="text/javascript"><!--
function changeFeeType{write:settleMethodObject->getMethodNumber()}(){
	if( document.getElementById('feeType_{write:settleMethodObject->getMethodNumber()}_0').checked ) {
		document.getElementById('feeValue_{write:settleMethodObject->getMethodNumber()}').disabled = 'disabled';
		document.getElementById('feeUnit_{write:settleMethodObject->getMethodNumber()}').innerHTML	= '';
	} else if(document.getElementById('feeType_{write:settleMethodObject->getMethodNumber()}_1').checked) {
		document.getElementById('feeValue_{write:settleMethodObject->getMethodNumber()}').disabled = '';
		document.getElementById('feeUnit_{write:settleMethodObject->getMethodNumber()}').innerHTML	= '円';
	} else if(document.getElementById('feeType_{write:settleMethodObject->getMethodNumber()}_2').checked) {
		document.getElementById('feeValue_{write:settleMethodObject->getMethodNumber()}').disabled = '';
		document.getElementById('feeUnit_{write:settleMethodObject->getMethodNumber()}').innerHTML	= '％';
	}
	document.getElementById('feeValue_{write:settleMethodObject->getMethodNumber()}').value='0';
}
function shoppingSettingSettleChangeEnable{write:settleMethodObject->getMethodNumber()}(radioBox) {
	var targetBlock	= document.getElementById('shopping-setting-settlement-block-{write:settleMethodObject->getMethodNumber()}');
	if( targetBlock ) {
		if( radioBox.id == 'enable{write:settleMethodObject->getMethodNumber()}_0' && radioBox.checked ) {
			targetBlock.style.display	= 'block';
			targetBlock.style.visibility	= 'visible';
			targetBlock.style.display			= 'block';
			targetBlock.style.zIndex		= '10';
			targetBlock.style.position		= 'static';
		} else {
			targetBlock.style.display	= 'none';
			targetBlock.style.visibility	= 'hidden';
			targetBlock.style.display	= 'none';
			targetBlock.style.zIndex		= '-99';
			targetBlock.style.position		= 'absolute';
			targetBlock.style.top			= '0px';
			targetBlock.style.left			= '0px';
		}
	}
}
//--></script>
	{/foreach}
	
	
	<p style="text-align:center;">
		<input type="button" value="設定を保存する"
			onclick="shoppingSettingSettlementSave()"
			onkeypress="shoppingSettingSettlementSave()"
		/><br />
	</p>

	</form>
	
<script language="JavaScript" type="text/javascript"><!--
function shoppingSettingSettlementSave() {
	FormerCommon.executePostForm(document.mform, "shoppingSettingDeliverySaveResult()" );
}
function shoppingSettingDeliverySaveResult(){
	alert('保存しました');
}
//--></script>

	<hr style="width:96%;margin:0 auto;margin-top:1em;" />
	<div style="width:96%;margin:0 auto;text-align:right;">
		<a href="../../">&gt;&gt; {write:SHOPPING_LABEL_ORDER}一覧へ</a>
	</div>