if ($crosstable[$h][$a] == $Period) { $mtch = new Match(0, $div); $mtch->Hteam = $teams[$h]; $mtch->Ateam = $teams[$a]; $mtch->Date = $plu[$Period]; $mtch->create(); array_push($Matchlist, $mtch); } } } } // Now finally sort the match list by date and names usort($Matchlist, 'match_sort'); $sdat = new Matchdate(); // Set silly starting date $sdat->next_month('m', 10); foreach ($Matchlist as $rm) { if ($sdat->haschanged($rm->Date)) { $sdat = $rm->Date; print "<h2>{$sdat->display()}</h2>\n"; } print "<p>{$rm->Hteam->display_name()} -v- {$rm->Ateam->display_name()}</p>\n"; } } $nws = new News('ADMINS', "Draw made for new season division {$div}", true, "matches.php"); $nws->addnews(); ?> <p>Click <a href="javascript:self.close()">here</a> to close this window.</p> </body> </html>