<div style="width: 95%; border:none; margin-right: auto; margin-left: auto; margin-bottom: 20px; ">
<h3>财务收入</h3>
<table width="100%" border = 1>
	<tr>
		<td colspan=6><center><?php echo $race_title;?>收入情况</center></td>
	</tr>
	<tr>
		<td>组别名称</td>
		<td>费用</td>
		<td>付款人数</td>
		<td>总金额</td>
		<td>支出<hr/>手续费(0.6%)</td>
		<td>收入</td>
	</tr>
	<?php 
	if($group)
	{
		$sum_pay = 0;
		foreach($group as $row)
		{
			$pay=$race->get_pay_count(2,$row['id']);
			$sum_pay = $sum_pay + $pay;
			?>
			<tr>
			<td>
				<?php echo $row['title'];?>
			</td>
			
			<td>
				<?php echo $row['price'];?>
			</td>
			<td>
				<?php echo $race->get_pay_count(1,$row['id']);?>
			</td>
			
			<td>
				<?php echo $pay;?>
			</td>			
			<td>
				<?php echo $pay*0.006;?>
			</td>
			<td>
				<?php echo $pay*(1-0.006);?>
			</td>
			</tr>
			<?php
		}
	}
	?>
	<tr>
	<td>
		</td>
		<td>
		</td>
		<td>
		</td>
		<td>
			总收入：<?php echo $sum_pay?>
		</td>
		
		<td>
			总支出：<?php echo $sum_pay*0.006?>
		</td>
		
		<td>
			最终收入：<?php echo $sum_pay*(1-0.006)?>
		</td>
	</tr>
</table>	
<br/>
<a href="index.php?c=race&action=race_financial&race_id=<?php echo $id?>&excel=1" class="btn" style="width:100%">下载</a>
</div>
