server/onyx/include/team/summary.php
Li Chen 4f2dbf5470 Add progress bar in the me page
Fixed class panel-body name in the me.tpl
2013-11-28 17:03:14 +01:00

24 lines
575 B
PHP

<?php
if(!defined('ONYX')) exit;
$themes = Theme::get_themes();
if (!empty($themes))
{
$max_exo = 0;
$res_exo = 0;
foreach($themes as $th)
{
$max_exo += $th->get_nb_exercices();
//$res_exo += $TEAM->get_nb_res_exercices_by_theme($th->get_id());
$res_exo += count($TEAM->get_solved_exercices($th->get_id()));
}
$percent = $res_exo * 100 / $max_exo;
}
$template->assign("themes", Theme::get_themes());
$template->assign("nbExoMax", Exercice::get_nb_exo_max());
$template->assign("percent", $percent);
return "teams/summary";