
<?php $__env->startSection('title', 'Manage Users'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-header">
    <div><h1>All Users</h1><p>Manage registered clients</p></div>
</div>

<form class="toolbar" method="GET">
    <input type="search" name="search" class="md-input" placeholder="Search users..." value="<?php echo e(request('search')); ?>">
    <button type="submit" class="md-btn md-btn-tonal">Search</button>
</form>

<div class="md-card">
    <div class="table-wrap">
        <table class="md-table md-table-light">
            <thead>
                <tr>
                    <th>ID</th><th>Username</th><th>Email</th><th>Balance</th><th>Status</th><th>Joined</th><th>Action</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($user->id); ?></td>
                    <td><?php echo e($user->username); ?></td>
                    <td><?php echo e($user->email); ?></td>
                    <td>$<?php echo e(number_format($user->balance, 2)); ?></td>
                    <td>
                        <?php if($user->status === 'active'): ?>
                            <span class="badge badge-success">Active</span>
                        <?php else: ?>
                            <span class="badge badge-danger">Deactivated</span>
                        <?php endif; ?>
                    </td>
                    <td><?php echo e($user->created_at->format('M d, Y')); ?></td>
                    <td class="action-group">
                        <a href="<?php echo e(route('admin.users.show', $user)); ?>" class="md-btn md-btn-filled md-btn-sm">View</a>
                        <form action="<?php echo e(route('admin.users.toggle-status', $user)); ?>" method="POST"
                              onsubmit="return confirm('<?php echo e($user->status === 'active' ? 'Deactivate this user? They will not be able to sign in.' : 'Reactivate this user?'); ?>')">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <?php if($user->status === 'active'): ?>
                                <button type="submit" class="md-btn md-btn-danger md-btn-sm">Deactivate</button>
                            <?php else: ?>
                                <button type="submit" class="md-btn md-btn-tonal md-btn-sm">Activate</button>
                            <?php endif; ?>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="7" style="text-align:center;padding:2rem">No users found</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php if($users->hasPages()): ?>
    <div style="padding:1rem"><?php echo e($users->links()); ?></div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\SkyApps\Projects\Laravel_projects\web3derp\resources\views/admin/users/index.blade.php ENDPATH**/ ?>