<?php $__env->startSection('Candidature'); ?>
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">

                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <?php echo $__env->make('sweetalert::alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <div class="container mb-3 ">
        <div class="card">
            <div class="card-header" style="background-color:#0b440e;">
                <h2 class="card-title text-white fw-bolder">Les Candidatures</h2>
                <div class="card-tools">

                </div>
            </div>

            <!-- /.card-header -->
            <div class="card-body">

                <div class="dataTable-container">

                    <table id="dtBasicExample" class="table table-striped table-bordered table-hover" cellspacing="0"
                        width="100%">
                        <thead>
                            <tr>
                                <th>Noms</th>
                                <th>Prenoms</th>
                                <th>Pays de Résidence</th>
                                <th>emails</th>
                                <th>Domaines d'Activités</th>
                                <th>Domaines d'Etudes</th>

                                <th>Diplomes</th>
                                <th>Telephones</th>
                                <th>CV</th>
                                <th>status</th>
                                <th>Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $candidature; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>

                                    <td><?php echo e($item->nomCand); ?></td>
                                    <td><?php echo e($item->prenomsCand); ?></td>
                                    <td><?php echo e($item->paysResidence); ?></td>
                                    <td><?php echo e($item->email); ?></td>
                                    <td><?php echo e($item->DomaineActivite->nomActivite); ?></td>
                                    <td><?php echo e($item->DomaineEtude->nomEtude); ?></td>
                                    <td><?php echo e($item->DiplomeCand->nomDiplome); ?></td>
                                    <td><?php echo e($item->telephone); ?></td>
                                    <td> <img class="d-block w-100" src="<?php echo e(asset('img/' . $item->curriculum)); ?>"
                                        width="10px" alt="Third slide"></td>
                                    <td><?php echo e($item->status); ?></td>
                                    <td>
                                        <div class=" d-flex grid ">
                                            <div class="g-col-4">
                                                <div class="editbtn" type="button" value="<?php echo e($item->id); ?>">
                                                    <i class="fa fa-edit" style="color: #0b440e;"></i>
                                                </div>
                                            </div>
                                            <div class="g-col-4 ml-3">
                                                <div class="deletebtn" type="button" value="<?php echo e($item->id); ?>">
                                                    <i class="fa fa-trash" style="color: #ec270d;"></i>
                                                </div>
                                            </div>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>

                    </table>
                </div>

            </div>
            <!-- /.card-body -->
        </div>

    </div>
    </div>


    <?php echo $__env->make('Admin.pages.File_Candidature.deleteCandidature', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!-- Modal-->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        $(document).ready(function() {
            $(document).on('click', '.deletebtn', function() {
                var iddelte = $(this).attr('value');
                //alert('ID de l\'organisateur : ' + id);
                $('#ModalDelete').modal('show');
                $('#deleteing_id').val(iddelte);
            });

            $(document).on('click', '.editbtn', function() {
                var id = $(this).attr('value');
                //alert('ID de l\'organisateur : ' + id);
                $('#ModalEdit').modal('show');
                $.ajax({
                    type: "GET",
                    url: "<?php echo e(route('Candidature.edit', ':id')); ?>".replace(':id', id),
                    success: function(response) {
                        console.log(response.Candidature);
                        $('#nomCand').val(response.Candidature.nomCand);
                        $('#prenomsCand').val(response.Candidature.prenomsCand);
                        $('#paysResidence').val(response.Candidature.paysResidence);
                        $('#email').val(response.Candidature.email);
                        $('#nomActivite').val(response.Candidature.nomActivite);
                        $('#nomEtude').val(response.Candidature.nomEtude);
                        $('#nomDiplome').val(response.Candidature.Diplome);
                        $('#telephone').val(response.Candidature.telephone);
                        $('#curriculum').val(response.Candidature.curriculum);
                        $('#id').val(response.Candidature.id);
                    }
                })
            });
        });
    </script>
    <script>
        $(document).ready(function() {
            $('#dtBasicExample').DataTable({
                "processing": true,
                "paging": true,
                "lengthChange": true,
                "searching": true,
                "ordering": true,
                "info": true,
                "autoWidth": false,
                "responsive": false,
                "scrollX": true,
                "scrollY": 200,
            });
            $('.dataTables_length').addClass('bs-select');
        });
    </script>
<?php $__env->stopSection(); ?>




























<?php echo $__env->make('Admin.pages.layout.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /opt/lampp/htdocs/TT/resources/views/Admin/pages/File_Candidature/Candidature.blade.php ENDPATH**/ ?>