function returnHitList($db_in, $pl_id)
{
    $db = $db_in;
    try {
        $sql = "SELECT level, hp_left, id\n\t\t\t\t\t\tFROM userdb\n\t\t\t\t\t\tWHERE id IN (\n\t\t\t\t\t\t\tSELECT id_mark\n\t\t\t\t\t\t\tFROM black_list\n\t\t\t\t\t\t\tWHERE id_player = :id)";
        $st = $db->prepare($sql);
        $st->bindParam(':id', $pl_id);
        $st->execute();
        $result;
        while ($row = $st->fetch(PDO::FETCH_ASSOC)) {
            if ($row['hp_left'] > 0) {
                $alive = "Yes";
                $fight = "<a href=\"http://the-lost-realm.com/fight_player.php?action=search&id_name=" . $row['id'] . "\" class=\"btn btn-primary btn-xs\">Fight</a>";
                $rep_fight = "<a href=\"http://the-lost-realm.com/rep_fight_player.php?action=search&id_name=" . $row['id'] . "\" class=\"btn btn-primary btn-xs\">Rep Fight</a>";
            } else {
                $alive = "No";
                $fight = "<a href=\"http://the-lost-realm.com/fight_player.php?action=search&id_name=" . $row['id'] . "\" class=\"btn btn-primary btn-xs\">Fight</a>";
                $rep_fight = "<a href=\"http://the-lost-realm.com/rep_fight_player.php?action=search&id_name=" . $row['id'] . "\" class=\"btn btn-primary btn-xs\">Rep Fight</a>";
            }
            $result .= "<tr><td>" . idToLink($row['id'], $db) . "</td><td>" . $row['level'] . "</td><td>" . $alive . "</td><td>" . $fight . "</td><td>" . $rep_fight . "</td><td><a href=\"http://the-lost-realm.com/black_list.php?action=remove&playerId=" . $row['id'] . "\" class=\"btn btn-primary btn-xs\">Remove</a></td></tr>";
        }
        return $result;
    } catch (PDOException $e) {
        echo "returnHitList error: " . $e->getMessage();
        //file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND);
    }
}
Ejemplo n.º 2
0
function returnVotingWinners($db_in)
{
    $db = $db_in;
    try {
        $sql = "SELECT user_id\n\t\t\t\tFROM manareload\n\t\t\t\tORDER BY id";
        $st = $db->prepare($sql);
        $st->execute();
        $st->setFetchMode(PDO::FETCH_ASSOC);
        $result = "";
        while ($row = $st->fetch()) {
            $result .= idToLink($row['user_id'], $db) . " <br /> ";
        }
        return $result;
    } catch (PDOException $e) {
        echo "returnVotingWinners error: " . $e->getMessage();
        //file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND);
    }
}
Ejemplo n.º 3
0
			<td><?php 
echo idToLink($player[0]->getLast_killed(), $db);
?>
</td>
		</tr>
		<tr>
			<td>Last Killed By</td>
			<td><?php 
echo idToLink($player[0]->getLast_killed_by(), $db);
?>
</td>
		</tr>
		<tr>
			<td>Last Attacked</td>
			<td><?php 
echo idToLink($player[0]->getLast_att(), $db);
?>
</td>
		</tr>
		<tr>
			<td>Visits</td>
			<td><?php 
echo $player[0]->getVisits();
?>
</td>
		</tr>
		<tr>
			<td>Age</td>
			<td><?php 
echo $player[0]->getDays_old();
?>