<?php
use Livewire\Component;
use App\Models\Grossesse;
use App\Models\ReportQuarter;
use App\Services\RepportService;
?>

<div>
    <div class="card-header my-0 pb-0">
        <div class="d-flex justify-content-between">
            <h6>b - Les Cas de Grossesse</h6>
            <span>
                <button wire:click="myInput" class="btn btn-inverse btn-outline-inverse btn-sm py-1 mt-0" title="Edit Info" data-toggle="modal" data-target="#gsseModal">
                <i class="fas fa-pen m-0"></i>
                </button>
            </span>
        </div>
    </div>
    <div class="card-body table-border-style mt-2">
        <div class="table-responsive">
            <table class="table table-bordered" style="width: 100%">
                <thead>
                    <tr>
                        <th class="text-center">N°</th>
                        <th>Matricule</th>
                        <th>Nom et Prénons</th>
                        <th>Sexe</th>
                        <th>Age</th>
                        <th>Classe</th>
                        <th>Date dépot <br> du certificat de grossesse</th>
                        <th>Date possible <br> d'accouchement</th>
                        <th>Qualité de l'auteur</th>
                    </tr>
                </thead>
                <tbody>
                <?php $i = 1; ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                    <tr>
                    <th class="text-center"><?php echo e($i < 10 ? '0'.$i++:$i++); ?></th>
                    <td class="text-center"><?php echo e($item->inscription->student->matricule); ?></td>
                    <td>
                        <?php echo e(strtoupper($item->inscription->student->first_name).' '.ucwords($item->inscription->student->last_name)); ?>

                    </td>
                    <td class="text-center"><?php echo e($item->inscription->student->sexe); ?></td>
                    <td class="text-center"><?php echo e($item->inscription->student->age.' ans'); ?></td>
                    <td><?php echo e(ucfirst($item->classe->libelle)); ?></td>
                    <td><?php echo e(date('d/m/Y', strtotime($item->date_depot))); ?></td>
                    <td><?php echo e(date('d/m/Y', strtotime($item->date_accouch))); ?></td>
                    <td><?php echo e(ucfirst($item->qualite)); ?></td>
                    </tr> 
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                    <tr>
                    <td colspan="10" class="text-center">Underdefined data</td>
                    </tr>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
    <!-- @Modal -->
    <div wire:ignore.self class="modal fade" id="gsseModal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg modal-dialog-centered" role="document" style="max-width: 50%;">
            <div class="modal-content">
                <div class="modal-header bg-dark py-2">
                    <h4 class="modal-title">Cas de Grossesse</h4>
                    <strong style="font-size: 17px">
                        <?php echo e(sizeof($input) ? 'Edit':'Add'); ?>

                        <i class="fas fa-pencil-alt my-0"></i>
                    </strong>
                </div>
                <form action="<?php echo e(route('chapter_3.grsse')); ?>" method="post">
                    <?php echo csrf_field(); ?>
                    <div class="modal-body">
                        <button type="button" class="btn mb-1 p-0 btnGsse" style="width: 25px; float: right; border: 1px solid grey">+</button>
                        <table class="table table-bordered mt-" id="myTableGsse" style="width: 100%">
                        <tbody>
                            <?php $i = 1; ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $input; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                            <tr>
                                <td style="width: 100%">
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="class_g_<?php echo e($i); ?>">Classe<span class="text-danger">*</span> :</label>
                                            <select name="tab1[]" id="class_g_<?php echo e($i); ?>" class="form-control getClass" data-id="<?php echo e($i); ?>" data-lib="b_gss">
                                                <option value="">Select ...</option>
                                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $classe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                                <option value="<?php echo e($classe->id); ?>" <?php echo e($classe->id == $item->classe_id  ? 'selected':null); ?>><?php echo e(ucfirst($classe->libelle)); ?></option>
                                                <?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; ?>
                                            </select>
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="std_gss_<?php echo e($i); ?>">Elève<span class="text-danger">*</span> :</label>
                                            <select name="tab2[]" id="std_gss_<?php echo e($i); ?>" class="form-control">
                                                <option class="<?php echo e('opt_gss_'.$i); ?>" value="<?php echo e($item->inscription_id); ?>">
                                                    <?php echo e(strtoupper($item->inscription->student->first_name).' '.ucwords($item->inscription->student->last_name)); ?>

                                                </option>
                                            </select>
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="dte_d_<?php echo e($i); ?>">Date dépot du certificat de grossesse<span class="text-danger">*</span> :</label>
                                            <input type="date" name="tab3[]" id="dte_d_<?php echo e($i); ?>" class="form-control" value="<?php echo e($item->date_depot); ?>">
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="dte_p_<?php echo e($i); ?>">Date possible d'accouchement<span class="text-danger">*</span> :</label>
                                            <input type="date" name="tab4[]" id="dte_p_<?php echo e($i); ?>" class="form-control" value="<?php echo e($item->date_accouch); ?>">
                                        </div>
                                        <div class="col-sm-12">
                                            <label class="col-form-label" for="qlt_<?php echo e($i); ?>">Qualité de l'auteur<span class="text-danger">*</span> :</label>
                                            <input type="text" name="tab5[]" id="qlt_<?php echo e($i); ?>" class="form-control" value="<?php echo e($item->qualite); ?>">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php $i++ ?>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                            <tr>
                                <td style="width: 100%">
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="class_g_1">Classe<span class="text-danger">*</span> :</label>
                                            <select name="tab1[]" id="class_g_1" class="form-control getClass" data-id="1" data-lib="b_gss">
                                                <option value="">Select ...</option>
                                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $classe): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoop($loop->index); ?><?php endif; ?>
                                                <option value="<?php echo e($classe->id); ?>"><?php echo e(ucfirst($classe->libelle)); ?></option>
                                                <?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; ?>
                                            </select>
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="std_gss_1">Elève<span class="text-danger">*</span> :</label>
                                            <select name="tab2[]" id="std_gss_1" class="form-control">
                                                <option value="">Select ...</option>
                                            </select>
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="dte_d_1">Date dépot du certificat de grossesse<span class="text-danger">*</span> :</label>
                                            <input type="date" name="tab3[]" id="dte_d_1" class="form-control" placeholder="---">
                                        </div>
                                        <div class="col-sm-6">
                                            <label class="col-form-label" for="dte_p_1">Date possible d'accouchement<span class="text-danger">*</span> :</label>
                                            <input type="date" name="tab4[]" id="dte_p_1" class="form-control" placeholder="---">
                                        </div>
                                        <div class="col-sm-12">
                                            <label class="col-form-label" for="qlt_1">Qualité de l'auteur<span class="text-danger">*</span> :</label>
                                            <input type="text" name="tab5[]" id="qlt_1" class="form-control" placeholder="---">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </tbody>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <input type="hidden" name="school" value="<?php echo e($school); ?>">
                        <input type="hidden" name="cutting" value="<?php echo e($cutting); ?>">
                        <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-dismiss="modal">Fermer</button>
                        <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2">Valider</button>
                    </div>
                    </form>
            </div>
        </div>
    </div>
</div><?php /**PATH C:\Users\EDUCAS\Desktop\App\V4_001\storage\framework/views/livewire/views/58c47fda.blade.php ENDPATH**/ ?>