コード例 #1
0
ファイル: assildiv.php プロジェクト: Britgo/Online-League
function assign_ildiv($rankval)
{
    //  If there is only one division, then just return that
    $maxdiv = max_ildivision();
    if ($maxdiv <= 1) {
        return 1;
    }
    // If there is someone else with the same rank return their division
    if ($row = ail_getrow("ildiv", "rank={$rankval}")) {
        return $row["ildiv"];
    }
    // Get the division of the next higher rank person, if none,
    // select first division
    $hirow = ail_getrow("ildiv,rank", "rank>{$rankval}", "rank,ildiv desc");
    if (!$hirow) {
        return 1;
    }
    // Likewise the division of the next lower rank person, if none,
    // select bottom division
    $lorow = ail_getrow("ildiv,rank", "rank<{$rankval}", "rank desc,ildiv");
    if (!$lorow) {
        return $maxdiv;
    }
    // Get average rank and select higher division if better than average,
    // otherwise lower
    if ($rankval >= ($hirow["rank"] + $lorow["rank"]) / 2) {
        return $hirow["ildiv"];
    } else {
        return $lorow["ildiv"];
    }
}
コード例 #2
0
ファイル: seasileague.php プロジェクト: Britgo/Online-League
include 'php/nav.php';
?>
<h1>Historical Individual League Standings</h1>
<?php 
print <<<EOT
<p>This is the final league table for <strong>{$Season->display_name()}</strong>,
which ran from {$Season->display_start()} to {$Season->display_end()}.</p>
<p>Only players who played games are included.</p>

EOT;
?>
<div align="center">
<?php 
$pars = new Params();
$pars->fetchvalues();
$ml = max_ildivision();
for ($d = 1; $d <= $ml; $d++) {
    $players = list_hist_players_ildiv($d, $Season);
    if (count($players) < 2) {
        print <<<EOT
No games played in Division {$d}.

EOT;
    } else {
        $cn = 6 + count($players);
        print <<<EOT
<table class="league">
<tr>
<th colspan="{$cn}" align="center">Division {$d}</th>
</tr>
<tr>
コード例 #3
0
ファイル: updindplayer.php プロジェクト: Britgo/Online-League
</td></tr>
<tr><td>Notes</td>
<td><input type="text" name="notes" value="{$player->display_notes()}" size="40"></td></tr>
<tr><td>KGS</td>
<td><input type="text" name="kgs" value="{$player->display_kgs()}" size="10" maxlength="10"></td></tr>
<tr><td>IGS</td>
<td><input type="text" name="igs" value="{$player->display_igs()}" size="10" maxlength="10"></td></tr>
<tr><td colspan="2"><input type="checkbox" name="bgamemb"{$bgamemb}>
Player is BGA member.
</td></tr>
<tr><td>Individual league division</td>
<td><select name="ildiv" size="0">
<option value="0"{$npil}>Not playing</option>

EOT;
$maxdivs = max_ildivision() + 1;
for ($d = 1; $d <= $maxdivs; $d++) {
    $ild = $player->ILdiv == $d ? " selected" : "";
    print <<<EOT
<option value="{$d}"{$ild}>{$d}</option>

EOT;
}
print <<<EOT
</select></td></tr>
<tr><td>Paid I.L subs</td><td><input type="checkbox" name="ilpaid"{$ilpaid}></td></tr>
<tr><td>Admin Privs</td>
<td>

EOT;
$player->adminopt();