<?php
    $t_mois=["jan"=>"01","fev"=>"02","mar"=>"03","avr"=>"04","mai"=>"05",
        "jun"=>"06","jui"=>"07","aou"=>"08","sep"=>"09","oct"=>"10","nov"=>"11","dec"=>"12"];
?>
<div class="callout callout-warning">
    <div class="form-group row">
        <div class="col-md-12">
            <a href="<?php echo url('salaire_imprime/'.$beneficiaire->id); ?>" class="btn btn-sm btn-info" target="_blank" style="text-decoration:none;color:white" >Imprimer</a>
            <a href="<?php echo url('/salaire_liquidation/'.$beneficiaire->id); ?>" id=''  class="btn btn-sm  btn-info" target="_blank" style="text-decoration:none;color:white" >Feuille de Liquidation</a>
            <?php if( ($beneficiaire->sonum>0) && ($user->can("SAL_AJO") || $user->HasRole("ADMINISTRATEUR") ) ): ?>
                <a href="<?php echo url('salaire_annee/'.$beneficiaire->sonum.'/'.$beneficiaire->id); ?>" 
                    class="btn btn-sm btn-success" style="text-decoration:none;color:white"
                    target="_blank">Gestion des Salaires</a>
            <?php endif; ?> 
        </div>
    </div>

    <div class="form-group row">
        <div class="col-md-12">
            <table id="_table_salaire" class="table table-condensed table-striped table-bordered">
                <thead>
                    <tr>

                        <th width='1px'>N°</th>
                        <th >Employeur</th>
                        <th width='1px'>Année</th>
                        <?php $__currentLoopData = $t_mois; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mois=>$nummois): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <th width='1px'  align='center'><?php echo $mois; ?></th>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <th width='1px'>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $salaires; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $salaire): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo $salaire->id; ?></td>
                        <td ><?php echo $salaire->employeur_nom; ?></td>
                        <td align="center"><?php echo $salaire->annee; ?></td>
                        <?php $__currentLoopData = $t_mois; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mois=>$nummois): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $class='success';$style='';
                                $class=isset($t_salaires_ref[$salaire->annee.'-'.$nummois])?$class:'';
                                if($salaire->getIsHorsPlafond($mois)) $style="color:red;";
                                $montant_salaire=$salaire->{$mois};
                                if($salaire->getSuspendu($mois)) {
                                    $style.="background-color:darkgrey;font-size:.9em";
                                    $montant_salaire="SUSPENDU";
                                }
                            ?>
                            <td  class='<?php echo $class; ?>' align='right' style='<?php echo $style; ?>'>
                                <?php echo $montant_salaire; ?>

                            </td>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <td nowrap align='right'></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <div class='col-md-8'>
            <?php
                $t=explode('~',$beneficiaire->MoyenneMeilleursSalaires);
            ?>
            <?php echo html()->label('Le salaire moyen des '.$t[1].' meilleurs mois est de : '.number_format($t[0],0,","," ")." CFP",'best_sal'); ?>

        </div>
    </div>


</div>
<?php /**PATH C:\xampp\htdocs\SYSINFO\cpswf\sipre2\resources\views/tiers/beneficiaires/rows_salaire.blade.php ENDPATH**/ ?>