Exemplo n.º 1
0
 public static function getGameStatus(\tailgate\Resource\Game $game)
 {
     $color = null;
     $status = null;
     $gamevars = $game->getStringVars();
     $gameinfo = '<p>' . $gamevars['university'] . '<br />' . $gamevars['mascot'] . '<br />' . $gamevars['kickoff_format'] . '</p>';
     $now = time();
     $start = $game->getSignupStart();
     $end = $game->getSignupEnd();
     $pickup = $game->getPickupDeadline();
     $kickoff = $game->getKickoff();
     if ($start > $now) {
         $status = 'Signup starts on ' . strftime(TAILGATE_TIME_FORMAT, $start) . ', ' . strftime(TAILGATE_DATE_FORMAT, $start);
         $color = 'info';
     } elseif ($end > $now) {
         $status = 'Signup available until ' . strftime(TAILGATE_TIME_FORMAT, $end) . ', ' . strftime(TAILGATE_DATE_FORMAT, $end);
         $color = 'success';
     } elseif ($pickup > $now) {
         if ($game->getLotteryRun()) {
             $status = 'Lottery complete. Winners may pick up tickets until ' . strftime(TAILGATE_TIME_FORMAT, $pickup) . ', ' . strftime(TAILGATE_DATE_FORMAT, $pickup);
             $color = 'danger';
         } else {
             $status = 'Lottery to be run soon! Check back later to see if you won.';
             $color = 'warning';
         }
     } elseif ($kickoff > $now) {
         $status = 'Lottery process complete. Pickup deadline has passed. Unclaimed spaces offered on first come, first serve basis.';
         $color = 'info';
     } else {
         $gameinfo = null;
         $status = 'No game currently scheduled';
         $color = 'success';
     }
     $gameinfo .= "<div style='white-space:normal' class='alert alert-{$color}'>{$status}</div>";
     return $gameinfo;
 }
Exemplo n.º 2
0
 private function sendLoserEmail($lottery, \tailgate\Resource\Game $game)
 {
     $variables = $game->getStringVars();
     $tpl = new \Template();
     $tpl->setModuleTemplate('tailgate', 'Admin/Lottery/Loser.html');
     $tpl->addVariables($variables);
     $content = $tpl->get();
     $this->sendEmail('Tailgate unsuccessful', $lottery['student_id'], $content);
 }