include 'php/wrongentry.php'; exit(0); } $team = new Team($teamname); checkname($team); $team->Description = $teamdescr; $team->Division = $teamdiv; $team->Captain = new Player($captfirst, $captlast); $team->create(); $Title = "Team {$team->display_name()} created OK"; break; default: try { $origteam = new Team(); $origteam->frompost(); $origteam->fetchdets(); } catch (TeamException $e) { $mess = $e->getMessage(); include 'php/wrongentry.php'; exit(0); } // Check name changes $newteam = new Team($teamname); if (!$origteam->is_same($newteam)) { checkname($newteam); $origteam->updatename($newteam); } $origteam->Description = $teamdescr; $origteam->Division = $teamdiv; $origteam->Captain = new Player($captfirst, $captlast); $origteam->update();
include 'php/wrongentry.php'; exit(0); case 'T': $type = 'T'; $teamname = $row["descr1"]; break; case 'I': $type = 'I'; $first = $row["descr1"]; $last = $row["descr2"]; break; } try { if ($type == 'T') { $team = new Team($teamname); $team->fetchdets(); // Error if this team has paid if ($team->Paid) { $mess = "Team {$teamname} have already paid??"; include 'php/wrongentry.php'; exit(0); } } else { $pplayer = new Player($first, $last); $pplayer->fetchdets(); // Error if this player has paid if ($pplayer->ILpaid) { $mess = "{$first} {$last} is already paid??"; include 'php/wrongentry.php'; exit(0); }
function list_teams_captof($player) { $result = array(); $ret = mysql_query("select name from team where {$player->queryof('capt')} order by name"); if ($ret and mysql_num_rows($ret) > 0) { while ($row = mysql_fetch_array($ret)) { $team = new Team($row[0]); $team->fetchdets(); array_push($result, $team); } } return $result; }