<?php $__env->startSection('title', 'School year'); ?>
<?php $__env->startSection('link'); ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="pcoded-inner-content">
    <?php echo $__env->make('includes._alert', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-header mb-0 pb-0">
                                <div class="d-flex justify-content-between pb-2">
                                    <h4>Découpage pour <?php echo e($item); ?></h4>
                                    <span class="form-control-variant">Les champ avec asterisk (<code>*</code>) sont obligatoires.</span>
                                    <span>
                                        <a href="<?php echo e(route('decoupage.index',$item)); ?>" class="btn btn-inverse btn-outline-inverse  btn-sm py-1" title="Return Back"><i class="fas fa-reply mx-0"></i></a>
                                    </span>
                                </div>
                            </div>
                            <hr class="my-0 mx-3">
                            <div class="card-block my-3">
                                <form action="<?php echo e(route($data[0]->cutting ? 'decoupage.update':'decoupage.store',$data[0]->cutting ? ['str' => $item, 'id' => $data[0]->cutting_id]:$item)); ?>" method="post">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field($data[0]->cutting ? 'put':'post'); ?>
                                    <div class="form-group row my-3">
                                        <div class="col-12">
                                            <div class="card-block">
                                                <div class="table-responsive">
                                                    <table class="table  table-borderless">
                                                        <tbody>
                                                            <input type="hidden" name="type" value="<?php echo e($item); ?>">
                                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                                            <tr>
                                                                <th scope="row"></th>
                                                                <th>
                                                                    <div class="col-form-label"><?php echo e(ucfirst($item->cutting ? $item->cutting->libelle:$item['libelle'])); ?></div>
                                                                    <input type="hidden" name="decoupage<?php echo e($item->cutting ? '':'[]'); ?>" value="<?php echo e($item->cutting ? $item->cutting_id:$item['id']); ?>">
                                                                </th>
                                                                <td>
                                                                    <div class="form-group row m-0 p-0">
                                                                        <label class="col-sm-3 col-form-label" for="dateDebut_<?php echo e($item->cutting ? $item->cutting_id:$item['id']); ?>">Date debut<span class="text-danger">*</span> :</label>
                                                                        <div class="col-sm-9">
                                                                            <input type="text" name="dateDebut<?php echo e($item->cutting ? '':'[]'); ?>" id="dateDebut_<?php echo e($item->cutting ? $item->cutting_id:$item['id']); ?>" class="form-control form-control-normal bg-white m-0 <?php $__errorArgs = ['dateDebut'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e($item->cutting ? $item->start_date:''); ?>" placeholder="Debut <?php echo e($item['libelle']); ?>">
                                                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['dateDebut'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                                                <span class="form-bar text-danger" role="alert">
                                                                                    <?php echo e($message); ?>

                                                                                </span>
                                                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="form-group row m-0 p-0">
                                                                        <label class="col-sm-3 col-form-label" for="dateFin_<?php echo e($item->cutting ? $item->cutting_id:$item['id']); ?>">Date fin<span class="text-danger">*</span> :</label>
                                                                        <div class="col-sm-9">
                                                                            <input type="text" name="dateFin<?php echo e($item->cutting ? '':'[]'); ?>" id="dateFin_<?php echo e($item->cutting ? $item->cutting_id:$item['id']); ?>" class="form-control form-control-normal bg-white m-0 <?php $__errorArgs = ['dateFin'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e($item->cutting ? $item->end_date:''); ?>" placeholder="Fin <?php echo e($item['libelle']); ?>">
                                                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__errorArgs = ['dateFin'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                                                <span class="form-bar text-danger" role="alert">
                                                                                    <?php echo e($message); ?>

                                                                                </span>
                                                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <hr>
                                    <div class="text-center">
                                        <button type="submit" class="btn btn-inverse btn-outline-inverse py-2"> <i class="fas fa-check-circle"></i> Valider les informations</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr/dist/l10n/fr.js"></script>
<script src="<?php echo e(asset('assets/js/pcoded.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/vartical-layout.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/jquery.mCustomScrollbar.concat.min.js')); ?>"></script>
<script>
    $(document).ready(function() {
        // Initialiser le date picker sur le champ avec l'ID 'datepicker'
        flatpickr(".form-control-normal", {
            locale: "fr",  // Utilise le français pour l'affichage
            dateFormat: "d-m-Y", // Format de la date
            altInput: true, // Afficher un format alternatif de la date
            altFormat: "d-m-Y", // Format alternatif pour afficher la date
        });

        var url = window.location.href; // Récupère l'URL actuelle
        var motRecherche = 'decoupage';
        if (url.indexOf(motRecherche) !== -1) {
            $('#idDecoup').addClass('pcoded-trigger')
        } 
    });
  </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\EDUCAS\Desktop\App\V4_001\resources\views\pages\decoupage\create.blade.php ENDPATH**/ ?>