<?php echo $__env->make('forms.fbncheader', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('forms.fdatatables', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<div style="background-color:rgba(255,192,203,.2);"  class="col-lg-max col-lg-offset-1 container-fluid">


<div style="padding-left:0px;" class="col-lg-12">
     <div class="row" style="">   
        <div class="col-xs-1" style="padding-left:0px;">
           <?php echo Html::image("img/enfants.png", 
                "Retraite", 
                array( 'width'=>'100%','height'=>'100%',
                    "style"=>"padding:4px;" )); ?> 
        </div>
        <div class="col-xs-3" style="padding-left:0px;">
            <h2 style="margin-top:2px;">Enfants </h2>
                <h4>Dont un des parents à le statut : 
                <?php echo Form::select(
                    'benef_type',
                    $liste_beneftype,
                    $benef_type,
                    [
                        'id' => 'benef_type2',
                        'class' => 'form-control selectpicker',
                        'data-width' => '100%',
                        'style' => 'height:50px;font-size:24px;font-weight:bold;
                    background-color: rgba(255,255,255,.5);'
                    ]
                ); ?></h4>
                <script>
                    $(document).ready(function() {
                        $('#benef_type2').on('change', function() {
                            var benef_type=$('#benef_type2').val();
                            location.href="<?php echo url('/tiers/enfants_in/'); ?>/"+benef_type;
                        });
                    });
                </script>
        </div>
    </div>
</div>



<div class='col-lg-max' style="padding-top:5px">
    <div class="">
        <table id="_table"  style="background-color:white"  
            class="table table-condensed table-hover table-striped table-bordered">
            <thead>
                <tr>
                    <th width='1%'>Id</th>
                    <th>Nom</th>
                    <th width='1%'>Sexe</th>
                    <th width='1%'>Certif.</th>
                    <th width='1%'>Date de naissance</th>
                    <th nowrap width='1%'>N°Resp.</th>
                    <th width='10%'>Responsable</th>
                    <th width='1%'>Statut Resp.</th>
                    <th width='10%'>Conjoint</th>
                    <th width='1%'>Statut Conj.</th>
                    <th width='185px'></th>
                </tr>
            </thead>
 
            <tbody>
                <?php $__currentLoopData = $enfants; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $enfant): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr class="clickable-row" data-href="<?php echo url('tiers/enfants/'.$enfant->id); ?>">
                    <td><?php echo str_pad($enfant->id, 6, "0", STR_PAD_LEFT); ?></td>
                    <td nowrap>
                        <?php if($user->can("ENF_VISU") || $user->HasRole("ADMINISTRATEUR")): ?><a href="<?php echo url('tiers/enfants/'.$enfant->id); ?>"><?php endif; ?> 
                            <?php echo $enfant->nom.' '.$enfant->prenom; ?>

                        <?php if($user->can("ENF_VISU") || $user->HasRole("ADMINISTRATEUR")): ?></a><?php endif; ?> 
                    </td>
                    <td align="center"><?php echo $enfant->sexe; ?></td>
                    <td align="center"><?php echo $enfant->certif; ?></td>
                    <td nowrap><?php echo $enfant->datenais; ?></td>
                    <td align="center"><?php echo $enfant->parents1; ?></td>
                    <td nowrap><?php echo $enfant->nom_parent1_reduit; ?></td>
                    <td align="center"><?php echo $enfant->statut_parent1; ?></td>
                    <td nowrap><?php echo $enfant->nom_parent2_reduit; ?></td>
                    <td align="center"><?php echo $enfant->statut_parent2; ?></td>
                    <td nowrap>
                    <?php if($user->can("ENF_MAJ") || $user->HasRole("ADMINISTRATEUR")): ?>
                        <a href="<?php echo url('tiers/enfants/'.$enfant->id.'/edit'); ?>" class="btn btn-info pull-left" style="margin-right: 3px;">Modifier</a>
                    <?php endif; ?> 
                    <?php if($user->can("ENF_SUP") || $user->HasRole("ADMINISTRATEUR")): ?>   
                        <?php echo Form::open(['url' => '/tiers/enfants/' . $enfant->id, 'method' => 'DELETE']); ?>

                        <?php echo Form::submit('Supprimer', ['class' => 'btn btn-danger']); ?>

                        <?php echo Form::close(); ?>

                    <?php endif; ?> 
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
 
        </table>
        <?php if($user->can("ENF_VISU") || $user->HasRole("ADMINISTRATEUR")): ?>
            <script>
            jQuery(document).ready(function($) {
                $(".clickable-row").click(function() {
                    window.document.location = $(this).data("href");
                });
            });
            </script>
        <?php endif; ?>
    </div>
<?php if($user->can("ENF_AJO") || $user->HasRole("ADMINISTRATEUR")): ?>
     <div>
        <h4><a href="./enfants/create" class="btn btn-success">Ajouter un enfant</a></h4>
    </div> 
<?php endif; ?>

</div>

</body></html>

<?php $__env->startSection('sort'); ?>

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

<?php echo $__env->make('forms.fdatatables_script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre\resources\views/tiers/enfants/index.blade.php ENDPATH**/ ?>