<?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(); ?>

<?php $__env->startSection('styles'); ?>
    <?php echo Html::style('css/jquery.fancybox.css'); ?> 
    <?php echo Html::style('css/jquery.fancybox-buttons.css'); ?> 
<?php $__env->stopSection(); ?>


    <div class="col-lg-max container-fluid col-lg-offset-1 bg-info alert">
        <div class="col-xs-2">
           <?php echo Html::image("img/".$user->getIconeStatut($type), "", 
            array( 'maxwidth' => '20%','width' => '50%' )); ?> 
        </div>
        <div class="col-xs-10">
            <h1><?php echo "Versement en préparation des ".$user->getTitreStatut($type); ?></h1>
        </div>
    </div>

    <div class="col-lg-max  container-fluid col-lg-offset-1" style="padding-top:20px">
    <?php if($type!=""): ?>

    <?php if($error_compte>0): ?>
            <div class='bg-danger alert'>
            <?php if($error_compte==1): ?>
                <?php echo "Attention : $error_compte compte bancaire est en anomalie !"; ?>

            <?php else: ?>
                <?php echo "Attention : $error_compte comptes bancaires sont en anomalie !"; ?>

            <?php endif; ?>
        </div>
    <?php endif; ?>
    
        <div class="table-responsive">
            <table id="_table" class="table table-condensed table-striped table-bordered">
                <thead>
                    <tr>
                        <th width='1%'>N°</th>
                        <th width='1%'>N°Emp</th>
                        <th >Bénéficiaire</th>
                        <th width='1%'>NbEnf<?php echo ($type!="RET")?" Considérés":""; ?></th>
                        <th width='1%'>Naissance</th>
                        <th width='1%'>Statut</th>
                        <th width='1%'>Type</th>
                        <?php if($type=="RET"): ?>
                        <th width='1%'>RetType</th>
                        <th width='1%'>RetDate</th>
                        <th width='1%'>RetNum</th>
                        <?php endif; ?>
                        <!-- <th width='1%' nowrap>N°IMP</th> -->
                        <th width='1%'>Rappel</th>
                        <th width='1%'>Calcul</th>
                        <th width='1%'>Montant</th>
                        <th width='10%'>Banque</th>
                        <th width='10%'>Compte</th>
                        <th>Obs</th>
                    </tr>
                </thead>
     

                <tbody>
                <?php $__currentLoopData = $versements_b; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $versement_b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                    $beneficiaire=App\Models\Beneficiaire::find($versement_b->benum);
                ?>
                
                <tr>
                    <td style="color:grey"><?php echo $versement_b->benum; ?></td>
                    <td style="color:grey"><?php echo $versement_b->sonum; ?></td>
                    <td><a href="<?php echo url('tiers/beneficiaires/'.$versement_b->benum); ?>" 
                        class="" target="_blank">
                        <?php echo $versement_b->nom_beneficiaire." ".$versement_b->prenom_beneficiaire; ?></td>
                        </a>
                    <td>
                        <?php echo $versement_b->nb_enf.(($type=="RET")?"":"/".$beneficiaire->NbEnfants); ?>

                    </td>
                    <td><?php echo $versement_b->naissance_beneficiaire; ?></td>
                    <td align="center"><?php echo $versement_b->statut_beneficiaire; ?></td>
                    <td align="center"><?php echo $versement_b->type; ?></td>
                    <?php if($type=="RET"): ?>
                    <td align="center"><?php echo $versement_b->ret_type; ?></td>
                    <td align="center"><?php echo $versement_b->ret_date; ?></td>
                    <td align="center"><?php echo $versement_b->ret_num; ?></td>
                    <?php endif; ?>
                    <!-- <td align="center"><?php echo $versement_b->num_imp; ?></td> -->
                    <td align="right" nowrap><?php echo number_format($versement_b->montant_r,0,","," "); ?></td>
                    <td align="right" nowrap><?php echo number_format($versement_b->montant_c,0,","," "); ?></td>
                    <td align="right" style="font-weight:bold;" class="bg-danger" nowrap><?php echo number_format($versement_b->montant,0,","," "); ?></td>
                    <td><?php echo $versement_b->banque_nom; ?></td>
                    <td 
                        <?php echo (!$versement_b->CompteOK)?'class="bg-danger alert mark" style="color:red;text-weight:bold"':''; ?>>
                        <?php echo $versement_b->compte; ?>

                        <?php echo (!$versement_b->CompteOK)?' !!ANOMALIE!!':''; ?>

                    </td>
                    <td><?php echo $versement_b->obs_vers; ?></td>
                    

                </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
     
            </table>
        </div>
    <?php endif; ?>


<p>
    <div class='form-group form-horizontal'>
        <?php if($type!=""): ?>
            <div class="col-xs-3">
                    <a href="<?php echo url('versements_brouillon_print/'.$type); ?>" 
                        class="btn btn-info"  target="_blank">Imprimer le borderau</a>
            </div>
        <?php endif; ?>
    </div>
</p>


</body></html>

<?php echo Html::script('js/magicsuggest.js'); ?>

<?php echo Html::script('js/jquery.fancybox.js'); ?>

<?php echo Html::script('js/jquery.dataTables.editable.js'); ?> 

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

<script>
    $("._box").fancybox({
        //fitToView   : true,
        width       : '85%',
        height      : '85%',
        closeClick  : true,
        openEffect  : 'fade',
        closeEffect : 'fade',
    });
</script>
<?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre\resources\views/prestations/versements/index_brouillon.blade.php ENDPATH**/ ?>