<style type="text/css">
span.pr{ margin:8px 0 0 10px; float:left; }
.tips{ padding:7px 0 5px 39px; margin:10px 0 0 0; background:#ECF7FD; color:#076BA3; }
</style>
<div class="lbox">
	<{uqcms m="account" v="row" c="withdraw_one:is_shop=1&id=smarty.get.id"}>
	<{if $row.id}>
		<{if $row.status == '1'}>
			<table class="etable"> 
				<tr>
					<td width="150">提现金额：</td>
					<td>￥<{$row.price}></td>
				</tr>
				<tr>
					<td>归属银行：</td>
					<td><{$row.pay_bank}></td>
				</tr> 
				<tr>
					<td>银行卡号：</td>
					<td><{$row.pay_account}></td>
				</tr>
				<tr>
					<td>支付姓名：</td>
					<td><{$row.pay_name}></td>
				</tr>
				<tr>
					<td>提现状态：</td>
					<td>提现成功</td>
				</tr>
			</table>
		<{elseif $row.status == '2'}>
			<form action="<{$__SELLER__}>bill/withdraw_save" method="post" id="form"> 
				<input type="hidden" name="id" value="<{$row.id}>"/>
				<table class="etable"> 
					<tr>
						<td width="150">银行名称： </td>
						<td>
							<{uqcms m="common" v="bank" c="category:name=bank"}>
							<select name="pay_bank" id="bank_id">
								<option value="0">---请选择银行---</option>
								<{foreach item=i key=k from=$bank}> 
									<option value="<{$k}>" <{if $i == $row.bank}>selected="selected"<{/if}>><{$i}></option>
								<{/foreach}>
							</select>
						</td>
					</tr>
					<tr>
						<td>银行卡号： </td>
						<td><input type="text" name="account" size="35" value="<{$row.account}>"/></td>
					</tr> 
					<tr>
						<td>收款人姓名： </td>
						<td><input type="text" name="name" size="35" value="<{$row.name}>"/></td>
					</tr> 
					<tr>
						<td>提现金额： </td>
						<td>￥<{$row.price}></td>
					</tr> 
					<tr>
						<td>申请备注：</td>
						<td><input type="text" name="remark" size="35" value="<{$row.remark}>"/></td>
					</tr>
				</table>
			</form>
		<{else}>
			<div class="tips">提示：您的申请已经提交，请等待处理结果。</div> 
		<{/if}>  
	<{else}>
		<{uqcms m="shop" v="sprow" c="get_one:id=auto"}>
		<form action="<{$__SELLER__}>bill/withdraw_save" method="post" id="form"> 
			<table class="etable"> 
				<tr>
					<td width="130">银行名称： </td>
					<td>
						<{uqcms m="common" v="bank" c="category:name=bank"}>
						<select name="bank_id" id="bank_id">
							<option value="0">---请选择银行---</option>
							<{foreach item=i key=k from=$bank}>
								<option value="<{$k}>"><{$i}></option>
							<{/foreach}>
						</select>
					</td>
				</tr>
				<tr> 
					<td>银行卡号：</td>
					<td><input type="text" name="account" size="35" value="<{$row.pay_account}>"/></td>
				</tr> 
				<tr>
					<td>收款人姓名：</td>
					<td><input type="text" name="name" size="35" value="<{$row.pay_name}>"/></td>
				</tr>  
				<tr>
					<td>提现金额：</td>
					<td><input type="text" name="price" size="35" value="<{$row.price}>" placeholder="最多提现￥<{$sprow.price}>"/></td>
				</tr> 
				<tr>
					<td>申请备注：</td>
					<td><input type="text" name="remark" size="35" value="<{$row.remark}>"/></td>
				</tr>
			</table>
		</form>
	<{/if}> 
</div>
<script type="text/javascript">
function ajax_submit(){ 
	bank_id = $("#bank_id option:selected").val(); 
	if(bank_id == '0'){
		$.alert('请选择银行'); return;
	}
	account = $("input[name='account']").val();
	name = $("input[name='name']").val();
	price = $("input[name='price']").val();
	remark = $("input[name='remark']").val(); 
	$.post('<{$__SELLER__}>bill/withdraw_save', {<{if $row.id}> id:'<{$row.id}>',<{/if}> bank_id:bank_id, account:account, name:name, price:price, remark:remark}, function(result){ 
		data = jQuery.parseJSON(result); 
		if(data.error == '0'){
			$.alert('申请成功');
			location.reload(); 
		}else{
			$.alert(data.msg);
		}	
	}); 
}
</script>