Exemplo n.º 1
0
</tr>

EOT;
    }
}
print <<<EOT
<tr><th colspan={$cs} align="center">Not in a team</th></tr>
EOT;
$ret = mysql_query("select first,last from player order by last,first,rank desc");
if ($ret) {
    while ($row = mysql_fetch_assoc($ret)) {
        $p = new Player($row["first"], $row["last"]);
        if ($p->count_teams() != 0) {
            continue;
        }
        $p->fetchdets();
        $p->fetchclub();
        print <<<EOT
<tr>
<td>{$p->display_name()}</td>
<td>{$p->display_rank()}</td>
<td>{$p->display_online()}</td>
<td>{$p->played_games(true, 'T')}</td>
<td>{$p->won_games(true, 'T')}</td>
<td>{$p->drawn_games(true, 'T')}</td>
<td>{$p->lost_games(true, 'T')}</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td>{$p->played_games()}</td>
<td>{$p->won_games()}</td>
<td>{$p->drawn_games()}</td>
<td>{$p->lost_games()}</td>
Exemplo n.º 2
0
        $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);
        }
    }
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
} catch (TeamException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
Exemplo n.º 3
0
$playname = $_POST["playname"];
$email = $_POST["email"];
$phone = $_POST["phone"];
$kgs = $_POST["kgs"];
$igs = $_POST["igs"];
$club = $_POST["club"];
$rank = $_POST["rank"];
$passw = $_POST["passw"];
$okem = isset($_POST["okem"]);
$trivia = isset($_POST["trivia"]);
$notes = $_POST["notes"];
$latest = $_POST["latesttime"];
try {
    $origplayer = new Player();
    $origplayer->frompost();
    $origplayer->fetchdets();
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
// Check name changes and perform update if applicable
// Note that the "updatename" function does any consequent
// updates like changing team captain name if the player is a
// team captain.
$chname = false;
$newplayer = new Player($playname);
if (!$origplayer->is_same($newplayer)) {
    checkname($newplayer);
    $origplayer->updatename($newplayer);
    $chname = true;
Exemplo n.º 4
0
try {
    for ($b = 0; $b < 3; $b++) {
        $h = new Player();
        $a = new Player();
        $hn = $_POST["htm{$b}"];
        $an = $_POST["atm{$b}"];
        if (strlen($hn) == 0) {
            throw new PlayerException("Home team {$b} is null");
        }
        if (strlen($an) == 0) {
            throw new PlayerException("Away team {$b} is null");
        }
        $h->fromsel($hn);
        $a->fromsel($an);
        $h->fetchdets();
        $a->fetchdets();
        $cols[$b] = $_POST["colours{$b}"];
        switch ($cols[$b]) {
            default:
                $hadnig = true;
                break;
            case 1:
                //  Home player white
                $hadw = true;
                $colset = true;
                break;
            case 2:
                //  Home player black
                $hadb = true;
                $colset = true;
                break;
Exemplo n.º 5
0
<p>Sorry, but you, {$player->display_name(false)} are not currently in the individual
league.</p>
<p>If you want to join it, please update your account
<a href="ownupd.php">here</a>, otherwise
start again from the top by <a href="index.php">clicking here</a>.</p>
</p>
</body>
</html>

EOT;
    exit(0);
}
$opp = new Player();
try {
    $opp->fromsel($_GET["opp"]);
    $opp->fetchdets();
    if (strlen($opp->KGS) == 0) {
        throw new PlayerException("Opponent has no KGS name");
    }
} catch (PlayerException $e) {
    $msg = htmlspecialchars($e->getMessage());
    print <<<EOT
<html>
<head>
<title>No opponent</title>
<link href="/league/bgaleague-style.css" type="text/css" rel="stylesheet"></link>
</head>
<body class="il">
<h1>No opponent</h1>
<p>Sorry but I failed to work out who your opponent was.</p>
<p>Problem was {$msg}.</p>
Exemplo n.º 6
0
} catch (MatchException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
} catch (TeamException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
// Is this a "handicappable" division
$hcapable = $mtch->Division >= $pars->Hdiv;
$hred = $pars->Hreduct;
for ($b = 0; $b < 3; $b++) {
    $h = new Player();
    $h->fromsel($_POST["tm{$b}"]);
    $h->fetchdets();
    $player[$b] = $h;
}
// Sort players by rank unless turned off
if (!isset($_POST["forceass"])) {
    sortrank($player, $pars->Rankfuzz);
}
// If we haven't got any games yet, select colours as WBW or BWB and create the game
// with our team filled in
$gnum = $mtch->ngames();
if ($gnum == 0) {
    $col = rand(0, 1);
    for ($b = 0; $b < 3; $b++) {
        $g = $mtch->newgame();
        if ($col > 0) {
            $g->Bteam = $Myteam;
Exemplo n.º 7
0
//   GNU General Public License for more details.
//   You should have received a copy of the GNU General Public License
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.
include 'php/session.php';
include 'php/checklogged.php';
include 'php/opendatabase.php';
include 'php/club.php';
include 'php/rank.php';
include 'php/player.php';
// Get who I am
try {
    $player = new Player();
    $player->fromid($userid);
    $recip = new Player();
    $recip->fromsel($_POST["recip"]);
    $recip->fetchdets();
} catch (PlayerException $e) {
    $mess = $e->getMessage();
    include 'php/wrongentry.php';
    exit(0);
}
$subj = $_POST["subject"];
$msgt = $_POST["mcont"];
$mid = $gid = 0;
if (isset($_POST["mi"])) {
    $mid = $_POST["mi"];
}
if (isset($_POST["gn"])) {
    $gid = $_POST["gn"];
}
$qfrom = mysql_real_escape_string($player->Userid);