{include "header.inc.html"}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>支付方式</strong><br />
		<span class="english">支付方式</span> </span>
		</div>
	</div>
<div class="brandForm">
<form class="form" action="{$adminUrl}paybank" method="post" id="paybankForm">
<input type="hidden" name="inajax" value="1" />
{if $smarty.get.act=="edit" || $smarty.get.act=="add"}
<input type="hidden" name="act" value="{$smarty.get.act}" />
{if $smarty.get.act=="edit"}
<input type="hidden" name="id" value="{$smarty.get.id}" />
{/if}
<div class="form-line"><label class="label">名称：</label><div class="element"><input type="text" class="text w200" name="name" value="{$paybankInfo.name}" /></div></div>
{serializetoform data=$paybankInfo.config}
<div class="form-line"><label class="label">Logo：</label><div class="element"><input type="text" class="text w200" name="logo" value="{$paybankInfo.logo}" /></div></div>
<div class="form-line">
<label class="label">描述：</label><div class="element"><textarea type="text" class="text w400" name="detail">{$paybankInfo.detail}</textarea></div>
</div>
<div class="form-line">
<label class="label">备注：</label><div class="element"><textarea type="text" class="text w400" name="remark">{$paybankInfo.remark}</textarea></div>
</div>
<div class="form-line">
<label class="label">是否启用：</label><div class="element"><input type="checkbox" name="iStatus" value="1"{if $paybankInfo.iStatus} checked{/if} /></div>
</div>
<div class="form-line">
<label class="label"></label><div class="element"><input type="submit" class="btn_sub" value="提交" /></div>
</div>
</form>
<script type="text/javascript">
$(function(){ $("#paybankForm").ajaxForm({ dataType:'json',success:function(json){ var icon='error';if(json.success){ icon='success'; };qlib.tips({ icon:icon,msg:json.message }); } }); });
</script>
</div>
 {else}
 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w60">编号</th><th class="w200">名称</th><th>描述</th><th class="w60">排序</th><th class="w60">状态</th><th class="w60">操作</th>
 </tr>
{paybank pager="false"}
<tr>
<td>{$item.id}</td><td>{$item.name}</td><td>{$item.detail}</td><td><span class="smodedit" width="30" name="sortId" sid="{$item.id}">{$item.sortId}</span></td><td><img class="smodtoggle" name="iStatus" sid="{$item.id}" src="{$baseUrl}static/images/{if $item.iStatus==1}yes{else}no{/if}.gif"></td><td><a href="{$adminUrl}paybank/act/edit/id/{$item.id}" class="modBtn">修改</a><a href="javascript:void(0)" class="delBtn" sid="{$item.id}">删除</a></td>
</tr>
{/paybank}
</table>
<div class="page">
	<div class="pagin fr">{pager allCount=$allCount url='/qkadmin/paybank/page/' number="false"}</div>
</div>
{/if}
</div><!--.content_box-->
<script type="text/javascript">
$(function(){
	$(".delBtn").click(function(){
		if(!confirm(lang[4])){ return false; }
		var id = $(this).attr("sid");
		var tr = $(this).parent("td").parent("tr");
		if(!id || !parseInt(id)){ return false; }
		$.ajax({
			type:"POST",
			url:"{$adminUrl}finance",
			data:"inajax=1&act=del&id="+id,
			dataType:"json",
			success:function(json){
				if(json.success){
					tr.slideUp().remove();
				}else{
					qlib.tips(json.message);
				}
			}
		})
	});
	$("select[name='typeId']").change(function(){
		var val = $(this).val();
		var amount = $("input[name='amount']").val();
		amount = amount.replace('-','');
		if(val==2){
			$("input[name='amount']").val('-'+amount);
		}else{
			$("input[name='amount']").val(amount);
		}
	});
});
</script>
{include "footer.inc.html"}