$Title = "Update Teams"; include 'php/head.php'; ?> <body> <script language="javascript" src="webfn.js"></script> <?php $showadmmenu = true; include 'php/nav.php'; ?> <h1>Update Teams</h1> <p>Please select the team to be updated from the following list.</p> <p>To add a new team select the menu entry, or you can click on one at random below and just change the entries on the form.</p> <table class="classupdb"> <?php $teamlist = list_all_teams(); $countteams = count($teamlist); $rows = floor(($countteams + 3) / 4); for ($row = 0; $row < $rows; $row++) { print "<tr>\n"; for ($col = 0; $col < 4; $col++) { $ind = $row + $col * $rows; print "<td>"; if ($ind >= $countteams) { print " "; } else { $tm = $teamlist[$ind]; print "<a href=\"updindteam.php?{$tm->urlof()}\">{$tm->display_name()}</a>"; } print "</td>"; }
if ($row) { $earliest->enctime($row[0]); } } $ret = mysql_query("select matchdate from lgmatch order by matchdate desc limit 1"); if ($ret && mysql_num_rows($ret) > 0) { $row = mysql_fetch_array($ret); if ($row) { $latest->enctime($row[0]); } } $Seas->Startdate = $earliest; $Seas->Enddate = $latest; $Seas->create(); // Create the historic teams from the current ones $Full_teams = list_all_teams(); foreach ($Full_teams as $team) { $team->fetchdets(); $hteam = new Histteam($Seas); $hteam->Name = $team->Name; $hteam->Description = $team->Description; $hteam->Division = $team->Division; $hteam->Playing = $team->Playing; $hteam->Sortrank = $team->get_scores($Pars); // Also sets Wonm etc $hteam->Playedm = $team->Playedm; $hteam->Wonm = $team->Wonm; $hteam->Drawnm = $team->Drawnm; $hteam->Lostm = $team->Lostm; $hteam->Wong = $team->Wong; $hteam->Drawng = $team->Drawng;