当前位置: 首页>>代码示例>>PHP>>正文


PHP Entry::recordString方法代码示例

本文整理汇总了PHP中Entry::recordString方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::recordString方法的具体用法?PHP Entry::recordString怎么用?PHP Entry::recordString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry::recordString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRecordEvent

 function getRecordEvent($eventname)
 {
     $entry = new Entry($eventname, $this->name);
     return $entry->recordString();
 }
开发者ID:jamuraa,项目名称:gatherling,代码行数:5,代码来源:Player.php

示例2: print_ratingsHistory

function print_ratingsHistory($format)
{
    global $player;
    $db = Database::getConnection();
    $stmt = $db->prepare("SELECT e.name, r.rating, n.medal, n.deck AS id\n    FROM events e, entries n, ratings r\n    WHERE r.format= ? AND r.player = ?\n    AND e.start=r.updated AND n.player=r.player AND n.event=e.name\n    ORDER BY e.start DESC");
    $stmt->bind_param("ss", $format, $player->name);
    $stmt->execute();
    $stmt->bind_result($eventname, $rating, $medal, $deckid);
    $stmt->store_result();
    echo "<table style=\"border-width: 0px;\" align=\"center\">\n";
    echo "<tr><td align=\"center\"><b>Pre-Event</td>\n";
    echo "<td><b>Event</td>\n";
    echo "<td><b>Deck</td>\n";
    echo "<td align=\"center\"><b>Record</td>\n";
    echo "<td align=\"center\"><b>Medal</td>\n";
    echo "<td align=\"center\"><b>Post-Event</td></tr>\n";
    if ($stmt->num_rows > 0) {
        $stmt->fetch();
        $preveventname = $eventname;
        $prevrating = $rating;
        while ($stmt->fetch()) {
            $entry = new Entry($preveventname, $player->name);
            $wl = $entry->recordString();
            $img = medalImgStr($entry->medal);
            echo "<tr><td align=\"center\">{$rating}</td>\n";
            echo "<td>{$preveventname}</td>\n";
            echo "<td>" . $entry->deck->linkTo() . "</td>\n";
            echo "<td align=\"center\">{$wl}</td>\n";
            echo "<td align=\"center\">{$img}</td>";
            echo "<td align=\"center\">{$prevrating}</td></tr>";
            $prevrating = $rating;
            $preveventname = $eventname;
        }
        $entry = new Entry($preveventname, $player->name);
        $wl = $entry->recordString();
        $img = medalImgStr($entry->medal);
        echo "<tr><td align=\"center\">1600</td>\n";
        echo "<td>{$preveventname}</td>\n";
        echo "<td>" . $entry->deck->linkTo() . "</td>\n";
        echo "<td align=\"center\">{$wl}</td>\n";
        echo "<td align=\"center\">{$img}</td>";
        echo "<td align=\"center\">{$prevrating}</td></tr>";
    } else {
        echo "<tr><td colspan=6 align=\"center\"><i>";
        echo "You have not played any {$format} events.</td></tr>\n";
    }
    echo "</table>\n";
}
开发者ID:jamuraa,项目名称:gatherling,代码行数:48,代码来源:player.php

示例3: fullmetagame

function fullmetagame($event)
{
    $decks = $event->getDecks();
    $players = array();
    foreach ($decks as $deck) {
        $info = array("player" => $deck->playername, "deckname" => $deck->name, "archetype" => $deck->archetype, "medal" => $deck->medal, "id" => $deck->id);
        $arr = deckInfo($deck);
        $info["colors"] = $arr[1];
        if ($info['medal'] == "dot") {
            $info['medal'] = "z";
        }
        $players[] = $info;
    }
    $db = Database::getConnection();
    $succ = $db->query("CREATE TEMPORARY TABLE meta(\n    player VARCHAR(40), deckname VARCHAR(40), archetype VARCHAR(20),\n    colors VARCHAR(10), medal VARCHAR(10), id BIGINT UNSIGNED,\n    srtordr TINYINT UNSIGNED DEFAULT 0)");
    $succ or die($db->error);
    $stmt = $db->prepare("INSERT INTO meta(player, deckname, archetype,  colors, medal, id)\n    VALUES(?, ?, ?, ?, ?, ?)");
    foreach ($players as $player) {
        $stmt->bind_param("sssssd", $player['player'], $player['deckname'], $player['archetype'], $player['colors'], $player['medal'], $player['id']);
        $stmt->execute() or die($stmt->error);
    }
    $stmt->close();
    $result = $db->query("SELECT colors, COUNT(player) AS cnt FROM meta GROUP BY(colors)");
    $stmt = $db->prepare("UPDATE meta SET srtordr = ? WHERE colors = ?");
    while ($row = $result->fetch_assoc()) {
        $stmt->bind_param("ds", $row['cnt'], $row['colors']);
        $stmt->execute() or die($stmt->error);
    }
    $stmt->close();
    $result->close();
    $result = $db->query("SELECT player, deckname, archetype, colors, medal, id, srtordr\n    FROM meta ORDER BY srtordr DESC, colors, medal, player");
    $color = "orange";
    echo "<table style=\"border-width: 0px;\" align=\"center\">";
    echo "<tr>";
    echo "<td colspan=5 align=\"center\"><b>Metagame Breakdown</td></tr>\n";
    while ($row = $result->fetch_assoc()) {
        if ($row['colors'] != $color) {
            $color = $row['colors'];
            echo "<tr><td>";
            echo image_tag("colors/{$color}.png") . "&nbsp;</td>\n";
            echo "<td colspan=4 align=\"left\"><i>{$row['srtordr']} Players ";
            echo "</td></tr>\n";
        }
        echo "<tr><td></td>\n";
        echo "<td align=\"left\">";
        echo "</td>\n<td align=\"left\">";
        if ($event->finalized == '0') {
            echo "Player is anonymous for deck privacy until event is finalized.";
        } else {
            // puts medal next to name of person who won it
            if ($row['medal'] != "z") {
                echo medalImgStr($row['medal']) . "&nbsp;";
            }
            $play = new Player($row['player']);
            $entry = new Entry($event->name, $play->name);
            echo $play->linkTo() . "</td>\n";
            echo "<td align=\\left\">{$entry->recordString()}</td>";
            echo "<td align=\"left\">";
            echo "<a href=\"deck.php?mode=view&id={$row['id']}\">";
            echo "{$row['deckname']}</a></td>\n";
            echo "<td align=\"right\">{$row['archetype']}</td></tr>\n";
        }
    }
    $result->close();
    echo "</table>\n";
}
开发者ID:jamuraa,项目名称:gatherling,代码行数:66,代码来源:eventreport.php


注:本文中的Entry::recordString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。