Beispiel #1
0
     $content_tpl->parse("H_RESULTS", "B_RESULTS");
 } elseif ($_REQUEST['opt'] == "lb" and $season['double_elimination'] != "") {
     // LB
     // Set the lb_round names
     $num_lb_rounds = getNumLBRounds($season);
     for ($i = 0; $i <= $num_lb_rounds; ++$i) {
         $counter_lb_player[$i] = 0;
         $counter_lb_match[$i] = 1;
         $content_tpl->set_var("I_ROUND", $i + 1);
         // Deadline
         $content_tpl->set_var("H_LB_ACTUAL_ROUND", "");
         $content_tpl->set_var("H_LB_DEADLINE", "");
         $lb_round = $i + 1;
         $deadline_ref = dbQuery("SELECT * FROM `{$cfg['db_table_prefix']}deadlines` " . "WHERE `id_season` = {$season['id']} AND `round` = 'lb{$lb_round}'");
         if ($deadline_row = dbFetch($deadline_ref)) {
             if (isAfterPreDeadline($season, "lb", $i + 1) and isBeforePostDeadline($season, "lb", $i + 1)) {
                 $content_tpl->parse("H_LB_ACTUAL_ROUND", "B_LB_ACTUAL_ROUND");
             }
             $content_tpl->set_var("I_DEADLINE", htmlspecialchars($deadline_row['deadline']));
             $content_tpl->parse("H_LB_DEADLINE", "B_LB_DEADLINE");
         }
         $content_tpl->parse("H_LB_ROUND", "B_LB_ROUND", true);
     }
     // Calculate the order of the lb_rounds
     $order_lb_rounds = array(1);
     for ($i = 1; $i <= $num_lb_rounds / 2; ++$i) {
         $order_lb_rounds = array_merge(array($i * 2), array($i * 2 + 1), $order_lb_rounds, array($i * 2), $order_lb_rounds);
     }
     // Set the matches
     foreach ($order_lb_rounds as $round) {
         $matchkey = "lb-" . $round . "-" . $counter_lb_match[$round - 1];
Beispiel #2
0
     $content_tpl->set_var("I_MATCH", $matches_row['match']);
     if ($matches_row['id_player1'] > 0) {
         $users_ref = dbQuery("SELECT * FROM `{$cfg['db_table_prefix']}users` WHERE `id` = {$matches_row['id_player1']}");
         $users_row = dbFetch($users_ref);
         $content_tpl->set_var("I_PLAYER1", htmlspecialchars($users_row['username']));
     } else {
         $content_tpl->set_var("I_PLAYER1", "-");
     }
     if ($matches_row['id_player2'] > 0) {
         $users_ref = dbQuery("SELECT * FROM `{$cfg['db_table_prefix']}users` WHERE `id` = {$matches_row['id_player2']}");
         $users_row = dbFetch($users_ref);
         $content_tpl->set_var("I_PLAYER2", htmlspecialchars($users_row['username']));
     } else {
         $content_tpl->set_var("I_PLAYER2", "-");
     }
     if (isAfterPreDeadline($season, $matches_row['bracket'], $matches_row['round'])) {
         $content_tpl->set_var("I_ID_SEASON", $season['id']);
         $content_tpl->set_var("I_ID_MATCH", $matches_row['id']);
         $unreported_matches = true;
         $content_tpl->parse("H_UNREPORTED_MATCH", "B_UNREPORTED_MATCH", true);
     }
 }
 if (!$unreported_matches) {
     $content_tpl->parse("H_NO_UNREPORTED_MATCHES", "B_NO_UNREPORTED_MATCHES");
 } else {
     $content_tpl->parse("H_UNREPORTED_MATCHES", "B_UNREPORTED_MATCHES");
 }
 $content_tpl->parse("H_OVERVIEW_UNREPORTED_MATCHES", "B_OVERVIEW_UNREPORTED_MATCHES");
 // Confirmed matches
 $matches_ref = dbQuery("SELECT * FROM `{$cfg['db_table_prefix']}matches` " . "WHERE `id_season` = {$season['id']} " . "AND `confirmed` <> '0000-00-00 00:00:00' " . "ORDER BY `bracket` ASC, `round` DESC, `match` ASC");
 if (dbNumRows($matches_ref) <= 0) {