You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

53 lines
1.8 KiB

<div class="container">
<hr>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<?php $total=0; $totalmax=0; ?>
<table class="table table-condensed ">
<thead>
<tr>
<th>Spelgebied</th>
<th>Onderdeel</th>
<th>Score</th>
<th>Maximaal</th>
<th>Percentage</th>
</tr>
</thead>
<tbody>
<?php foreach ($scores as $spelgebied) { ?>
<tr>
<td><strong><?php echo $spelgebied['naam']; ?></strong></td>
<?php $scoretot=0;
$scoremaxtot=0;
foreach ($spelgebied['onderdeel'] as $onderdeel) { ?>
<td><?php echo $onderdeel['naam']; ?></td>
<td class="text-right"><?php echo $onderdeel['score']; $scoretot = $scoretot + $onderdeel['score']; ?></td>
<td class="text-right"><?php echo $onderdeel['scoremax']; $scoremaxtot = $scoremaxtot + $onderdeel['scoremax']; ?></td>
<td class="text-right"><?php echo round(($onderdeel['score']/$onderdeel['scoremax'])*100, 0)."%"; ?></td>
</tr>
<tr>
<td></td>
<?php $total=$total+$onderdeel['score'];
$totalmax=$totalmax+$onderdeel['scoremax'];
} ?>
<td class="active"><strong>Subtotaal:</strong></td>
<td class="text-right active"><strong><?php echo $scoretot; ?></strong></td>
<td class="text-right active"><strong><?php echo $scoremaxtot; ?></strong></td>
<td class="text-right active"><strong><?php echo round(($scoretot/$scoremaxtot)*100, 0); ?>%</strong></td>
</tr>
<?php } ?>
</tbody>
<thead>
<tr class="active">
<th></th>
<th>Totaal:</th>
<th class="text-right"><?php echo $total; ?></th>
<th class="text-right"><?php echo $totalmax; ?></th>
<th class="text-right"><?php echo round(($total/$totalmax)*100, 0); ?>%</th>
</tr>
</thead>
</table>
</div>
</div
</div>