Skip to content

Instantly share code, notes, and snippets.

@waltergalvao
Created May 14, 2012 02:09
Show Gist options
  • Save waltergalvao/2691315 to your computer and use it in GitHub Desktop.
Save waltergalvao/2691315 to your computer and use it in GitHub Desktop.
<div class="ranking">
<div class="titulomaior">
<ul>
<li>Posição</li>
<li>Nome</li>
<li>Matou</li>
<li>Morreu</li>
<li>Pontos</li>
</ul>
</div>
<table width="487" height="212" border="0" cellspacing="0" cellpadding="0">
<?php
#$this->requestAction(array('controller' => 'Rankings', 'action' => 'rankpvp'));
#$this->requestAction('Rankings/rankpvp');
$posicao = 0;
foreach ($toppvp as $type ) {
?> <tr><td width=\"90\"> <?php
$posicao = $posicao + 1;
if ($posicao == 1) {
echo "<span class=\"primeiro\"></span><img src=\"css/img/coroa.jpg\" alt=\"\" width=\"15\" height=\"13\"/>";
}
elseif ($posicao == 2) {
echo "<span class=\"segundo\"></span><img src=\"css/img/coroa2.jpg\" alt=\"\" width=\"15\" height=\"13\"/>";
}
elseif ($posicao == 3) {
echo "<span class=\"terceiro\"></span><img src=\"css/img/coroa3.jpg\" alt=\"\" width=\"15\" height=\"13\"/>";
}
elseif ($posicao > 3) {
echo $posicao;
}
?>
</td>
<td width="126">
<?php echo $type['Ranking']['name'] ?>
</td>
<td width="58">
<?php echo $type['Ranking']['kills'] ?>
</td>
<td width="116">
<?php echo $type['Ranking']['dies'] ?>
</td>
<td width="97">
<?php echo $type['Ranking']['ratio'] ?>
</td>
</tr>
<?php } ?>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment