<?php
$t=new \Plugin\TransferCharacter\TransferCharacter();
$allowed=array(50,100,200,500,0); $limit=isset($_GET['limit'])?(int)$_GET['limit']:50; if(!in_array($limit,$allowed,true)) $limit=50;
$logs=$t->getTransferLogs($limit);
?>
<h2>Transfer Character — Logs</h2>
<p><strong>Contexto:</strong> <?php echo class_exists('NexoraRealm')?htmlspecialchars(NexoraRealm::label(),ENT_QUOTES,'UTF-8'):'Actual'; ?></p>
<p>Mostrar: <a href="?module=transfercharacter&page=logs&limit=50">50</a> | <a href="?module=transfercharacter&page=logs&limit=100">100</a> | <a href="?module=transfercharacter&page=logs&limit=200">200</a> | <a href="?module=transfercharacter&page=logs&limit=500">500</a> | <a href="?module=transfercharacter&page=logs&limit=0">Todos</a></p>
<?php if(is_array($logs) && count($logs)>0) { ?>
<table class="table table-condensed table-hover"><thead><tr><th>ID</th><th>Fecha</th><th>Cuenta origen</th><th>Cuenta destino</th><th>Personaje</th></tr></thead><tbody>
<?php foreach($logs as $row) { ?><tr><td><?php echo (int)$row['id']; ?></td><td><?php echo htmlspecialchars((string)$row['transfer_date'],ENT_QUOTES,'UTF-8'); ?></td><td><?php echo htmlspecialchars((string)$row['original_owner_username'],ENT_QUOTES,'UTF-8'); ?></td><td><?php echo htmlspecialchars((string)$row['new_owner_username'],ENT_QUOTES,'UTF-8'); ?></td><td><?php echo htmlspecialchars((string)$row['character_name'],ENT_QUOTES,'UTF-8'); ?></td></tr><?php } ?>
</tbody></table>
<?php } else { message('warning','No hay transferencias registradas en este reino.'); } ?>
