{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 headtools{if $paging !=""} paging{/if}">

		<div class="headtool b-b clr">
			<div class="toolsearch clr rf">
				<form class="sort-control" method="post" action="?m={$smarty.get.m}&c={$smarty.get.c}">
					<button type="submit" class="btntheme btnsize rf">搜索</button>
					<input class="ipttheme rf" type="text" id="q" name="q" placeholder="开始搜索...">
				</form>
			</div>
		</div>
		{if $paging !=""}
		<div class="page-controls">
			{$paging}
		</div>
		{/if}
		<div class="rightdetail_admin">
			{if is_array($data)}
			<div class="general_table_border">
				<table id="generlist" class="general_table" cellspacing="0" cellpadding="0" border="0">
					<thead>
						<tr>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=name&dir={$orderDir}" title="">用户名</a></th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=money&dir={$orderDir}" title="">当前余额</a></th>
							<th>分成比例</th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=items&dir={$orderDir}" title="">作品数量</a></th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=sales&dir={$orderDir}" title="">销量</a></th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=sold&dir={$orderDir}" title="">收入</a></th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=referals&dir={$orderDir}" title="">推广数</a></th>
							<th><a href="?m={$smarty.get.m}&c={$smarty.get.c}&p={$smarty.get.p}&q={$smarty.get.q}&order=referal_money&dir={$orderDir}" title="">推广收入</a></th>
							<th>是否推荐作者</th>
							<th width="300">操作</th>
						</tr>
					</thead>

					<tbody>
					{foreach from=$data item=d}
						<tr id="row{$d.user_id}" class="{cycle values="no,alt"}">
							<td>{$d.username}</td>
							<td class="ta-right">{$currency.symbol}{$d.total|string_format:"%.2f"}</td>
							<td class="ta-right">{$d.commission} %</td>
							<td><a href="?m=items&c=list&user={$d.user_id}" title="">{$d.items}</a></td>
							<td>{$d.sales}</td>
							<td class="ta-right">{$currency.symbol}{$d.sold|string_format:"%.2f"}</td>
							<td>{$d.referals}</td>
							<td class="ta-right">{$currency.symbol}{$d.referal_money|string_format:"%.2f"}</td>
							<td>
								{if $d.featured_author == 'true'}
									<img src="{$template_data}admin/images/icons/24x24/accept.png" alt="" class="middle" />
								{else}
									<img src="{$template_data}admin/images/icons/24x24/delete.png" alt="" class="middle" />
								{/if}
							</td>
							<td>
								<a href="?m={$smarty.get.m}&c=balance&id={$d.user_id}" title="编辑余额"><i class="fa fa-edit text-success m-r-xs"></i> 编辑余额</a>
								<a href="?m={$smarty.get.m}&c=edit&id={$d.user_id}" title="编辑用户"><i class="fa fa-edit text-success m-r-xs"></i> 编辑用户</a>
								<a class="deletebtn" ajax-url="/apps/{$smarty.get.m}/ajax/delete.php" item-id="{$d.user_id}" href="javascript:void(0);" title="删除用户"><i class="fa fa-trash-o text-danger m-r-xs"></i> 删除用户</a>
							</td>
						</tr>
					{/foreach}
					</tbody>
				</table>
			</div>
			{literal}
			<script type="text/javascript">
			seajs.use(["modules/ajax/btns"], function(aj){
			  aj.deletebtninit("#generlist .deletebtn", "ajax-url", "item-id", {'deleteUser':true,'id':''}, "deleteRow");
			});
			</script>
			{/literal}
			{else}
				暂无记录
			{/if}
		</div>
		
		</div>
	</div>
</div>
</body>
</html>