Exemple #1
0
}
$_SESSION['tournamentState'] = 'game.php';
if ($tournamentId != -1) {
    ?>
    <h2>Описание турнира</h2>
    <div class="textSettings"><?php 
    echo getTournamentDescriptionByTournamentId($tournamentId);
    ?>
</div>
<?php 
}
?>
<br>
<h2>Описание игры</h2>
<div class="textSettings"><?php 
echo getGameDescription($id);
?>
</div>
<br>

<div>
    <h2>Ссылки</h2>
    <ul>
        <?php 
$attachments = getGameAttachments($id);
foreach ($attachments as $key => $value) {
    $description = $value['description'];
    $originalName = $value['originalName'];
    echo $description . ":";
    ?>
                <div class = "attachmentDiv">
Exemple #2
0
function createGameZip($gameId, $filename)
{
    $gameId = intval($gameId);
    $z = new ZipArchive();
    $z->open($filename, ZIPARCHIVE::CREATE);
    $checkers = getCheckerListByGameId($gameId);
    $game = getFromDB("games", "id={$gameId}");
    $meta = "NAME=" . getGameName($gameId) . "\nDESCRIPTION=" . getGameDescription($gameId) . "\nTL=" . $game[0]["timeLimit"] . "\nML=" . $game[0]["memoryLimit"];
    $i = 0;
    foreach ($checkers as $a) {
        $z->addFile(getcwd() . "./testers/" . $a["id"], ++$i . ".checker");
        $z->addFromString($i . ".checkermeta", "LANG=cpp\nname=" . $a["name"] . "\nSEED=" . $a["hasSeed"]);
    }
    $attachments = getAttachments($gameId);
    $i = 0;
    foreach ($attachments as $b) {
        $z->addFile("./attachments/" . $b["id"], ++$i . ".attachment");
        $z->addFromString($i . ".attachmentmeta", "NAME=" . $b["originalName"] . "\nDESCRIPTION=" . $b["description"]);
    }
    $z->addFromString("META", $meta);
    $z->close();
}