0) { // We need the team ID and the conference ID too if ($confid < 1 || $team < 1) { die ('Not enough information supplied'); } print '

Zpět na konferenci pořadí

' . "\n"; print '

Zpět na odehrané zápasy týmu

' . "\n"; $query = 'SELECT teamname, masterteam FROM sportsdb_teams WHERE teamid = ' . $team . ' LIMIT 1'; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { die('No such team exists'); } else { $teamname = mysql_result($result,0,"teamname"); $masterteam = mysql_result($result,0,"masterteam"); } print '

' . $teamname . ' history

' . "\n"; $query = 'SELECT sportsdb_teams.teamid, sportsdb_teams.teamname, sportsdb_teams.teamwins, sportsdb_teams.teamlosses, sportsdb_teams.teamties, sportsdb_teams.teamforfeits, sportsdb_divs.divname, sportsdb_conferences.confname, sportsdb_conferences.confid, sportsdb_seasons.seasonname FROM sportsdb_teams, sportsdb_divs, sportsdb_conferences, sportsdb_seasons WHERE sportsdb_teams.masterteam = ' . $masterteam . ' AND sportsdb_teams.teamdiv = sportsdb_divs.divid AND sportsdb_divs.conference = sportsdb_conferences.confid AND sportsdb_conferences.season = sportsdb_seasons.seasonid ORDER BY sportsdb_seasons.seasonorder'; $result = mysql_query($query) or die ('Error in query: ' . $query); ?> ' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; print "\t\t" . '' . "\n"; if ($show_ties) { print "\t\t" . '' . "\n"; } if ($forfeits) { print "\t\t" . '' . "\n"; } print "\t" . '' . "\n"; } print '
Season       Team       Logo       Nick     Konference       Divize   Výhra   Prohra   Remíza Forfeits
' . $seasonname . '    ' . $teams['teamname'] . '' .'      '. '' .'      ' . $teams['nickname'] . '  ' . $teams['confname'] . '      ' . $teams['divname'] . '' . $teams['teamwins'] . '' . $teams['teamlosses'] . '' . $teams['teamties'] . '' . $teams['teamforfeits'] . '
' . "\n"; } elseif ($team > 0) { // We need the conference ID too if ($confid < 1) { die ('Not enough information supplied'); } print '

Zpět na konferenci pořadí

' . "\n"; print '

' . get_team_name($team). ': full schedule and scores

' . "\n"; print '

historie týmu

' . "\n"; sls_team_schedule($team); } elseif ($confid > 0) { // Allow sorting to occur if (isset($_GET['sort'])) { $standings_sort = intval($_GET['sort']); } else { $standings_sort = 0; } switch ($standings_sort) { /* Available sort fields: Name: teamname Wins: teamwins Losses: teamlosses Ties: teamties Forfeits: teamforfeits Runs for: teamrf Runs against: teamra Games behind: gamesbehind Points: points Winning percentage: winningpct Custom tie break: teamorder Separate the fields by commas and always specify a sort order as DESC for descending and ASC for ascending */ case 1: // Sort by team name $sort_order = "teamname ASC"; break; case 2: // Sort by wins $sort_order = "teamwins DESC, teamties DESC, teamlosses ASC, teamorder DESC"; break; case 3: // Sort by losses $sort_order = "teamlosses DESC, teamwins ASC, teamties ASC, teamorder DESC"; break; case 4: // Sort by ties $sort_order = "teamties DESC, teamwins DESC, teamlosses ASC, teamorder DESC"; break; case 5: // Sort by forfeits $sort_order = "teamforfeits DESC, teamwins ASC, teamties ASC, teamorder DESC"; break; case 6: // Sort by games played $sort_order = "gamesplayed DESC, teamwins DESC, teamties DESC, teamlosses ASC, teamorder DESC"; break; case 7: // Sort by runs for $sort_order = "teamrf DESC, teamwins ASC, teamties DESC, teamlosses ASC, teamorder DESC"; break; case 8: // Sort by runs against $sort_order = "teamra DESC, teamwins DESC, teamties ASC, teamlosses DESC, teamorder DESC"; break; case 9: // Sort by games behind $sort_order = "gamesbehind ASC, teamties DESC, teamwins DESC, teamlosses ASC, teamorder DESC"; break; case 10: // Sort by points $sort_order = "points DESC, teamwins DESC, winningpct DESC, teamorder DESC"; break; default: // Sort by winning percentage $standings_sort = 0; $sort_order = "winningpct DESC, teamorder DESC"; } $division_sort = ""; // Different winning percentage calculations switch ($winning_pct_calc) { case 2: // Treating a tie as a half win $winning_pct_formula = '((teamwins + (teamties / 2)) / (teamwins + teamties + teamlosses + teamforfeits))'; break; case 3: // Treating winning percentage as number of points relative to total possible points $winning_pct_formula = '((teamwins * ' . $points_win . ' + teamforfeits * ' . $points_forfeit . ' + teamties * ' . $points_tie . ') / ((teamwins + teamties + teamlosses + teamforfeits) * ' . $points_win . '))'; break; default: // Ignoring ties $winning_pct_formula = '(teamwins / (teamwins + teamlosses + teamforfeits))'; } // Get the divisions $resultconf = mysql_query("SELECT divname, divid FROM sportsdb_divs WHERE conference = $confid ORDER BY divorder"); $numconf = mysql_num_rows($resultconf); if ($numconf == 0) { print "

No divisions in this conference

\n"; } else { while ($divs = mysql_fetch_array($resultconf, MYSQL_ASSOC)) { // Loop through each division $divname = $divs['divname']; ?>

">>>Přepnout na ligu<<
$query

"; $result=mysql_query($query); $num=mysql_num_rows($result); while ($results = mysql_fetch_array($result, MYSQL_ASSOC)) { $winningpct=number_format($results['winningpct'], 3)*100; $gamesbehind = number_format($results['gamesbehind'],1); if ($gamesbehind == "0.0") { $gamesbehind = "---"; } ?>
"; ?>Tým'; ?> "; ?>Logo'; ?> "; ?>Nick'; ?> "; ?>GP'; ?> "; ?>Výhra'; ?> "; ?>Prohra'; ?> "; ?>Ties'; ?> "; ?>Forfeits'; ?> "; ?>RF'; ?> "; ?>RA'; ?> "; ?>%'; ?> "; ?>Body'; ?>
---
' . "\n"; ?>

Minulé výsledky

Show only

 Logo   Domácí      Skóre      Hosté       Logo
' . "\n"; ?>       '; ?>          ' . "\n"; ?>
Click here to view a list of seasons

' . "\n"; print '

' . $seasonname . ' season

' . "\n"; ?>

Click on a conference name to view its standings

{$confs['confname']}

\n"; } } else { ?>

Click on a season name to view its conferences

$seasonname

\n"; } } ?>