server/onyx/tpl/bootstrap/summary.tpl

46 lines
1.1 KiB
Smarty
Raw Normal View History

2013-11-08 14:47:55 +00:00
<table class="table">
<thead>
<tr>
<th></th>
{for $i=1 to $nbExoMax}
2013-11-08 17:59:45 +00:00
<th class="text-center">Exercice {$i}</th>
2013-11-08 14:47:55 +00:00
{/for}
2013-11-08 17:59:45 +00:00
<th class="text-center">Points</th>
2013-11-08 14:47:55 +00:00
</tr>
</thead>
<tbody>
{$total=0}
{foreach from=$themes item=theme}
<tr>
<th>{$theme->get_name()}</th>
{$sum=0}
{$themeID=$theme->get_id()}
2013-11-12 15:52:50 +00:00
{$solved_exercices=$my_team->get_solved_exercices($themeID)}
{foreach from=$theme->get_exercices_ordered() item=exo}
2013-11-08 14:47:55 +00:00
{$pts=0}
{for $i=0 to $nbExoMax}
2013-11-12 15:52:50 +00:00
{if !empty($solved_exercices.$i)}
{if $solved_exercices.$i->get_id() == $exo->get_id()}
{$pts=$solved_exercices.$i->points}{$sum=$sum + $pts}
2013-11-08 14:47:55 +00:00
{/if}
{/if}
{/for}
2013-11-08 17:59:45 +00:00
{if $pts > 0}
<td class="success text-center">{$pts}</td>
{else}
<td class="danger text-center">{$pts}</td>
{/if}
2013-11-08 14:47:55 +00:00
{/foreach}
2013-11-08 17:59:45 +00:00
<th class="active text-center">{$sum}</th>
2013-11-08 14:47:55 +00:00
</tr>
{$total=$total+$sum}
{/foreach}
</tbody>
<tfoot>
<tr>
<th colspan="{$nbExoMax+1}" style="text-align: right">Total :</th>
2013-11-08 17:59:45 +00:00
<th class="active text-center">{$total}</th>
2013-11-08 14:47:55 +00:00
</tr>
</tfoot>
</table>