server/onyx/tpl/bootstrap/summary.tpl

51 lines
1.3 KiB
Smarty

<table class="table" style="font-size: 14px; padding: 10px; margin-bottom: 10px;">
<thead>
<tr>
<th style="font-size: 30px">{$my_team->get_name()|replace:"_":" "}</th>
{for $i=1 to $nbExoMax}
<th class="text-center">Exercice {$i}</th>
{/for}
<th class="text-center">Points</th>
</tr>
</thead>
<tbody>
{$total=0}
{foreach from=$themes item=theme}
<tr>
<th>{$theme->get_name()}</th>
{$sum=0}
{$cpt=0}
{$themeID=$theme->get_id()}
{$solved_exercices=$my_team->get_solved_exercices($themeID)}
{foreach from=$theme->get_exercices_ordered() item=exo}
{$pts=0}
{for $i=0 to $nbExoMax}
{if !empty($solved_exercices.$i)}
{if $solved_exercices.$i->get_id() == $exo->get_id()}
{$pts=$solved_exercices.$i->points}{$sum=$sum + $pts}
{/if}
{/if}
{/for}
{if $pts > 0}
<td class="success text-center">{$pts}</td>
{else}
<td class="danger text-center">{$pts}</td>
{/if}
{$cpt=$cpt+1}
{/foreach}
{for $i=$cpt to $nbExoMax-1}
<th></th>
{/for}
<th class="active text-center">{$sum}</th>
</tr>
{$total=$total+$sum}
{/foreach}
</tbody>
<tfoot>
<tr>
<th colspan="{$nbExoMax+1}" style="text-align: right; font-size: 30px">Total :</th>
<th class="active text-center" style="font-size: 30px">{$total}</th>
</tr>
</tfoot>
</table>