<?php $__env->startSection('title', __('dashboard.academy_details')); ?>

<?php $__env->startSection('content'); ?>
<?php if (isset($component)) { $__componentOriginalcb19cb35a534439097b02b8af91726ee = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalcb19cb35a534439097b02b8af91726ee = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.admin.page-header','data' => ['title' => ''.e(__('dashboard.academy_details')).'','breadcrumbs' => [__('dashboard.academies') => route('admin.academies.index'), __('dashboard.details') => '']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin.page-header'); ?>
<?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(['title' => ''.e(__('dashboard.academy_details')).'','breadcrumbs' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute([__('dashboard.academies') => route('admin.academies.index'), __('dashboard.details') => ''])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalcb19cb35a534439097b02b8af91726ee)): ?>
<?php $attributes = $__attributesOriginalcb19cb35a534439097b02b8af91726ee; ?>
<?php unset($__attributesOriginalcb19cb35a534439097b02b8af91726ee); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalcb19cb35a534439097b02b8af91726ee)): ?>
<?php $component = $__componentOriginalcb19cb35a534439097b02b8af91726ee; ?>
<?php unset($__componentOriginalcb19cb35a534439097b02b8af91726ee); ?>
<?php endif; ?>
<div class="row justify-content-center">
    <div class="col-xl-12">
        <div class="card mb-4">
            <div class="card-body">
                <?php if($academy->image): ?>
                    <img src="<?php echo e(asset('storage/' . $academy->image)); ?>" alt="<?php echo e($academy->name); ?>" class="img-fluid rounded mb-3" style="max-height: 200px; object-fit: cover;">
                <?php endif; ?>
                <div class="d-flex justify-content-between align-items-start">
                    <div>
                        <h3 class="mb-1"><?php echo e($academy->name); ?></h3>
                        <p class="text-muted mb-0"><?php echo e($academy->description ?? '-'); ?></p>
                    </div>
                    <?php if($academy->is_active): ?>
                        <span class="badge bg-success"><?php echo e(__('dashboard.active')); ?></span>
                    <?php else: ?>
                        <span class="badge bg-danger"><?php echo e(__('dashboard.inactive')); ?></span>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header">
                <h5 class="card-title mb-0"><?php echo e(__('dashboard.general_info')); ?></h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.id')).'','value' => $academy->id]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.id')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->id)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.game')).'','value' => $academy->game?->name ?? '-']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.game')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->game?->name ?? '-')]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.name')).'','value' => $academy->name]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.name')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->name)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.description')).'','value' => $academy->description ?? '-']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.description')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->description ?? '-')]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.created_at')).'','value' => $academy->created_at]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.created_at')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->created_at)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                    <?php if (isset($component)) { $__componentOriginal40a0879f2990b42acf60bffd404c55f9 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal40a0879f2990b42acf60bffd404c55f9 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.view-col','data' => ['label' => ''.e(__('dashboard.updated_at')).'','value' => $academy->updated_at]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('view-col'); ?>
<?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(['label' => ''.e(__('dashboard.updated_at')).'','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($academy->updated_at)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $attributes = $__attributesOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__attributesOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal40a0879f2990b42acf60bffd404c55f9)): ?>
<?php $component = $__componentOriginal40a0879f2990b42acf60bffd404c55f9; ?>
<?php unset($__componentOriginal40a0879f2990b42acf60bffd404c55f9); ?>
<?php endif; ?>
                </div>
                <?php if($academy->coaches->isNotEmpty()): ?>
                    <hr>
                    <h6><?php echo e(__('dashboard.coaches')); ?></h6>
                    <div class="row g-3">
                        <?php $__currentLoopData = $academy->coaches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coach): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-md-4 col-lg-3">
                                <div class="card h-100 shadow-sm">
                                    <?php if($coach->image): ?>
                                        <img src="<?php echo e(asset('storage/' . $coach->image)); ?>" class="card-img-top" alt="<?php echo e($coach->name); ?>" style="height: 180px; object-fit: cover;">
                                    <?php else: ?>
                                        <img src="<?php echo e(asset('images/default-coach.png')); ?>" class="card-img-top" alt="<?php echo e($coach->name); ?>" style="height: 180px; object-fit: cover;">
                                    <?php endif; ?>
                                    <div class="card-body d-flex flex-column">
                                        <h5 class="card-title mb-1"><?php echo e($coach->name); ?></h5>
                                        <p class="card-text text-muted mb-2"><i class="bi bi-telephone"></i> <?php echo e($coach->phone); ?></p>
                                        <a href="<?php echo e(route('admin.coaches.show', $coach->id)); ?>" class="btn btn-sm btn-primary mt-auto"><?php echo e(__('dashboard.view')); ?></a>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                <?php endif; ?>
                <?php if($academy->schedules->isNotEmpty()): ?>
                    <hr>
                    <h6><?php echo e(__('dashboard.academy_schedules')); ?></h6>
                    <ul class="list-unstyled mb-0">
                        <?php $__currentLoopData = $academy->schedules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $schedule): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li>
                                <a href="<?php echo e(route('admin.academy-schedules.show', $schedule->id)); ?>">
                                    <?php echo e($schedule->court?->name); ?> — <?php echo e(\Carbon\Carbon::parse($schedule->start_time)->format('H:i')); ?>-<?php echo e(\Carbon\Carbon::parse($schedule->end_time)->format('H:i')); ?>

                                </a>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                <?php endif; ?>
            </div>
        </div>

        
        <?php if($academy->game_id): ?>
        <div class="card mt-4 mb-4">
            <div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2">
                <h5 class="card-title mb-0">
                    <i class="ri-time-line me-1"></i><?php echo e(__('dashboard.slots')); ?>

                    <small class="text-muted fs-12">(<?php echo e($academy->game?->name ?? ''); ?>)</small>
                </h5>
                <div class="d-flex align-items-center gap-2">
                    <input type="date" id="slot-date-filter" class="form-control form-control-sm" style="width:160px" value="<?php echo e(now()->toDateString()); ?>">
                    <input type="hidden" id="slot-academy-filter" value="<?php echo e($academy->id); ?>">
                    <a href="<?php echo e(route('admin.slots.index')); ?>?academy_id=<?php echo e($academy->id); ?>" class="btn btn-sm btn-soft-primary">
                        <?php echo e(__('dashboard.view_all')); ?>

                    </a>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive custom-scrollbar server-side-table">
                    <?php echo $dataTable->table(['class' => 'table table-bordered', 'id' => 'slots-table']); ?>

                </div>
            </div>
        </div>
        <?php endif; ?>

        
        <div class="card mt-4 mb-4">
            <div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2">
                <h5 class="card-title mb-0">
                    <i class="ri-team-line me-1"></i><?php echo e(__('dashboard.members') ?? 'Members'); ?>

                </h5>
                <div class="d-flex align-items-center gap-2">
                    <a href="<?php echo e(route('admin.academies.members.index', $academy->id)); ?>" class="btn btn-sm btn-primary">
                        <i class="ri-user-add-line me-1"></i> <?php echo e(__('dashboard.manage_members') ?? 'Manage Members'); ?>

                    </a>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive custom-scrollbar server-side-table">
                    <?php echo $membersDataTable->table(['class' => 'table table-bordered', 'id' => 'academy-assigned-members-table']); ?>

                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<?php if($academy->game_id): ?>
<?php echo $dataTable->scripts(); ?>

<script>
document.addEventListener('DOMContentLoaded', function () {
    const table = $('#slots-table').DataTable();

    // The filter elements will be automatically picked up by dtFilters 
    // when 'draw' happens.
    $('#slot-date-filter').on('change', function () {
        table.draw();
    });
});
</script>
<?php endif; ?>
<?php echo $membersDataTable->scripts(); ?>

<script>
document.addEventListener('DOMContentLoaded', function () {
    initDataTableFilters({
        tableId: 'academy-assigned-members-table',
        csrf: '<?php echo e(csrf_token()); ?>',
        filters: [],
        selectAll: '#check-all'
    });
});
</script>
<?php $__env->stopPush(); ?>


<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/takwgzfj/montsportscamp.com/resources/views/admin/academies/show.blade.php ENDPATH**/ ?>