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


<?php echo $__env->make('layouts.nav', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

<?php $__env->startSection('content'); ?>

    <h3>Transacciones</h3>
    <h5>Id: <?php echo e($user->id); ?></h5>
    <h5>Usuario: <?php echo e($user->username); ?></h5>
    <h5>Nombre: <?php echo e($user->name); ?></h5>
    <h5>Teléfono: <?php echo e($user->phone); ?></h5>
    <?php if($user->enabled == 1): ?>
        <h5>Cuenta: <b class="bg-success">Habilitada</b></h5>
        <h5>
            <b>Bloquear usuario:</b>

            <form action="<?php echo e(route('user.update', [$user->id])); ?>" method="POST">
                <input type="hidden" name="_method" value="put">
                <input type="hidden" name="enabled" value="0">
                <button class="btn btn-danger">Bloquear</button>
                <?php echo e(csrf_field()); ?>

            </form>
        </h5>
    <?php else: ?>
        <h5>Cuenta: <b class="bg-danger">Bloqueada</b></h5>
        <h5>
            <b>Habilitar usuario:</b>

            <form action="<?php echo e(route('user.update', [$user->id])); ?>" method="POST">
                <input type="hidden" name="_method" value="put">
                <input type="hidden" name="enabled" value="1">
                <button class="btn btn-success">Habilitar</button>
                <?php echo e(csrf_field()); ?>

            </form>
        </h5>
    <?php endif; ?>




    <?php if($data): ?>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>Fecha</th>
                <th>Monto</th>
                <th>Descuento</th>
                <th>FirstData: Auth</th>
                <th>LatinoToUp: request_id</th>
                <th>LatinoToUp: result</th>
            </tr>
            </thead>
            <tbody>
            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                <tr>
                    <td><?php echo e($item->resolve_date); ?></td>
                    <td><?php echo e($item->amount); ?></td>
                    <td><?php echo e($item->discount); ?></td>
                    <td><?php echo e($item->transactionIdentifier); ?></td>
                    <td><?php echo e($item->transaction_id); ?></td>
                    <td width="20%"><?php echo e(str_replace(',', "\n", $item->result_doc)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
            </tbody>
        </table>
    <?php else: ?>
        <h2>No se encontraron resultados.</h2>
    <?php endif; ?>


    
    <div><a href="<?php echo e(route('users.index')); ?>" class="btn btn-primary">Regresar a usuarios</a></div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>