public function __construct(array $performance_data, $first_result = 1) { $this->performance_data = $performance_data; $this->first_result = (int) $first_result; parent::XhtmlTable(); $this->SetCssClass("bowling"); if (count($performance_data) > 0) { $performance = $performance_data[0]; # Create the table header $this->SetCaption("Most wickets by a bowling and catching combination"); $fields = array(); $position = new XhtmlCell(true, "#"); $position->SetCssClass("position"); $fields[] = $position; $bowler = new XhtmlCell(true, "Bowler"); $bowler->SetCssClass("player"); $fields[] = $bowler; $catcher = new XhtmlCell(true, "Catcher"); $catcher->SetCssClass("player"); $fields[] = $catcher; $team = new XhtmlCell(true, "Team"); $fields[] = $team; $matches = new XhtmlCell(true, 'Matches <span class="qualifier">(where wickets were taken)</span>'); $matches->SetCssClass("numeric"); $fields[] = $matches; $wickets = new XhtmlCell(true, "Wickets"); $wickets->SetCssClass("numeric"); $fields[] = $wickets; $header = new XhtmlRow($fields); $header->SetIsHeader(true); $this->AddRow($header); } }
/** * Creates a TeamRunsTable * * @param int $matches_with_run_data * @param int $runs_scored * @param int $runs_conceded * @param int $highest_innings * @param int $lowest_innings */ public function __construct($matches_with_run_data, $runs_scored, $runs_conceded, $highest_innings, $lowest_innings, $average_innings) { parent::XhtmlTable(); $this->matches_with_run_data = $matches_with_run_data; $this->runs_scored = $runs_scored; $this->runs_conceded = $runs_conceded; $this->highest_innings = $highest_innings; $this->lowest_innings = $lowest_innings; $this->average_innings = $average_innings; }
public function __construct($caption, array $performance_data, $first_result = 1, $show_position = false) { $this->performance_data = $performance_data; $this->first_result = (int) $first_result; $this->show_position = (bool) $show_position; parent::XhtmlTable(); if (count($performance_data) > 0) { $performance = $performance_data[0]; # Create the table header $this->SetCaption($caption); $this->SetCssClass('player-performances'); $fields = array(); if ($show_position) { $position = new XhtmlCell(true, "#"); $position->SetCssClass("position"); $fields[] = $position; } $player = new XhtmlCell(true, "Player"); $player->SetCssClass("player"); $fields[] = $player; $match = new XhtmlCell(true, "Match"); $fields[] = $match; $when = new XhtmlCell(true, "When"); $fields[] = $when; if (array_key_exists("runs_scored", $performance)) { $runs = new XhtmlCell(true, "Batting"); $runs->SetCssClass("numeric"); $fields[] = $runs; } if (array_key_exists("wickets", $performance)) { $bowling = new XhtmlCell(true, "Bowling"); $bowling->SetCssClass("numeric"); $fields[] = $bowling; } if (array_key_exists("catches", $performance)) { $catches = new XhtmlCell(true, "Catches"); $catches->SetCssClass("numeric"); $fields[] = $catches; } if (array_key_exists("run_outs", $performance)) { $runouts = new XhtmlCell(true, "Run-outs"); $runouts->SetCssClass("numeric"); $fields[] = $runouts; } $header = new XhtmlRow($fields); $header->SetIsHeader(true); $this->AddRow($header); } }
public function __construct(SiteSettings $o_settings, Season $o_season) { $this->o_settings = $o_settings; $this->o_season = $o_season; parent::XhtmlTable(); # Add table header $this->SetCaption('Results table for this season'); $this->SetCssClass('numeric league'); $headings = array('Team', 'Played', 'Won', 'Lost', 'Tied', 'No result'); $extra_columns = 0; if ($this->o_season->GetShowTableRunsScored()) { $headings[] = 'Runs scored'; $extra_columns++; } if ($this->o_season->GetShowTableRunsConceded()) { $headings[] = 'Runs conceded'; $extra_columns++; } $headings[] = 'Points'; if ($extra_columns) { $this->SetColumnGroupSizes(array(1, 5, $extra_columns, 1)); $a_colgroups = $this->GetColumnGroups(); $a_colgroups[0]->SetCssClass('nonNumeric'); $a_colgroups[1]->SetCssClass('resultCount'); $a_colgroups[2]->SetCssClass('resultCount runs'); $a_colgroups[3]->SetCssClass('resultCount'); } else { $this->SetColumnGroupSizes(array(1, 5, 1)); $a_colgroups = $this->GetColumnGroups(); $a_colgroups[0]->SetCssClass('nonNumeric'); $a_colgroups[1]->SetCssClass('resultCount'); $a_colgroups[2]->SetCssClass('resultCount'); } $o_header = new XhtmlRow($headings); $o_header->SetIsHeader(true); $this->AddRow($o_header); }
/** * Create a BowlingPerformanceTable * @param $bowling_data Bowling[] * @param $display_team bool * @param int $first_result * @param int $max_results * @return void */ public function __construct($bowling_data, $display_team = true, $first_result = 1, $max_results = null) { $this->bowling_data = $bowling_data; $this->display_team = (bool) $display_team; $this->first_result = (int) $first_result; if (!is_null($max_results)) { $this->max_results = (int) $max_results; } parent::XhtmlTable(); # Create the table header $this->SetCaption(is_null($max_results) ? "All bowling performances, best first" : "Best bowling performances"); $this->SetCssClass('statsOverall bowling'); $position = new XhtmlCell(true, "#"); $position->SetCssClass("position"); $player = new XhtmlCell(true, "Player"); $player->SetCssClass("player"); if ($display_team) { $team = new XhtmlCell(true, "Team"); $team->SetCssClass("team"); } $opposition = new XhtmlCell(true, "Opposition"); $opposition->SetCssClass("team"); $when = new XhtmlCell(true, "When"); $when->SetCssClass("date"); $wickets = new XhtmlCell(true, $display_team ? '<abbr title="Wickets">Wkts</abbr>' : "Wickets"); $wickets->SetCssClass("numeric"); $runs = new XhtmlCell(true, "Runs"); $runs->SetCssClass("numeric"); if ($display_team) { $best_bowling_header = new XhtmlRow(array($position, $player, $team, $opposition, $when, $wickets, $runs)); } else { $best_bowling_header = new XhtmlRow(array($position, $player, $opposition, $when, $wickets, $runs)); } $best_bowling_header->SetIsHeader(true); $this->AddRow($best_bowling_header); }
/** * Create a BattingInningsTable * @param $batting_data Batting[] * @param $display_team bool * @param int $first_result * @param int $max_results * @return void */ public function __construct($batting_data, $display_team = true, $first_result = 1, $max_results = null) { $this->batting_data = $batting_data; $this->display_team = (bool) $display_team; $this->first_result = (int) $first_result; if (!is_null($max_results)) { $this->max_results = (int) $max_results; } parent::XhtmlTable(); # Create the table header $this->SetCaption("Highest individual scores"); $this->SetCssClass('statsOverall'); $position = new XhtmlCell(true, "#"); $position->SetCssClass("position"); $player = new XhtmlCell(true, "Player"); $player->SetCssClass("player"); if ($display_team) { $team = new XhtmlCell(true, "Team"); $team->SetCssClass("team"); } $opposition = new XhtmlCell(true, "Opposition"); $opposition->SetCssClass("team"); $when = new XhtmlCell(true, "When"); $when->SetCssClass("date"); $runs = new XhtmlCell(true, "Runs"); $runs->SetCssClass("numeric"); $balls = new XhtmlCell(true, "Balls"); $balls->SetCssClass("numeric"); if ($display_team) { $best_batting_header = new XhtmlRow(array($position, $player, $team, $opposition, $when, $runs, $balls)); } else { $best_batting_header = new XhtmlRow(array($position, $player, $opposition, $when, $runs, $balls)); } $best_batting_header->SetIsHeader(true); $this->AddRow($best_batting_header); }
/** * Create a PlayerStatisticsTable * @param $caption * @param $column_heading * @param $data mixed[] * @param $display_team bool * @param int $first_result * @return void */ public function __construct($caption, $column_heading, $data, $display_team = true, $first_result = 1) { $this->data = $data; $this->display_team = (bool) $display_team; $this->first_result = (int) $first_result; parent::XhtmlTable(); if (count($data) > 0) { $performance = $data[0]; # Create the table header $this->SetCaption($caption); $this->SetCssClass('statsOverall'); $columns = array(); $position = new XhtmlCell(true, "#"); $position->SetCssClass("position"); $columns[] = $position; $player = new XhtmlCell(true, "Player"); $player->SetCssClass("player"); $columns[] = $player; if ($display_team) { $team = new XhtmlCell(true, "Team"); $team->SetCssClass("team"); $columns[] = $team; } if (array_key_exists("total_matches", $performance)) { $matches = new XhtmlCell(true, "Matches"); $matches->SetCssClass("numeric"); $columns[] = $matches; } $aggregate = new XhtmlCell(true, $column_heading); $aggregate->SetCssClass("numeric"); $columns[] = $aggregate; $header = new XhtmlRow($columns); $header->SetIsHeader(true); $this->AddRow($header); } }
function CompetitionTextTable(Competition $o_competition) { parent::XhtmlTable(); $this->o_competition = $o_competition; }