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

<?php $__env->startSection('content'); ?>
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h5 class="page-title mb-0">Homepage Statistics</h5>
        <a href="<?php echo e(route('admin.stats.create')); ?>" class="btn btn-primary"><i class="bi bi-plus-lg me-1"></i> Add Statistic</a>
    </div>

    <div class="card">
        <div class="card-body p-0">
            <table class="table table-hover align-middle mb-0">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Label</th>
                        <th>Value</th>
                        <th>Flag</th>
                        <th>Order</th>
                        <th>Status</th>
                        <th class="text-end">Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $stats; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $stat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($loop->iteration); ?></td>
                            <td class="fw-semibold"><?php echo e($stat->label); ?></td>
                            <td><?php echo e($stat->value); ?></td>
                            <td>
                                <?php if($stat->flag): ?>
                                    <img src="<?php echo e(\App\Services\FileUploadService::url($stat->flag)); ?>" style="height:24px">
                                <?php else: ?>
                                    <span class="text-muted">—</span>
                                <?php endif; ?>
                            </td>
                            <td><?php echo e($stat->sort_order); ?></td>
                            <td>
                                <?php if($stat->is_active): ?><span class="badge bg-success">Active</span>
                                <?php else: ?><span class="badge bg-secondary">Inactive</span><?php endif; ?>
                            </td>
                            <td class="text-end">
                                <a href="<?php echo e(route('admin.stats.edit', $stat)); ?>" class="btn btn-sm btn-outline-primary">Edit</a>
                                <form action="<?php echo e(route('admin.stats.destroy', $stat)); ?>" method="POST" class="d-inline" data-confirm="Delete this statistic?">
                                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
                                </form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="7" class="text-center text-muted py-4">No statistics yet.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="mt-3"><?php echo e($stats->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\skyline\resources\views/admin/stats/index.blade.php ENDPATH**/ ?>