<?
/**
 * 代金券使用
 * $Id: user_use_coupon_list.inc,v 1.1
 * @author taocy
 * @package src.admin.templates
 */
?>
<b>支付宝支付列表</b><br /><br />
<div style="text-align:center;float: right;font-size:18px;">共<?=$total_count ?>件记录</div>
<div style="clear:both"></div>
<!--page end-->
<div id="result_list">
<?
if ($total_count > 0) {
?>
<table>
<tr>
	<th class="contents_title" width="4%">ID</th>
	<th class="contents_title" width="10%">支付时间</th>
	<th class="contents_title" width="12%">交易编号</th>
	<th class="contents_title" width="10%">姓名</th>
	<th class="contents_title" width="10%">手机号码</th>
	<th class="contents_title" width="20%">课程名称</th>
	<th class="contents_title" width="5%">支付方法</th>
	<th class="contents_title" width="5%">金额</th>
	<th class="contents_title"  width="10%">状态</th>
</tr>

<?
	foreach($user_buy_course_list as $tmp) {
		//用户资料
		$user = UserMst::getById($tmp->user_id);
		//课程名称
		$course_dat = CourseMst::getById($tmp->course_id);
		//状态
		$status_title = OrderStatus::getTitleByName($tmp->status);
		//支付方法
		$alipay_trade_no = $tmp->alipay_trade_no;
		$pay_type_title = "支付宝";
		if($tmp->pay_type=="HBFQ") {
			$pay_type_title = "花呗分期";
		}
		
		//是否显示确认收款
		$show_change_status_button = false;
		if(checkAuthority("ADMIN,MANAGER") && $tmp->status == "PAYED") {
			$show_change_status_button = true;
		}
?>
<tr>
    <td align="center"><?=$tmp->id ?></td>
    <td align="center"><?=$tmp->registration_date ?></td>
	<td align="center"><?=$tmp->alipay_trade_no ?></td>
    <td align="center"><?=$user->nickname ?></td>
	<td align="center"><?=$user->mobile ?></td>
	<td align="left"><?=$course_dat->title ?></td>
	<td align="center"><?=$pay_type_title ?></td>
	<td align="center"><?=$tmp->price ?></td>
	<td align="center">
		<?=$status_title ?>
		<?
			if($show_change_status_button) {
		?>
			<a class="flatbutton" onClick="confirmPay('<?=$tmp->id ?>');">确认收款</a>
		<?
			}
		?>
	</td>
</tr>
<?
    }
?>
</table>

<?
} else {
    echo '<div align="center"><font color="red">暂无数据……</font></div>';
}
?>
</div>