Filtrar quem esta online
Fiz Um Sistema de Filtrar Quem Estiver Online Mais Ele Esta Mostrando 2 Vezes como se eu Tivesse Offline e Online
CODIGO:
<?php
$sql = "SELECT `UserID`,`Name`,`PVPKills`,`KDR`,`Status` FROM playerranksdb
ORDER BY 3 desc limit 100";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
?>
<div class="table-responsive">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th>Nome</th>
<th>PvPKills</th>
<th>KDR</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
<th>#</th>
<th>Nome</th>
<th>PvPKills</th>
<th>KDR</th>
<th>Status</th>
</tr>
</tfoot>
<tbody>
<?php
$counter = 1;
while($row = $result->fetch_assoc()) {
$counter2 = $counter++;
echo "<tr>";
if ($row['Status'] == 'online'){ echo "<th class='success' scope='row'>$counter2</th>"; } else { echo "<th scope='row'>$counter2</th>"; }
if ($row['Status'] == 'online'){ echo "<td style='color: green'><a href='http://steamcommunity.com/profiles/" . $row['UserID']. "' target='_blank'>" . $row['Name']. "</a></td>"; } else { echo "<td><a href='http://steamcommunity.com/profiles/" . $row['UserID']. "' target='_blank'>" . $row['Name']. "</a></td>"; }
if ($row['Status'] == 'online'){ echo "<td style='color: green'>".$row['PVPKills']."</td>"; } else { echo "<td>".$row['PVPKills']."</td>"; }
if ($row['Status'] == 'online'){ echo "<td style='color: green'>".$row['KDR']."</td>"; } else { echo "<td>".$row['PVPKills']."</td>"; }
if ($row['Status'] == 'online'){ echo "<td style='color: green'>".$row['Status']."</td>"; } else { echo "<td>".$row['Status']."</td>"; }
echo "</tr>";
?>
<tr>
<td><?php echo $counter2 ?></th>
<td><a style="color: #000;" href="http://steamcommunity.com/profiles/<?php echo $row['UserID'] ?>" target="_blank" ><?php echo $row['Name'] ?></td></a>
<td><?php echo $row["PVPKills"]; ?></td>
<td><?php echo $row["KDR"]; ?></td>
<td><?php echo $row["Status"]; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<?php } $conn->close(); ?>
Como Esta:
[https://imgur.com/a/XiQDw](https://imgur.com/a/XiQDw)Discussão (1)
Carregando comentários...