<?php if (isset($component)) { $__componentOriginal91fdd17964e43374ae18c674f95cdaa3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3 = $attributes; } ?>
<?php $component = App\View\Components\AdminLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AdminLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
   <div class="container px-6 mx-auto">
       <div class="flex justify-between items-center my-6">
           <h2 class="text-2xl font-semibold text-gray-700">Bot Subscriptions</h2>
       </div>

       <?php if (isset($component)) { $__componentOriginal6912374916afbfe53350098c2f0b0678 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6912374916afbfe53350098c2f0b0678 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.session-status','data' => ['class' => 'mb-4','status' => session('status'),'errors' => $errors]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('session-status'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'mb-4','status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(session('status')),'errors' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6912374916afbfe53350098c2f0b0678)): ?>
<?php $attributes = $__attributesOriginal6912374916afbfe53350098c2f0b0678; ?>
<?php unset($__attributesOriginal6912374916afbfe53350098c2f0b0678); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6912374916afbfe53350098c2f0b0678)): ?>
<?php $component = $__componentOriginal6912374916afbfe53350098c2f0b0678; ?>
<?php unset($__componentOriginal6912374916afbfe53350098c2f0b0678); ?>
<?php endif; ?>

       <!-- Stats Cards -->
       <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
           <div class="bg-white rounded-lg shadow-md p-6">
               <div class="flex items-center">
                   <div class="p-3 rounded-full bg-blue-100 dark:bg-blue-900">
                       <i class="ri-funds-box-line text-2xl text-blue-500"></i>
                   </div>
                   <div class="ml-4">
                       <p class="text-gray-500 text-sm">Total Subscriptions</p>
                       <p class="text-xl font-semibold"><?php echo e(number_format($subscriptions->total())); ?></p>
                   </div>
               </div>
           </div>
           
           <div class="bg-white rounded-lg shadow-md p-6">
               <div class="flex items-center">
                   <div class="p-3 rounded-full bg-green-100 dark:bg-green-900">
                       <i class="ri-coins-line text-2xl text-green-500"></i>
                   </div>
                   <div class="ml-4">
                       <p class="text-gray-500 text-sm">Total Investment</p>
                       <p class="text-xl font-semibold">$<?php echo e(number_format($subscriptions->sum('amount'), 2)); ?></p>
                   </div>
               </div>
           </div>
           
           <div class="bg-white rounded-lg shadow-md p-6">
               <div class="flex items-center">
                   <div class="p-3 rounded-full bg-purple-100 dark:bg-purple-900">
                       <i class="ri-bar-chart-line text-2xl text-purple-500"></i>
                   </div>
                   <div class="ml-4">
                       <p class="text-gray-500 text-sm">Total Profit</p>
                       <p class="text-xl font-semibold">$<?php echo e(number_format($subscriptions->sum('total_profit'), 2)); ?></p>
                   </div>
               </div>
           </div>
           
           <div class="bg-white rounded-lg shadow-md p-6">
               <div class="flex items-center">
                   <div class="p-3 rounded-full bg-yellow-100 dark:bg-yellow-900">
                       <i class="ri-user-follow-line text-2xl text-yellow-500"></i>
                   </div>
                   <div class="ml-4">
                       <p class="text-gray-500 text-sm">Active Subscriptions</p>
                       <p class="text-xl font-semibold"><?php echo e($subscriptions->where('status', 'active')->count()); ?></p>
                   </div>
               </div>
           </div>
       </div>

       <!-- Subscriptions Table -->
       <div class="bg-white rounded-lg shadow-md overflow-hidden">
           <div class="overflow-x-auto">
               <table class="w-full whitespace-no-wrap">
                   <thead>
                       <tr class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase bg-gray-50 border-b">
                           <th class="px-4 py-3">User/Bot</th>
                           <th class="px-4 py-3">Amount</th>
                           <th class="px-4 py-3">Profit</th>
                           <th class="px-4 py-3">Status</th>
                           <th class="px-4 py-3">Duration</th>
                           <th class="px-4 py-3">Actions</th>
                       </tr>
                   </thead>
                   <tbody class="bg-white divide-y">
                       <?php $__empty_1 = true; $__currentLoopData = $subscriptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subscription): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                           <tr class="text-gray-700">
                               <td class="px-4 py-3">
                                   <div class="flex flex-col">
                                       <span class="font-medium"><?php echo e($subscription->user->name); ?></span>
                                       <span class="text-sm text-gray-500"><?php echo e($subscription->bot->name); ?></span>
                                   </div>
                               </td>
                               <td class="px-4 py-3">$<?php echo e(number_format($subscription->amount, 2)); ?></td>
                               <td class="px-4 py-3">
                                   <span class="text-<?php echo e($subscription->total_profit >= 0 ? 'green' : 'red'); ?>-600">
                                       <?php echo e($subscription->total_profit >= 0 ? '+' : ''); ?>$<?php echo e(number_format($subscription->total_profit, 2)); ?>

                                   </span>
                               </td>
                               <td class="px-4 py-3">
                                   <span class="px-2 py-1 text-xs rounded-full 
                                       <?php echo e($subscription->status === 'active' ? 'bg-green-100 text-green-800' : 
                                          ($subscription->status === 'completed' ? 'bg-blue-100 text-blue-800' : 'bg-red-100 text-red-800')); ?>">
                                       <?php echo e(ucfirst($subscription->status)); ?>

                                   </span>
                               </td>
                               <td class="px-4 py-3 text-sm">
                                   <div class="flex flex-col">
                                       <span>Start: <?php echo e($subscription->subscribed_at->format('M d, Y H:i')); ?></span>
                                       <span>End: <?php echo e($subscription->expires_at ? $subscription->expires_at->format('M d, Y H:i') : 'N/A'); ?></span>
                                   </div>
                               </td>
                               <td class="px-4 py-3">
                                   <div class="flex items-center space-x-2">
                                       <a href="<?php echo e(route('admin.subscriptions.show', $subscription)); ?>" 
                                          class="p-1 text-blue-600 hover:text-blue-900 rounded-full hover:bg-blue-100">
                                           <i class="ri-eye-line text-lg"></i>
                                       </a>
                                   </div>
                               </td>
                           </tr>
                       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                           <tr>
                               <td colspan="6" class="px-4 py-8 text-center text-gray-500">
                                   No subscriptions found
                               </td>
                           </tr>
                       <?php endif; ?>
                   </tbody>
               </table>
           </div>
           
           <div class="px-4 py-3 border-t">
               <?php echo e($subscriptions->links()); ?>

           </div>
       </div>
   </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $attributes = $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $component = $__componentOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?><?php /**PATH C:\Users\Digi\Downloads\Laravel Deployment Task_ Validate, Preview, and Package ZIP\aurumsafe\fsfcore\resources\views\admin\subscriptions\index.blade.php ENDPATH**/ ?>