

<?php $__env->startSection('content'); ?>
<div class="container">

    <div class="row">
        <?php if(optional($settings)->boost_social): ?>
        <div class="width-50">
            <div class="card cron-card">
                <h3 class="cron-title">Send orders</h3>
                <p class="text-warning">Run every minute</p>
                <div class="input-group">
                    <input type="text" readonly class="form-control cron-input-field" value="<?php echo e($cronSendOrders); ?>">
                    <div class="input-group-append cron-input">
                        <button type="button" class="js-copy-cron-url"><i class="las la-copy"></i> Copy url</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="width-50">
            <div class="card cron-card">
                <h3 class="cron-title">Sync status</h3>
                <p class="text-warning">Run every minute</p>
                <div class="input-group">
                    <input type="text" readonly class="form-control cron-input-field" value="<?php echo e($cronSyncStatus); ?>">
                    <div class="input-group-append cron-input">
                        <button type="button" class="js-copy-cron-url"><i class="las la-copy"></i> Copy url</button>
                    </div>
                </div>
            </div>
        </div>

        <div class="width-50">
            <div class="card cron-card">
                <h3 class="cron-title">Sync services</h3>
                <p class="text-warning">Run every 5–15 minutes</p>
                <div class="input-group">
                    <input type="text" readonly class="form-control cron-input-field" value="<?php echo e($cronSyncServices); ?>">
                    <div class="input-group-append cron-input">
                        <button type="button" class="js-copy-cron-url"><i class="las la-copy"></i> Copy url</button>
                    </div>
                </div>
            </div>
        </div>
        <?php endif; ?>
    </div>

    <div class="row">
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total users</p>
                    <h2><?php echo e($totalUsers); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-user"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Active users</p>
                    <h2><?php echo e($activeUsers); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-user-check"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Inactive users</p>
                    <h2><?php echo e($inactiveUsers); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-user-times"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total user balance</p>
                    <h2><?php echo e(number_format($totalUserBalance, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-wallet"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total deposits</p>
                    <h2><?php echo e(number_format($totalDeposits, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-money-bill-wave-alt"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Today's deposits</p>
                    <h2><?php echo e(number_format($todayDeposits, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-calendar-day"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total withdrawn</p>
                    <h2><?php echo e(number_format($totalWithdrawn, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-hand-holding-usd"></i>
                </div>
            </div>
        </div>
        <?php if(optional($settings)->buy_number): ?>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total numbers</p>
                    <h2><?php echo e($totalNumbers); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-sim-card"></i>
                </div>
            </div>
        </div>
        <?php endif; ?>
        <?php if(optional($settings)->boost_social): ?>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Total SMM orders</p>
                    <h2><?php echo e($totalSmmOrders); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-shopping-cart"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>SMM revenue</p>
                    <h2><?php echo e(number_format($totalSmmRevenue, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-chart-line"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>Pending SMM orders</p>
                    <h2><?php echo e($pendingSmmOrders); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-clock"></i>
                </div>
            </div>
        </div>
        <div class="width-25">
            <div class="card card-stats">
                <div class="card-stats-text">
                    <p>SMM providers</p>
                    <h2><?php echo e($totalSmmProviders); ?></h2>
                </div>
                <div class="card-stats-icon">
                    <i class="las la-server"></i>
                </div>
            </div>
        </div>
        <?php endif; ?>
    </div>


    <div class="card table-card">
        <div class="table-header">
            <h2>All users</h2>
        </div>
        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th>Sl</th>
                        <th>Full name</th>
                        <th>Email</th>
                        <th>Balance</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $recentUsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($index + 1); ?></td>
                            <td><?php echo e($user->fname); ?> <?php echo e($user->lname); ?></td>
                            <td><?php echo e($user->email); ?></td>
                            <td><?php echo e(number_format($user->balance, 2)); ?> <?php echo e(optional($settings)->website_currency ?? 'USD'); ?></td>
                            <td>
                                <span class="badge <?php echo e($user->status ? 'active' : 'inactive'); ?>">
                                    <?php echo e($user->status ? 'Active' : 'Inactive'); ?>

                                </span>
                            </td>
                            <td>
                                <div class="table-actions">
                                    <a href="<?php echo e(route('backend.users.details', $user->id)); ?>" class="table-btn"><i class="las la-pen"></i></a>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="7" class="text-center">No users found.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>

<?php $__env->startPush('script'); ?>
<script>
(function () {
    document.querySelectorAll('.js-copy-cron-url').forEach(function (btn) {
        btn.addEventListener('click', function () {
            var card = this.closest('.cron-card');
            var input = card ? card.querySelector('.cron-input-field') : null;
            var url = input ? input.value : '';
            if (!url) return;
            if (navigator.clipboard && navigator.clipboard.writeText) {
                navigator.clipboard.writeText(url).then(function () {
                    if (typeof iziToast !== 'undefined') {
                        iziToast.success({ message: 'URL copied to clipboard', position: 'topRight' });
                    } else {
                        alert('URL copied.');
                    }
                }).catch(function () {
                    fallbackCopy(url);
                });
            } else {
                fallbackCopy(url);
            }
        });
    });
    function fallbackCopy(text) {
        var ta = document.createElement('textarea');
        ta.value = text;
        ta.style.position = 'fixed';
        ta.style.opacity = '0';
        document.body.appendChild(ta);
        ta.select();
        try {
            document.execCommand('copy');
            if (typeof iziToast !== 'undefined') {
                iziToast.success({ message: 'URL copied to clipboard', position: 'topRight' });
            } else {
                alert('URL copied.');
            }
        } catch (e) {}
        document.body.removeChild(ta);
    }
})();
</script>
<?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layout.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\HP\Desktop\upgraded\mine\core\resources\views/backend/dashboard.blade.php ENDPATH**/ ?>