Thank you very much, and really appreciate the help given.
Tq. Sir
after ???? error
View attachment 288709
View attachment 288710
edit your ranking_geral.php, change it to:
<?php
require_once __DIR__ . '/../../web_conexao/init.php';
require_once __DIR__ . '/../../web_conexao/function_class.php';
$db = Database::conexao();
$stmt = $db->prepare("
SELECT TOP 100 Name, LEV, Style, Reserved1, Nation
FROM Server01.dbo.cabal_character_table
WHERE Nation <> 3
ORDER BY LEV DESC
");
$stmt->execute();
$resultados = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<section class="custom-ranking">
<div class="ranking-header">
<h1>Ranking de Personagens</h1>
<p>Os 100 personagens com maior nível no servidor</p>
</div>
<div class="ranking-table-wrapper">
<table class="ranking-table">
<thead>
<tr>
<th>Rank</th>
<th>Nome</th>
<th>Nível</th>
<th>Classe</th>
<th>Sexo</th>
</tr>
</thead>
<tbody>
<?php foreach ($resultados as $i => $r):
$style = decodificar_ep33($r['Reserved1'], $r['Style']);
$posicao = $i + 1;
$classeLinha = $i % 2 === 0 ? 'linha-par' : 'linha-impar';
?>
<tr class="<?= $classeLinha ?>">
<td><span class="rank-number"><?= $posicao ?></span></td>
<td><?= htmlspecialchars($r['Name']) ?></td>
<td><?= $r['LEV'] ?></td>
<td>
<div class="classe-info">
<?= $style['Classe_Nome'] ?>
<span class="classe-nome"><?= $style['Classe_is_name'] ?></span>
</div>
</td>
<td><?= $style['Sexo_Icone'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</section>
<style>
.custom-ranking {
max-width: 1200px;
margin: 4rem auto;
padding: 0 1rem;
color: #fff;
font-family: 'Segoe UI', sans-serif;
}
.ranking-header {
text-align: center;
margin-bottom: 2rem;
}
.ranking-header h1 {
font-size: 3rem;
font-weight: 700;
color: #fbbf24;
margin-bottom: 0.5rem;
}
.ranking-header p {
font-size: 1.125rem;
color: #bbb;
}
.ranking-table-wrapper {
overflow-x: auto;
}
.ranking-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background-color: #1a1a1a;
border: 1px solid #333;
border-radius: 8px;
overflow: hidden;
}
.ranking-table thead {
background-color: #2c2c2c;
}
.ranking-table th {
padding: 1rem;
text-align: left;
font-size: 0.95rem;
color: #fbbf24;
border-bottom: 1px solid #444;
}
.ranking-table td {
padding: 0.75rem 1rem;
font-size: 0.9rem;
color: #eee;
border-bottom: 1px solid #333;
}
.ranking-table tr.linha-par {
background-color: #202020;
}
.ranking-table tr.linha-impar {
background-color: #181818;
}
.ranking-table tr:hover {
background-color: #333;
}
.rank-number {
font-weight: bold;
color: #fbbf24;
}
.classe-info {
display: flex;
align-items: center;
gap: 0.5rem;
}
.classe-nome {
color: #ddd;
font-size: 0.9rem;
}
/* Responsivo */
Media (max-width: 768px) {
.ranking-header h1 {
font-size: 2rem;
}
.ranking-header p {
font-size: 1rem;
}
.ranking-table th,
.ranking-table td {
padding: 0.6rem 0.5rem;
font-size: 0.85rem;
}
.classe-nome {
font-size: 0.8rem;
}
}
</style>
Thank you very much, and really appreciate the help given.
Tq. Sir
after ???? error
View attachment 288709
View attachment 288710
also edit your characters.php to:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . '/../../web_conexao/init.php';
require_once __DIR__ . '/../../web_conexao/function_class.php';
Deslogado();
$db = Database::conexao();
if (isset($_GET['box']) && $_GET['box'] == "true") {
echo '<script>console.log(swal("Error", "Você precisa criar um personagem para selecionar esta opção.", "warning"));</script>';
exit();
}
try {
$result_conta = $db->query("SELECT * FROM account.dbo.cabal_auth_table WHERE ID = '" . $_SESSION['my_login'] . "'")->fetchObject();
} catch (PDOException $e) {
exit("Erro ao buscar dados do usuário: " . $e->getMessage());
}
try {
$GetCash = $db->prepare("SELECT * FROM CabalCash.dbo.CashAccount WHERE UserNum = :user_num");
$GetCash->bindParam(':user_num', $result_conta->UserNum, PDO:

ARAM_INT);
$GetCash->execute();
$CashAccount = $GetCash->fetchObject();
} catch (PDOException $er) {
exit("Erro ao consultar Cash: " . $er->getMessage());
}
?>
<style>
/* ... seus estilos permanecem iguais ... */
</style>
<div class="col-12 col-md-12 col-lg-12 col-xl-12 mb-4">
<h4><i class="fas fa-users"></i> Personagens</h4>
<div class="row">
<div class="col-12">
<ul id="character_list">
<?php
try {
// Corrigido: trazer Reserved1 no SELECT
$stmt = $db->prepare("
SELECT TOP 9 CharacterIdx, Name, LEV, STR, DEX, INT, Nation, Style, Reserved1
FROM Server01.dbo.cabal_character_table
WHERE CharacterIdx / 8 = :user_num
");
$stmt->bindParam(':user_num', $result_conta->UserNum, PDO:

ARAM_INT);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo "<li><div class='character-info'><p>Nenhum personagem encontrado.</p></div></li>";
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nation = 'Sem Nação';
switch ($row['Nation']) {
case 1: $nation = 'Capella'; break;
case 2: $nation = 'Procyon'; break;
}
// Corrigido: agora usa Reserved1 e Style
$classeData = decodificar_ep33($row['Reserved1'], $row['Style']);
$classeSigla = $classeData['Classe_Sigla'] ?? 'default';
$icon_url = '/template/request/images/' . $classeSigla . '.gif';
?>
<li
data-char-id="<?= $row['CharacterIdx'] ?>"
data-char-name="<?= htmlspecialchars($row['Name']) ?>"
onmouseover="Tip('Força: <?=$row['STR']?> <br> Defesa: <?=$row['DEX']?> <br> Inteligência: <?=$row['INT']?> <br> Nação: <?=$nation?>', TITLEBGCOLOR, '#515c62', BORDERCOLOR, '#515c62', TITLE, 'INFORMAÇÕES ', TITLEFONTFACE, 'Verdana,sans-serif')"
>
<div class="character-icon">
<img src="<?= $icon_url ?>" alt="<?= htmlspecialchars($row['Name']) ?> Icon" style="width: 100%; height: auto; border-radius: 50%;">
</div>
<div class="character-info">
<h5><?= htmlspecialchars($row['Name']) ?></h5>
<p>Level: <?= $row['LEV'] ?></p>
<p>Nação: <?= $nation ?></p>
<p>STR: <?= $row['STR'] ?> | INT: <?= $row['INT'] ?> | DEX: <?= $row['DEX'] ?></p>
</div>
</li>
<?php
}
}
} catch (PDOException $e) {
echo "<li><div class='character-info'><p>Erro ao carregar personagens: " . $e->getMessage() . "</p></div></li>";
}
?>
</ul>
</div>
</div>
</div>
<div id="personagem-opcoes" style="margin-top:20px;"></div>
<div id="content3" style="margin-top:20px;"></div>
edit your ranking_geral.php, change it to:
<?php
require_once __DIR__ . '/../../web_conexao/init.php';
require_once __DIR__ . '/../../web_conexao/function_class.php';
$db = Database::conexao();
$stmt = $db->prepare("
SELECT TOP 100 Name, LEV, Style, Reserved1, Nation
FROM Server01.dbo.cabal_character_table
WHERE Nation <> 3
ORDER BY LEV DESC
");
$stmt->execute();
$resultados = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<section class="custom-ranking">
<div class="ranking-header">
<h1>Ranking de Personagens</h1>
<p>Os 100 personagens com maior nível no servidor</p>
</div>
<div class="ranking-table-wrapper">
<table class="ranking-table">
<thead>
<tr>
<th>Rank</th>
<th>Nome</th>
<th>Nível</th>
<th>Classe</th>
<th>Sexo</th>
</tr>
</thead>
<tbody>
<?php foreach ($resultados as $i => $r):
$style = decodificar_ep33($r['Reserved1'], $r['Style']);
$posicao = $i + 1;
$classeLinha = $i % 2 === 0 ? 'linha-par' : 'linha-impar';
?>
<tr class="<?= $classeLinha ?>">
<td><span class="rank-number"><?= $posicao ?></span></td>
<td><?= htmlspecialchars($r['Name']) ?></td>
<td><?= $r['LEV'] ?></td>
<td>
<div class="classe-info">
<?= $style['Classe_Nome'] ?>
<span class="classe-nome"><?= $style['Classe_is_name'] ?></span>
</div>
</td>
<td><?= $style['Sexo_Icone'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</section>
<style>
.custom-ranking {
max-width: 1200px;
margin: 4rem auto;
padding: 0 1rem;
color: #fff;
font-family: 'Segoe UI', sans-serif;
}
.ranking-header {
text-align: center;
margin-bottom: 2rem;
}
.ranking-header h1 {
font-size: 3rem;
font-weight: 700;
color: #fbbf24;
margin-bottom: 0.5rem;
}
.ranking-header p {
font-size: 1.125rem;
color: #bbb;
}
.ranking-table-wrapper {
overflow-x: auto;
}
.ranking-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background-color: #1a1a1a;
border: 1px solid #333;
border-radius: 8px;
overflow: hidden;
}
.ranking-table thead {
background-color: #2c2c2c;
}
.ranking-table th {
padding: 1rem;
text-align: left;
font-size: 0.95rem;
color: #fbbf24;
border-bottom: 1px solid #444;
}
.ranking-table td {
padding: 0.75rem 1rem;
font-size: 0.9rem;
color: #eee;
border-bottom: 1px solid #333;
}
.ranking-table tr.linha-par {
background-color: #202020;
}
.ranking-table tr.linha-impar {
background-color: #181818;
}
.ranking-table tr:hover {
background-color: #333;
}
.rank-number {
font-weight: bold;
color: #fbbf24;
}
.classe-info {
display: flex;
align-items: center;
gap: 0.5rem;
}
.classe-nome {
color: #ddd;
font-size: 0.9rem;
}
/* Responsivo */
Media (max-width: 768px) {
.ranking-header h1 {
font-size: 2rem;
}
.ranking-header p {
font-size: 1rem;
}
.ranking-table th,
.ranking-table td {
padding: 0.6rem 0.5rem;
font-size: 0.85rem;
}
.classe-nome {
font-size: 0.8rem;
}
}
</style>
also edit your characters.php to:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . '/../../web_conexao/init.php';
require_once __DIR__ . '/../../web_conexao/function_class.php';
Deslogado();
$db = Database::conexao();
if (isset($_GET['box']) && $_GET['box'] == "true") {
echo '<script>console.log(swal("Error", "Você precisa criar um personagem para selecionar esta opção.", "warning"));</script>';
exit();
}
try {
$result_conta = $db->query("SELECT * FROM account.dbo.cabal_auth_table WHERE ID = '" . $_SESSION['my_login'] . "'")->fetchObject();
} catch (PDOException $e) {
exit("Erro ao buscar dados do usuário: " . $e->getMessage());
}
try {
$GetCash = $db->prepare("SELECT * FROM CabalCash.dbo.CashAccount WHERE UserNum = :user_num");
$GetCash->bindParam(':user_num', $result_conta->UserNum, PDO:

ARAM_INT);
$GetCash->execute();
$CashAccount = $GetCash->fetchObject();
} catch (PDOException $er) {
exit("Erro ao consultar Cash: " . $er->getMessage());
}
?>
<style>
/* ... seus estilos permanecem iguais ... */
</style>
<div class="col-12 col-md-12 col-lg-12 col-xl-12 mb-4">
<h4><i class="fas fa-users"></i> Personagens</h4>
<div class="row">
<div class="col-12">
<ul id="character_list">
<?php
try {
// Corrigido: trazer Reserved1 no SELECT
$stmt = $db->prepare("
SELECT TOP 9 CharacterIdx, Name, LEV, STR, DEX, INT, Nation, Style, Reserved1
FROM Server01.dbo.cabal_character_table
WHERE CharacterIdx / 8 = :user_num
");
$stmt->bindParam(':user_num', $result_conta->UserNum, PDO:

ARAM_INT);
$stmt->execute();
if ($stmt->rowCount() == 0) {
echo "<li><div class='character-info'><p>Nenhum personagem encontrado.</p></div></li>";
} else {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$nation = 'Sem Nação';
switch ($row['Nation']) {
case 1: $nation = 'Capella'; break;
case 2: $nation = 'Procyon'; break;
}
// Corrigido: agora usa Reserved1 e Style
$classeData = decodificar_ep33($row['Reserved1'], $row['Style']);
$classeSigla = $classeData['Classe_Sigla'] ?? 'default';
$icon_url = '/template/request/images/' . $classeSigla . '.gif';
?>
<li
data-char-id="<?= $row['CharacterIdx'] ?>"
data-char-name="<?= htmlspecialchars($row['Name']) ?>"
onmouseover="Tip('Força: <?=$row['STR']?> <br> Defesa: <?=$row['DEX']?> <br> Inteligência: <?=$row['INT']?> <br> Nação: <?=$nation?>', TITLEBGCOLOR, '#515c62', BORDERCOLOR, '#515c62', TITLE, 'INFORMAÇÕES ', TITLEFONTFACE, 'Verdana,sans-serif')"
>
<div class="character-icon">
<img src="<?= $icon_url ?>" alt="<?= htmlspecialchars($row['Name']) ?> Icon" style="width: 100%; height: auto; border-radius: 50%;">
</div>
<div class="character-info">
<h5><?= htmlspecialchars($row['Name']) ?></h5>
<p>Level: <?= $row['LEV'] ?></p>
<p>Nação: <?= $nation ?></p>
<p>STR: <?= $row['STR'] ?> | INT: <?= $row['INT'] ?> | DEX: <?= $row['DEX'] ?></p>
</div>
</li>
<?php
}
}
} catch (PDOException $e) {
echo "<li><div class='character-info'><p>Erro ao carregar personagens: " . $e->getMessage() . "</p></div></li>";
}
?>
</ul>
</div>
</div>
</div>
<div id="personagem-opcoes" style="margin-top:20px;"></div>
<div id="content3" style="margin-top:20px;"></div>
ranking_online.php:
<?php
require_once __DIR__ . '/../../web_conexao/init.php';
require_once __DIR__ . '/../../web_conexao/function_class.php';
$db = Database::conexao();
$stmt = $db->prepare("
SELECT TOP 100 Name, LEV, Style, Reserved1, PlayTime
FROM Server01.dbo.cabal_character_table
WHERE Nation <> 3
ORDER BY PlayTime DESC
");
$stmt->execute();
$resultados = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<section class="custom-ranking">
<div class="ranking-header">
<h1>Personagens Online</h1>
<p>Os 100 jogadores online com maior tempo de jogo</p>
</div>
<div class="ranking-table-wrapper">
<table class="ranking-table">
<thead>
<tr>
<th>Rank</th>
<th>Nome</th>
<th>Nível</th>
<th>Classe</th>
<th>Sexo</th>
</tr>
</thead>
<tbody>
<?php foreach ($resultados as $i => $r):
$style = decodificar_ep33($r['Reserved1'], $r['Style']);
$posicao = $i + 1;
$classeLinha = $i % 2 === 0 ? 'linha-par' : 'linha-impar';
?>
<tr class="<?= $classeLinha ?>">
<td><span class="rank-number"><?= $posicao ?></span></td>
<td><?= htmlspecialchars($r['Name']) ?></td>
<td><?= $r['LEV'] ?></td>
<td>
<div class="classe-info">
<?= $style['Classe_Nome'] ?>
<span class="classe-nome"><?= $style['Classe_is_name'] ?></span>
</div>
</td>
<td><?= $style['Sexo_Icone'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</section>
<style>
.custom-ranking {
max-width: 1200px;
margin: 4rem auto;
padding: 0 1rem;
color: #fff;
font-family: 'Segoe UI', sans-serif;
}
.ranking-header {
text-align: center;
margin-bottom: 2rem;
}
.ranking-header h1 {
font-size: 3rem;
font-weight: 700;
color: #fbbf24;
margin-bottom: 0.5rem;
}
.ranking-header p {
font-size: 1.125rem;
color: #bbb;
}
.ranking-table-wrapper {
overflow-x: auto;
}
.ranking-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background-color: #1a1a1a;
border: 1px solid #333;
border-radius: 8px;
overflow: hidden;
}
.ranking-table thead {
background-color: #2c2c2c;
}
.ranking-table th {
padding: 1rem;
text-align: left;
font-size: 0.95rem;
color: #fbbf24;
border-bottom: 1px solid #444;
}
.ranking-table td {
padding: 0.75rem 1rem;
font-size: 0.9rem;
color: #eee;
border-bottom: 1px solid #333;
}
.ranking-table tr.linha-par {
background-color: #202020;
}
.ranking-table tr.linha-impar {
background-color: #181818;
}
.ranking-table tr:hover {
background-color: #333;
}
.rank-number {
font-weight: bold;
color: #fbbf24;
}
.classe-info {
display: flex;
align-items: center;
gap: 0.5rem;
}
.classe-nome {
color: #ddd;
font-size: 0.9rem;
}
/* Responsivo */
Media (max-width: 768px) {
.ranking-header h1 {
font-size: 2rem;
}
.ranking-header p {
font-size: 1rem;
}
.ranking-table th,
.ranking-table td {
padding: 0.6rem 0.5rem;
font-size: 0.85rem;
}
.classe-nome {
font-size: 0.8rem;
}
}
</style>