<?php $__env->startSection('menu'); ?>
    <?php echo $__env->make('admin.menu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
    <div class="alert alert-success">
        <?php echo e(session('success')); ?>

    </div> 
<?php endif; ?>
<section class="courses-details bg-light py-5">
    <div class="container">
        <!-- Header -->
        <div class="header d-flex justify-content-between align-items-center mb-4">
            <h1 class="text-primary">Détails de l'Offre</h1>
            <a href="<?php echo e(route('admin.offres')); ?>" class="btn btn-outline-primary">
                <i class="bi bi-arrow-left"></i> Retour à la liste
            </a>
        </div>
        
        <!-- Offer Details -->
        <div class="card shadow-sm">
            <div class="card-body">
                <h2 class="card-title text-center text-uppercase"><?php echo e($offre->title); ?></h2>
                <p class="text-muted text-center">
                    Entreprise : <strong><?php echo e($offre->company_name); ?></strong>
                </p>
                <hr>
                <div class="row">
                    <div class="col-md-8">
                        <h5>Description de l'offre</h5>
                        <p><?php echo e($offre->description ?: 'Aucune description disponible.'); ?></p>
                        <h5>Description du type</h5>
                        <p><?php echo e($offre->offerType ? $offre->offerType->description : 'Aucune description disponible'); ?></p>
                        <h5>Description du domaine</h5>
                        <p><?php echo e($offre->domain ? $offre->domain   ->description : 'Aucune description disponible'); ?></p>
                    </div>
                   
                    <div class="col-md-4">
                        <h5 class="text-primary">Informations clés</h5>
                        <ul class="list-group list-group-flush">
                            <li class="list-group-item">
                                <strong>Référence de l'offre : </strong> <?php echo e($offre->reference); ?>

                            </li>
                            <li class="list-group-item">
                                <strong>Mots clé : </strong> <?php echo e($offre->keywords); ?>

                            </li>
                            <li class="list-group-item">
                                <strong>Type : </strong> <?php echo e($offre->offerType ? $offre->offerType->name : 'Type non défini'); ?>

                            </li>
                            <li class="list-group-item">
                                <strong>Domaine : </strong> <?php echo e($offre->domain ? $offre->domain->name : 'Domaine non défini'); ?>

                            </li>
                            <li class="list-group-item">
                                <strong>Date de début : </strong>
                                <?php echo e($offre->start_date ? (new \DateTime($offre->start_date))->format('d/m/Y') : 'Non spécifiée'); ?>

                            </li>

                            <li class="list-group-item" style="color: red">
                                <strong>Date de fin : </strong>
                                <?php echo e($offre->end_date ? (new \DateTime($offre->end_date))->format('d/m/Y') : 'Non spécifiée'); ?>

                            </li>

                            <li class="list-group-item">
                                <strong>Entreprise : </strong> <?php echo e($offre->company_name); ?>

                            </li>
                            
                        </ul>
                    </div>
                </div>
                <hr>
                <!-- Actions -->
                <div class="d-flex justify-content-center mt-3">
                    <?php if($offre->status == 'published'): ?>
                        <a href=" <?php echo e(route('admin.stop-offres' , ['id' => $offre->id])); ?>" class="btn btn-danger mx-2">
                            Suspendre
                        </a>
                    <?php else: ?>
                        <a href=" <?php echo e(route('admin.publisher-offres' , ['id' => $offre->id])); ?>" class="btn btn-success mx-2">
                            Publier
                        </a>
                    <?php endif; ?>
                    <a href="<?php echo e(route('admin.offres')); ?>" class="btn btn-outline-secondary mx-2">
                        Retour à la liste
                    </a>
                </div>
            </div>
        </div>
    </div>
</section>

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

<?php echo $__env->make('layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/africawebstudent/public_html/alumnis/resources/views/admin/showOffres.blade.php ENDPATH**/ ?>