Merge branch 'master' of ssh://git.nemunai.re:6224/fic2014-server

Conflicts:
	onyx/include/team/exercice.php
	onyx/tpl/bootstrap/teams/exercice.tpl
This commit is contained in:
Li Chen 2013-11-05 04:52:17 +01:00
commit a0657ff619
4 changed files with 31 additions and 2 deletions

View File

@ -105,7 +105,7 @@ else
{
$TEAM = intval(substr($p[0], 0, strpos($p[0], "-")));
$page = require("public/team.php");
$page = require("public/score.php");
}
}

View File

@ -189,11 +189,15 @@ class Team
return $array;
}
public static function get_top()
public static function get_top($nb=0)
{
$teams = Team::get_teams();
usort($teams, "cmp_team_pts");
if ($nb != 0)
$teams = array_slice($teams, 0, $nb);
return $teams;
}

View File

@ -6,6 +6,15 @@ try
{
$exercice = new Exercice($EXERCICE);
//TOP10
// $template->assign("top10", Team::get_top(10));
//
// //RANK
// $template->assign("my_team", new Team($TEAM));
//
// //BEGIN LISTING THEMES
// $template->assign("themes", Theme::get_themes());
if (!isset($exercice->id))
return "404";

View File

@ -36,4 +36,20 @@
</form>
</ul>
<ol>
{foreach from=$top10 item=team key=pos}
<li>{$team->get_name()} <small>({$team->get_pts()})</small></li>
{/foreach}
</ol>
<div id="my_team">
{$my_team->get_rank(10)}/{Team::get_nbTeams()}
</div>
<div id="theme_list">
{foreach from=$themes item=theme key=k}
<strong>{$theme->get_name()}</strong><br>
{$my_team->get_nbResExercisesByTheme($theme->get_id())}/{$theme->get_nbExercices()}<br>
{/foreach}
</div>
{/block}