{include file="$admin_template_path/html/header.html"}
</head>
<body>
{include file="$admin_template_path/html/pagetops.html"}
{if $errorMessage}
<div id="errormsg">
<div class="msg">
  <div class="closebtn"><i data-icon="" class="icon-close"></i></div>
  {$errorMessage}
</div>
</div>
{literal}
<script type="text/javascript">
seajs.use(["modules/pageui/msg"], function(msg){
    msg.msginit("#errormsg");
});
</script>
{/literal}
{/if}

<div class="pagebg">
  	<div class="mcontent pagemain clr">
	    {include file="$admin_template_path/html/leftmenu.html"}
	    <div class="pagemainconent{if $paging !=""} paging{/if}">
	  
		{if $paging !=""}
		<div class="page-controls">
			{$paging}
		</div>
		{/if}
		<div class="rightdetail_admin">
			{if is_array($data)}
		   	<div class="general_table_border">
				<table id="withdrawlist" class="general_table" cellspacing="0" cellpadding="0" border="0">
					<thead>
						<tr>
							<th>用户</th>
							<th>当前收入</th>
							<th>提现额</th>
							<th>提现方式</th>
							<th>邮件账号</th>
							<th>请求日期</th>
							<th>是否已处理</th>
							<th width="150">操作</th>
						</tr>
					</thead>

					<tbody>
					{foreach from=$data item=d}
						<tr id="row{$d.id}" class="{cycle values="no,alt"}">
							<td>{$users[$d.user_id].username}</td>
							<td>{$currency.symbol} {$users[$d.user_id].earning|string_format:"%.2f"}</td>
							<td>
								{if !is_numeric($d.amount)}
									{$d.amount}
								{else}
									{$currency.symbol} {$d.amount|string_format:"%.2f"}
								{/if}
							</td>
							<td>{$d.method}</td>
							<td>{$d.text|nl2br}</td>
							<td>{$d.datetime|date_format:"%Y-%m-%d"}</td>
							<td>
								{if $d.paid == 'true'}
									<img src="{$template_data}admin/images/icons/24x24/accept.png" alt="" class="middle" />

									{$d.paid_datetime|date_format:"%Y-%m-%d"}
								{else}
									<img src="{$template_data}admin/images/icons/24x24/delete.png" alt="" class="middle" />
								{/if}
							</td>
							<td>
								{if $d.paid == 'false'}
									<a href="?m={$smarty.get.m}&c=pay&id={$d.id}" title="处理"><img class="middle" src="{$template_data}admin/images/icons/16x16/edit.png" />处理</a>
									<a class="deletebtn" ajax-url="/apps/{$smarty.get.m}/ajax/delete.php" item-id="{$d.id}" href="javascript:void(0);" title="删除"><i class="fa fa-trash-o text-danger m-r-xs"></i> 删除</a>
								{/if}
							</td>
						</tr>
						{/foreach}
					</tbody>
				</table> 
			</div>
			{literal}
			<script type="text/javascript">
			seajs.use(["modules/ajax/btns"], function(aj){
			  aj.deletebtninit("#withdrawlist .deletebtn", "ajax-url", "item-id", {'deleteWithdraw':true,'id':''}, "deleteRow");
			});
			</script>
			{/literal}
			{else}
				暂无记录
			{/if}
			</div>
		</div>
		
		</div>
	</div>
</div>
</body>
</html>