function OnPageLoad()
    {
        echo "<h1>Statistics for " . Html::Encode($this->competition->GetName()) . ", All seasons</h1>";
        require_once "_summary-data-found.php";
        require_once 'xhtml/navigation/tabs.class.php';
        $tabs = array('Summary' => $this->season->GetNavigateUrl());
        if ($this->season->MatchTypes()->Contains(MatchType::LEAGUE)) {
            $tabs['Table'] = $this->season->GetTableUrl();
        }
        if (count($this->season->GetTeams())) {
            $tabs['Map'] = $this->season->GetMapUrl();
        }
        $tabs['Statistics'] = '';
        echo new Tabs($tabs);
        ?>
        <div class="box tab-box">
            <div class="dataFilter"></div>
            <div class="box-content">
        <?php 
        if (!$has_player_stats) {
            echo "<p>There aren't any statistics for the " . htmlentities($this->competition->GetName(), ENT_QUOTES, "UTF-8", false) . ' yet.</p>
			<p>To find out how to add them, see <a href="/play/manage/website/matches-and-results-why-you-should-add-yours/">Matches and results - why you should add yours</a>.</p>';
        } else {
            require_once "_summary-controls.php";
        }
        # Check for other seasons. Check is >2 becuase current season is there twice - added above
        if (count($this->competition->GetSeasons()) > 2) {
            require_once "stoolball/season-list-control.class.php";
            echo new XhtmlElement('h2', 'Statistics by season');
            $season_list = new SeasonListControl($this->competition->GetSeasons());
            $season_list->SetUrlMethod('GetStatisticsUrl');
            echo $season_list;
        }
        ?>
        </div>
        </div>
        <?php 
    }
 private function ShowOtherSeasons()
 {
     # Check for other seasons. Check is >2 because current season is there twice - added above
     if (count($this->competition->GetSeasons()) > 2) {
         require_once "stoolball/season-list-control.class.php";
         echo new XhtmlElement('h2', 'Other seasons in the ' . Html::Encode($this->competition->GetName()), "screen");
         $season_list = new SeasonListControl($this->competition->GetSeasons());
         $season_list->SetExcludedSeasons(array($this->season));
         $season_list->AddCssClass("screen");
         $season_list->SetUrlMethod('GetMapUrl');
         echo $season_list;
     }
 }
    function OnPageLoad()
    {
        echo "<h1>Statistics for " . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . "</h1>";
        require_once "_summary-data-found.php";
        require_once 'xhtml/navigation/tabs.class.php';
        $tabs = array('Summary' => $this->season->GetNavigateUrl());
        if ($this->season->MatchTypes()->Contains(MatchType::LEAGUE)) {
            $tabs['Table'] = $this->season->GetTableUrl();
        }
        if (count($this->season->GetTeams())) {
            $tabs['Map'] = $this->season->GetMapUrl();
        }
        $tabs['Statistics'] = '';
        echo new Tabs($tabs);
        ?>

        <div class="box tab-box">
            <div class="dataFilter"></div>
            <div class="box-content">
        <?php 
        if (!$has_player_stats) {
            echo "<p>There aren't any statistics for the " . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . ' yet.</p>
			<p>To find out how to add them, see <a href="/play/manage/website/matches-and-results-why-you-should-add-yours/">Matches and results - why you should add yours</a>.</p>' . "<p>You can also view the <a href=\"" . htmlentities($this->season->GetNavigateUrl(), ENT_QUOTES, "UTF-8", false) . "\">" . htmlentities($this->season->GetCompetitionName(), ENT_QUOTES, "UTF-8", false) . " page</a>.</p>";
        } else {
            require_once "_summary-controls.php";
        }
        # Check for other seasons. Check is >2 becuase current season is there twice - added above
        if (count($this->competition->GetSeasons()) > 2) {
            require_once "stoolball/season-list-control.class.php";
            echo new XhtmlElement('h2', htmlentities('More statistics for the ' . $this->competition->GetName(), ENT_QUOTES, "UTF-8", false));
            $season_list = new SeasonListControl($this->competition->GetSeasons());
            $season_list->SetExcludedSeasons(array($this->season));
            $season_list->SetUrlMethod('GetStatisticsUrl');
            # Override XHTML to add link to competition stats
            $season_list_xhtml = $season_list->__toString();
            $season_list_xhtml = str_replace("<ul>", "<ul><li><a href=\"" . htmlentities($this->competition->GetStatisticsUrl(), ENT_QUOTES, "UTF-8", false) . "\">All seasons</a></li>", (string) $season_list_xhtml);
            echo $season_list_xhtml;
        }
        ?>
        </div>
        </div>
        <?php 
    }
   function OnPageLoad()
   {
       require_once 'xhtml/navigation/tabs.class.php';
       require_once 'stoolball/season-list-control.class.php';
       /* @var $season Season */
       $season = $this->competition->GetWorkingSeason();
       echo new XhtmlElement('h1', Html::Encode($this->GetPageTitle()));
       $tabs = array('Summary' => $season->GetNavigateUrl());
       $tabs['Table'] = '';
       if (count($season->GetTeams())) {
           $tabs['Map'] = $season->GetMapUrl();
       }
       $tabs['Statistics'] = $season->GetStatisticsUrl();
       echo new Tabs($tabs);
       ?>
       <div class="box tab-box">
           <div class="dataFilter"></div>
           <div class="box-content">
 
       <?php 
       # Add matches
       $a_matches = $season->GetMatches();
       # Add teams
       $a_teams = $season->GetTeams();
       $no_content = true;
       if (count($a_teams) > 0) {
           # Check whether there's at least one league match to show a league table for
           $has_league_match = 0;
           foreach ($a_matches as $match) {
               /* @var $match Match */
               if ($match->GetMatchType() == MatchType::LEAGUE) {
                   $has_league_match = true;
                   break;
               }
           }
           if ($season->GetShowTable() and $has_league_match) {
               require_once 'stoolball/season-table.class.php';
               echo new SeasonTable($this->GetSettings(), $season);
               $no_content = false;
           }
       }
       # Add results
       if ($season->GetResults()) {
           $s_results = htmlentities($season->GetResults(), ENT_QUOTES, "UTF-8", false);
           $s_results = XhtmlMarkup::ApplyCharacterEntities($s_results);
           $s_results = XhtmlMarkup::ApplyParagraphs($s_results);
           $s_results = XhtmlMarkup::ApplyLinks($s_results);
           $s_results = XhtmlMarkup::ApplyLists($s_results);
           $s_results = XhtmlMarkup::ApplySimpleTags($s_results);
           $s_results = XhtmlMarkup::ApplyTables($s_results);
           echo $s_results;
           $no_content = false;
       }
       if ($no_content) {
           ?>
           <img class="screenshot" src="/images/features/league-table.png" alt="Example league table" width="308" />
           <p>There's no league table for this season yet.</p>
           <p>You can have your league table updated automatically by adding your matches
               and results to this website. Find out about <a href="/play/manage/website/league-tables/">league tables &#8211; how they work</a>.</p>
           <?php 
       }
       # Check for other seasons. Check is >2 becuase current season is there twice - added above
       if (count($this->competition->GetSeasons()) > 2) {
           require_once "stoolball/season-list-control.class.php";
           echo new XhtmlElement('h2', 'Other seasons in the ' . htmlentities($this->competition->GetName(), ENT_QUOTES, "UTF-8", false), "screen");
           $season_list = new SeasonListControl($this->competition->GetSeasons());
           $season_list->SetExcludedSeasons(array($this->season));
           $season_list->AddCssClass("screen");
           $season_list->SetUrlMethod('GetTableUrl');
           echo $season_list;
       }
       ?>
       </div>
       </div>
       <?php 
       $this->ShowSocial();
   }