<?php $__env->startSection('title', 'Games'); ?>
<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h4>Games</h4>
                    <div class="card-header-form">
                        <?php if (isset($component)) { $__componentOriginal61542037d001e2034791c9aff5866543 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal61542037d001e2034791c9aff5866543 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.search-bar','data' => ['route' => ''.e(route('games.index')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('search-bar'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['route' => ''.e(route('games.index')).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal61542037d001e2034791c9aff5866543)): ?>
<?php $attributes = $__attributesOriginal61542037d001e2034791c9aff5866543; ?>
<?php unset($__attributesOriginal61542037d001e2034791c9aff5866543); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal61542037d001e2034791c9aff5866543)): ?>
<?php $component = $__componentOriginal61542037d001e2034791c9aff5866543; ?>
<?php unset($__componentOriginal61542037d001e2034791c9aff5866543); ?>
<?php endif; ?>
                    </div>
                </div>
                <div class="card-body p-2">
                    <div class="table-responsive">
                        <table id="myTable" class="table table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Win Number</th>
                                    <th>Total Bettings</th>
                                    <th>Total Agents</th>
                                    <th>Grand Total Bet Amount</th>
                                    <th>Grand Total Winning Amount</th>
                                    <th>Game Time (mins)</th>
                                    <th>Created At</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $games; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $game): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td> <span class="badge badge-primary"><?php echo e($game->id); ?></span></td>
                                        <?php if(!$game->isResultDeclared()): ?>
                                            <td><a class="btn btn-success text-white"
                                                    href="<?php echo e(route('games.current-running')); ?>">Click me to show</a></td>
                                        <?php else: ?>
                                            <td>
                                                <?php echo e($game->win_number); ?>

                                                (<?php echo e(is_null($game->manual_result) ? 'auto' : 'manual'); ?>)
                                            </td>
                                            <td><?php echo e(number_format($game->total_bettings ?? 0)); ?> </td>
                                            <td><?php echo e(number_format($game->total_agents ?? 0)); ?> </td>
                                            <td><?php echo e($game->getGrandTotalBetAmount()); ?></td>
                                            <td><?php echo e($game->getGrandTotalWinningAmount()); ?></td>
                                            <td><?php echo e($game->game_time); ?></td>
                                            <td><?php echo e($game->created_at->format('h:i a d-m-Y')); ?></td>
                                        <?php endif; ?>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        <?php echo e($games->links()); ?>

                        <?php if (! (filled($games))): ?>
                            <div class="mx-4 my-4 d-flex justify-content-center">
                                <h5> No games added yet.</h5>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/payfromupi/public_html/mplotteryking.site/resources/views/admin/games/index.blade.php ENDPATH**/ ?>