PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Nuno Chaves   PHP Tournament Manager   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Tournament Manager
Manage the games of a tournament between teams
Author: By
Last change:
Date: 10 years ago
Size: 876 bytes
 

Contents

Class file image Download
<?php

include("class.tournament.php");

$teams = array('SCP', 'BEN', 'POR', 'BRA', 'ACA', 'SET', 'OLH', 'MAR');

$tournament = new Tournament( $teams );
$tournament->drawTeamGroups = true;
$tournament->playHomeAndAway = true;
$groups = $tournament->createGroups( 3 );

for(
$i=0; $i < count($groups); ++$i ){

   
$matchDays = $tournament->createMatches( $i );
 
    echo
"<br/><h2>Group ". ($i+1) ."</h2>";
   
    echo
'<b>Teams:</b> '.implode(' | ', $groups[$i]).'<br/>';
 
    for(
$j=0; $j< count($matchDays); ++$j ){
       
        echo
"<br/><b>MatchDay ".($j+1)."</b><br/>";
       
        for(
$k=0; $k < count($matchDays[$k]); ++$k ){
           
            echo
$matchDays[$j][$k][0] .' - '. $matchDays[$j][$k][1] .'<br/>';
        }
    }
   
}

?>