Exemplo n.º 1
0
writeJSboard();
/* if it's not the player's turn, enable auto-refresh */
$autoRefresh = !$isPlayersTurn && !isBoardDisabled() && !$_SESSION['isSharedPC'];
echo 'var autoreload = ';
if (!$autoRefresh) {
    echo '0';
} else {
    if ($_SESSION['pref_autoreload'] >= $CFG_MINAUTORELOAD) {
        echo $_SESSION['pref_autoreload'];
    } else {
        echo $CFG_MINAUTORELOAD;
    }
}
echo ";\n";
writeJShistory();
drawboard();
echo 'var gameId = ' . $_SESSION['gameID'] . ";\n";
echo 'var players = "' . $whiteNick . ' - ' . $blackNick . "\";\n";
echo 'var playersColor = "' . $playersColor . "\";\n";
echo 'var isPromoting = "' . $isPromoting . "\";\n";
echo 'var isKingInCheck = "' . $isInCheck . "\";\n";
echo 'var isGameOver = "' . $isGameOver . "\";\n";
echo 'var historyLayout = "' . $_SESSION['pref_historylayout'] . "\";\n";
writeStatus();
writeHistory();
// Captured pieces..
require 'capt.php';
?>
</script>
<script type="text/javascript" src="javascript/chessutils.js"></script>
<script type="text/javascript" src="javascript/commands.js"></script>
		if ($isPromoting && !$otherTurn)
			writePromotion();
	?>

	<?
		if ($isUndoRequested)
			writeUndoRequest();
	?>

	<?
		if ($isDrawRequested)
			writeDrawRequest();

	?>

	<? drawboard(); ?>

	<!-- table border="0">
	<tr><td -->
	<BR>
	<nobr>
	<input type="button" name="btnReload" value="<?=$MSG_LANG["refresh2"]?>" onClick="window.open('chess.php', '_self')">
	<? if ($CFG_ENABLE_UNDO){ ?>
    <input type="button" name="btnUndo" value="<?=$MSG_LANG["undomove"]?>" <? if (isBoardDisabled()) echo("disabled='yes'"); else echo ("onClick='undo(\"".$MSG_LANG["undowarning"]."\")'"); ?>>
	<?}?>
	<? if (($numMoves<3) && ($team ==0 && $teamMatch ==0) && ($tournament ==0)){?>
	<!-- <input type="button" name="btnAbort" value="Abort Game" onClick="window.location='delgame.php?gameId=<?=$gameID?>'"> -->
	<?}?>

	<input type="button" name="btnDraw" value="<?=$MSG_LANG["askdraw"]?>" <? if (isBoardDisabled()) echo("disabled='yes'"); elseif ($isPlayersTurn == true && $_SESSION['pref_language'] == "english") echo("onClick='drawrequestwithoutmove(\"".$MSG_LANG["drawrequestwithoutmovingfirst"]."\")'"); elseif ($_SESSION['pref_language'] == "english") echo ("onClick='englishdraw(\"".$MSG_LANG["Englishroundwarning"]."\",$CFG_MIN_ROUNDS)'"); else echo ("onClick='draw($CFG_MIN_ROUNDS,\"".$MSG_LANG["roundwarning"]."\")'");?>>
	<input type="button" name="btnResign" value="<?=$MSG_LANG["resign"]?>" <? if (isBoardDisabled()) echo("disabled='yes'"); elseif ($_SESSION['pref_language'] == "english") echo ("onClick='englishresigngame(\"".$MSG_LANG["Englishroundwarning"]."\",$CFG_MIN_ROUNDS)'"); else echo ("onClick='resigngame($CFG_MIN_ROUNDS,\"".$MSG_LANG["roundwarning"]."\")'"); ?>>