

<?php $__env->startSection('title', 'Licencias'); ?>

<?php $__env->startSection('content_header'); ?>
    <h1>Licencias Emitidas</h1>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="card">
        <div class="card-header">
            <a href="<?php echo e(route('admin.licenses.create')); ?>" class="btn btn-success">
                <i class="fas fa-key"></i> Generar Nueva Licencia
            </a>
        </div>
        <div class="card-body table-responsive">
            <table class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>Cliente</th>
                        <th>Serial (Key)</th>
                        <th>Tipo</th>
                        <th>Estado</th>
                        <th>PC Vinculada (HWID)</th>
                        <th>Vence</th>
                        <th>Acción</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $licenses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $license): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($license->client->name); ?></td>
                        <td class="font-weight-bold text-monospace"><?php echo e($license->license_key); ?></td>
                        <td>
                            <span class="badge badge-info"><?php echo e($license->type); ?></span>
                        </td>
                        <td>
                            <?php if($license->status == 'ACTIVE'): ?>
                                <span class="badge badge-success">ACTIVA</span>
                            <?php else: ?>
                                <span class="badge badge-danger"><?php echo e($license->status); ?></span>
                            <?php endif; ?>
                        </td>
                        <td>
                            <?php if($license->hardware_id): ?>
                                <small class="text-success"><i class="fas fa-check-circle"></i> Vinculada</small><br>
                                <span style="font-size: 10px"><?php echo e(Str::limit($license->hardware_id, 15)); ?></span>
                            <?php else: ?>
                                <small class="text-warning"><i class="fas fa-clock"></i> Esperando activación...</small>
                            <?php endif; ?>
                        </td>
                        <td><?php echo e($license->expiration_date ? $license->expiration_date->format('d/m/Y') : 'NUNCA'); ?></td>
                        <td>
                            <form action="<?php echo e(route('admin.licenses.destroy', $license->id)); ?>" method="POST" onsubmit="return confirm('¿Eliminar esta licencia? El cliente quedará bloqueado.');">
                                <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                <button class="btn btn-xs btn-danger"><i class="fas fa-trash"></i></button>
                            </form>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
            <div class="mt-2"><?php echo e($licenses->links()); ?></div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\igpos-licenses\resources\views/admin/licenses/index.blade.php ENDPATH**/ ?>