
<?php $__env->startSection('title'); ?> Cotisations <?php $__env->stopSection(); ?>
<?php $__env->startSection('title_card',""); ?>
<?php $__env->startSection('subtitle_card',""); ?>


<?php $__env->startSection('content'); ?>
    <div class="card">
        <div class="col-lg-max col-lg-offset-1 container-fluid">
            <div class="card-header bg-info">
                Controles
            </div>
            <div class="card-body">
                <div class='row form-group ' style="padding-bottom:20px">
                    <div class="col-md-6">
                    <?php echo html()->select('employeur_id',$liste_employeur,$employeur_id)
                        ->placeholder('Choisissez un employeur')
                        ->attributes(['id' => 'employeur_id2','class' => 'form-control']); ?>


                    </div>
                </div>
                <?php if($employeur_id): ?>
                    <div class="table-responsive col-lg-12 ">
                        <table id="_table" class="table table-condensed table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th width='1px'>N°</th>
                                    <th width='1px'>Contrôle</th>
                                    <th>Agent1</th>
                                    <th>Agent2</th> 
                                    <th>Validation</th>
                                    <th>Observations</th>
                                    <th>Pièces</th>
                                    <th width='75px'>&nbsp</th>
                                </tr>
                            </thead>
                 
                            <tbody>
                            <?php $__currentLoopData = $controles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $controle): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td style="color:grey"><?php echo $controle->id; ?></td>
                                <td align="center"><?php echo $controle->date_cont; ?></td>
                                <td align="left"><?php echo $controle->agent1; ?></td>
                                <td align="left"><?php echo $controle->agent2; ?></td>
                                <td align="center"><?php echo $controle->date_valid; ?></td>
                                <td align="left"><?php echo $controle->observations; ?></td>
                                <td nowrap align="left" style=''><?php echo $controle->PJ; ?></td>
                                <td nowrap class="form-inline">
                                    <?php if($user->can("COT_MAJ") || $user->HasRole("ADMINISTRATEUR")): ?>   
                                        <a href="<?php echo url('controles/addpiece/'.$controle->id); ?>" class="addpiece fancybox.iframe">
                                            <span class='btn btn-sm btn-success pull-left'>&nbsp;+&nbsp;<span class='fas fa-file'></span>
                                        </a>&nbsp;
                                    <?php endif; ?>
                                    <?php if($user->can("COT_VISU") || $user->HasRole("ADMINISTRATEUR")): ?>
                                        <a href="<?php echo url('controles/'.$controle->id ); ?>"
                                             class="btn btn-sm btn-warning pull-left"><span class=' fas fa-eye'></span></a>&nbsp;
                                    <?php endif; ?> 
                                </td>
                            </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                 
                        </table>
                    </div>
                    <?php if($user->can("COT_AJO") || $user->HasRole("ADMINISTRATEUR")): ?>
                         <div  class="col-lg-10">
                            <h4><a href="<?php echo url('controles/create/'.$employeur_id); ?>" class="btn btn-success">Ajouter un controle</a></h4>
                        </div> 
                    <?php endif; ?>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
    <!-- FancyBox -->
    <link media="all" type="text/css" rel="stylesheet" href="<?php echo e(url('css/jquery.fancybox.css')); ?>">
    <link media="all" type="text/css" rel="stylesheet" href="<?php echo e(url('css/jquery.fancybox-buttons.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts0'); ?>
    <script src="<?php echo e(url('js/jquery.fancybox.js')); ?>"></script>
    <script>
        $(".addpiece").fancybox({
            //maxWidth    : 800,
            //maxHeight   : 600,
            fitToView   : false,
            width       : '80%',
            height      : '40%',
            autoSize    : true,
            autoScale   : true,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none',
            afterClose  : function() { 
                window.location.reload();
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script>
        $(document).ready(function() {
            $('#employeur_id2').on('change', function() {
                location.href="<?php echo url('/controle_annee/'); ?>/"
                    +$('#employeur_id2').val();
            });

            $('#_table').dataTable( {
                "bAutoWidth": false,
                "bPaginate": false,
                "bInfo": false,
                "bFilter": true,
                "oLanguage": {
                    "sZeroRecords": "Aucune ligne",
                    "sInfo": "Affichage de _START_ &agrave; _END_ sur _TOTAL_ lignes",
                    "sInfoEmpty": "Showing 0 to 0 of 0 records",
                    "sInfoFiltered": "(sur un total de _MAX_ lignes)",
                     "sSearch":"Chercher",
                    },

                "order": [[ 0, "desc" ]]
                } );
         } );
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dash', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre2\resources\views/recouvrement/controles/index.blade.php ENDPATH**/ ?>