<?php
echo '<h1 class="page-header">VIP - Logs de creditos</h1>';
$creditSystem=new CreditSystem(); $logs=$creditSystem->getLogs();
if(!is_array($logs)){message('warning','No hay movimientos VIP para mostrar.');return;}
echo '<div class="panel panel-default"><div class="panel-heading">Reino operativo: '.htmlspecialchars(class_exists('NexoraRealm')?NexoraRealm::label():'Actual',ENT_QUOTES,'UTF-8').'</div><div class="panel-body"><table class="table table-condensed table-hover"><thead><tr><th>Config</th><th>Cuenta</th><th>Creditos</th><th>Fecha</th><th>IP</th></tr></thead><tbody>';
$found=false; foreach($logs as $d){if(($d['log_module']??'')!=='vip/order')continue;$found=true;echo '<tr><td>'.htmlspecialchars((string)$d['log_config'],ENT_QUOTES,'UTF-8').'</td><td>'.htmlspecialchars((string)$d['log_identifier'],ENT_QUOTES,'UTF-8').'</td><td>-'.number_format((int)$d['log_credits']).'</td><td>'.date('Y-m-d H:i',(int)$d['log_date']).'</td><td>'.htmlspecialchars((string)$d['log_ip'],ENT_QUOTES,'UTF-8').'</td></tr>';}
echo '</tbody></table>'; if(!$found) message('warning','No hay movimientos VIP para mostrar.'); echo '</div></div>';
