示例#1
0
function section_jointeam_dispForm($team, $invite)
{
    echo '<center><BR>' . playerLink($_SESSION['playerid'], $_SESSION['callsign']) . ', are you sure that
      you really want to join the fabulous ' . teamLink($team->name, $team->id, false) . '?<br>';
    echo '<BR><form method=get>
      <input type=hidden name=link value="jointeam">
      <input type=hidden name=id value=' . $team->id . '>';
    if ($invite) {
        echo '<input type=hidden name=invite value="yep">';
    }
    echo htmlFormbutton('&nbsp;YES&nbsp;', 'f_yes_x') . '&nbsp;' . htmlFormbutton('&nbsp;NO&nbsp;', 'f_no_x', CLRBUT) . '
      </form></center>';
}
示例#2
0
function section_invite_dispForm($team, $player, $link, $days)
{
    global $invite_durations;
    echo '<center><form method=post><font size=+1>Sending an invitation to ' . playerLink($player->id, $player->callsign) . ' to join your team, ' . teamLink($team->name, $team->id, false) . '</font><br>';
    echo '<BR><TABLE><TR><TD><HR><p>This invitation will allow ' . playerLink($id, $player->callsign) . ' to join your team, even if it is closed.<BR>Please select when this invitation should expire:   
      &nbsp;&nbsp;&nbsp;<select name=days>';
    foreach ($invite_durations as $val => $text) {
        htmlOption($val, $text, $days);
    }
    echo '</select><p><hr><p>

  Enter a few words which will be attached to your invitation (mandatory):<br>
  <textarea cols=50 rows=6 name=f_invite>' . $f_invite . '</textarea>
  <center><p><TABLE align=center><TR><TD>' . htmlFormButton("Invite", 'f_ok_x') . '</td><TD width=10></td><TD>' . htmlURLbutton("Cancel", 'playerinfo', "id={$id}", CLRBUT) . '</td></tr></table>';
    echo '<input type=hidden name=link value=' . $link . '>
  <input type=hidden name=id value=' . $player->id . '>
  </center></form></center>     </td></tr></table>';
}
示例#3
0
function section_fights()
{
    //$_SESSION['new_match'] = 0;
    if (isset($_GET['days'])) {
        $numdays = $_GET['days'];
    } else {
        $numdays = DEFAULTDAYS;
    }
    if (isset($_GET['id'])) {
        $teamid = $_GET['id'];
    } else {
        $teamid = -1;
    }
    if (isset($_GET['season_id']) && ENABLE_SEASONS) {
        $season_id = $_GET['season_id'];
        $numdays = null;
    } else {
        $season_id = -1;
    }
    if (isFuncAllowed('entermatch::edit_match') || isFuncAllowed('entermatch::delete_match')) {
        $admin = true;
    }
    if (isset($_GET['det'])) {
        $detail = $_GET['det'];
    }
    if (!isFuncAllowed('match_detail')) {
        $detail = 0;
    }
    if ($admin) {
        $utFreeze = section_fights_queryGetFreezeDate();
    }
    $qwhere = '';
    if ($teamid >= 0 || $numdays != 0 || $season_id > -1) {
        $qwhere = "WHERE ";
        $and = false;
        if ($teamid >= 0) {
            $qwhere = 'WHERE (l_team1.id = \'' . intval($_GET['id']) . '\' OR l_team2.id = \'' . intval($_GET['id']) . '\') ';
        } else {
            $qwhere = "WHERE ";
        }
        if ($numdays != 0) {
            if ($teamid >= 0) {
                $qwhere = $qwhere . "\nAND ";
            }
            $qwhere = $qwhere . "tsactual > DATE_SUB(NOW(), INTERVAL {$numdays} day)";
        }
        if ($season_id > -1) {
            $qwhere = $qwhere . ($and ? "\nAND " : " ") . "season = {$season_id}";
            $and = true;
        }
    }
    if ($detail == 0) {
        $res = sqlQuery($sql = "SELECT matchtab.id, tsactual, team1, l_team1.name name1, score1, team2, \n        l_team2.name name2, score2, unix_timestamp(tsenter) as tsenter_unix,\n      matchtab.id as matchid, l_team1.status stat1, l_team2.status stat2, season, matchtab.mlength\n      FROM " . TBL_MATCH . " matchtab\n      left join l_team l_team1 on l_team1.id = team1\n      left join l_team l_team2 on l_team2.id = team2\n      {$qwhere} ORDER BY tsactual desc");
    } else {
        $res = sqlQuery("SELECT matchtab.id, tsactual, team1, l_team1.name name1, score1, team2, \n        l_team2.name name2, score2, unix_timestamp(tsenter) as tsenter_unix,\n        player1.callsign enteredby, tsenter, identer,\n        player2.callsign editedby, tsedit, idedit, matchtab.id as matchid,\n        oldrankt1, oldrankt2, newrankt1, newrankt2, l_team1.status stat1, l_team2.status stat2,\n\tmatchtab.mlength, season\n      FROM " . TBL_MATCH . " matchtab\n      left join l_team l_team1 on l_team1.id = team1\n      left join l_team l_team2 on l_team2.id = team2\n      left join l_player player1 on player1.id = identer\n      left join l_player player2 on player2.id = idedit\n      {$qwhere} ORDER BY tsactual desc");
    }
    if ($season_id < 1) {
        section_fights_pageStartRegular($teamid, $numdays, $detail);
    } else {
        section_fights_pageStartSeasonal($season_id);
    }
    $show_mlength = count(explode(',', VALID_MLENGTH)) > 1;
    $numGames = 0;
    $last_season = -1;
    while ($obj = mysql_fetch_object($res)) {
        if (++$numGames % 2) {
            $cl = "rowOdd";
        } else {
            $cl = "rowEven";
        }
        $style = null;
        if (isset($_SESSION['last_login']) && $_SESSION['last_login'] < $obj->tsenter_unix) {
            $style = LINK_NEW;
        }
        if (ENABLE_SEASONS && $season_id < 1 && $last_season != $obj->season) {
            $season = sqlQuerySingle("SELECT startdate,enddate FROM l_season WHERE id = {$obj->season} AND id > 1");
            if ($season) {
                echo "<tr style='background-color:darkred;color:white;'><td>Season: </td><td colspan=7>{$season->startdate} - {$season->enddate}</td></tr>";
            } else {
                echo "<tr style='background-color:darkred;color:white;'><td colspan=8 align=\"center\">Off season</td></tr>";
            }
            $last_season = $obj->season;
        }
        echo "<tr class=\"{$cl}\"><td><a name=\"{$obj->id}\" href=\"#{$obj->id}\">" . substr($obj->tsactual, 0, -3) . '</a>';
        if ($show_mlength) {
            print " [{$obj->mlength}] ";
        }
        print '<td align=right><nobr>&nbsp;';
        echo teamLink($obj->name1, "{$obj->team1}", $obj->stat1, $style);
        echo '</td><TD>&nbsp;<b>vs.</b>&nbsp;</td><TD>';
        echo teamLink($obj->name2, "{$obj->team2}", $obj->stat2, $style);
        print '&nbsp</nobr><td align=center>' . $obj->score1 . '</td><td>-</td><td align=center>' . $obj->score2 . '&nbsp;</td>';
        print '<td>';
        if ($admin && strtotime($obj->tsactual) > $utFreeze) {
            echo htmlURLbutSmall('EDIT', 'editmatch', "mid={$obj->matchid}", ADMBUT);
        }
        print "</td></tr>\n";
        if ($detail != 0) {
            $enteredBy = '?';
            if ($obj->identer != 0) {
                $enteredBy = $obj->enteredby;
            }
            echo "<TR class=\"{$cl}\"><td></td><td class=\"dim\" colspan=5 align=left>\n        * Entered AT: {$obj->tsenter}, BY: {$enteredBy}</td></tr>\n";
            if ($detail > 1 && $obj->idedit != 0) {
                echo "<TR class=\"{$cl}\"><td></td><td colspan=5 class=\"dim\" align=left>\n        * Edited AT: {$obj->tsedit}, BY: {$obj->editedby}</td></tr>\n";
            }
            if ($detail > 2 && $obj->oldrankt1 != 0) {
                echo "<TR class=\"{$cl}\"><td></td><td class=\"dim\" colspan=5 align=left>\n          * {$obj->name1} rank changed from {$obj->oldrankt1} to {$obj->newrankt1}</td></tr>\n\n          <TR class=\"{$cl}\"><td></td><td class=\"dim\" colspan=5 align=left>\n          * {$obj->name2} rank changed from {$obj->oldrankt2} to {$obj->newrankt2}</td></tr>\n";
            }
        }
    }
    echo "<TR><TD colspan=8><HR></td></tr>\n    <TR><td></td><TD colspan=2>Number of matches shown:</td><td>{$numGames}</td><td colspan=4></td></tr>\n    <TR><TD colspan=8><HR></td></tr>\n    </td></tr></table>";
    section_fights_pageEnd();
}