mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-24 08:28:46 +02:00
Phase 1 (en cours)
This commit is contained in:
66
server_files/classes/Phase.php
Normal file
66
server_files/classes/Phase.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
class Phase
|
||||
{
|
||||
const INSCRIPTION = 0;
|
||||
const PHASE1 = 1;
|
||||
const PHASE2 = 2;
|
||||
const PHASE3 = 3;
|
||||
const PHASE4 = 4;
|
||||
const END = 5;
|
||||
const BETWEEN_PHASES = 6;
|
||||
|
||||
public static function getCurrentPhase()
|
||||
{
|
||||
global $CONFIG;
|
||||
|
||||
$date = date("Y-m-d H:i:s");
|
||||
|
||||
if ($date < $CONFIG->getStartPhase1Date())
|
||||
return self::INSCRIPTION;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase1Date())
|
||||
return self::PHASE1;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase2Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase2Date())
|
||||
return self::PHASE2;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase3Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase3Date())
|
||||
return self::PHASE3;
|
||||
|
||||
if ($date < $CONFIG->getStartPhase4Date())
|
||||
return self::BETWEEN_PHASES;
|
||||
|
||||
if ($date < $CONFIG->getEndPhase4Date())
|
||||
return self::PHASE4;
|
||||
|
||||
return self::END;
|
||||
}
|
||||
|
||||
public static function getTranslatedName($phase)
|
||||
{
|
||||
switch ($phase)
|
||||
{
|
||||
case self::INSCRIPTION:
|
||||
return "Inscription";
|
||||
case self::PHASE1:
|
||||
return "Phase 1 (soumission des vidéos)";
|
||||
case self::PHASE2:
|
||||
return "Phase 2 (questions)";
|
||||
case self::PHASE3:
|
||||
return "Phase 3 (réponses)";
|
||||
case self::PHASE4:
|
||||
return "Phase 4 (vidéo de réponse)";
|
||||
case self::BETWEEN_PHASES:
|
||||
return "Entre deux phases";
|
||||
default:
|
||||
return "Le tournoi est terminé";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user