<?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 echo Html::style('css/bootstrap-select.min.css'); ?>

<?php echo Html::style('css/datepicker3.css'); ?>



<?php echo Html::script('js/bootstrap-datepicker.js'); ?> 
<?php echo Html::script('js/bootstrap-select.js'); ?>




<?php echo $maj=( ($user->can("PAR_MAJ")) || $user->HasRole("ADMINISTRATEUR"))?true:false; ?>


<div class="col-lg-10 col-lg-offset-1">
    <h1><i class="fa fa-epreuves"></i>Saisie des Paramètres</h1>
</div>



<div class="col-lg-12 col-lg-offset-1">
<?php echo Form::model($parametres, ['parametre' => 'form', 'class' => 'form-horizontal'
    , 'url' => 'param/parametres/0', 'method' => 'PUT']); ?>


    <ul class="nav nav-tabs">
        <li class="active"><a href="#messages" data-toggle="tab">Messages</a></li>
        <li><a href="#paramcalcul" data-toggle="tab">Taux CLR/CCPF</a></li>
        <li><a href="#editions" data-toggle="tab">Editions</a></li> 
        <li><a href="#recouvrement" data-toggle="tab">Recouvrement</a></li>
        <li><a href="#compta" data-toggle="tab">Comptabilité</a></li>
        <li><a href="#email" data-toggle="tab">Emails</a></li> 
        <li><a href="#divers" data-toggle="tab">Divers</a></li> 
    </ul>
    <script>
        $('#myTab a').click(function (e) {
        e.preventDefault();
        $(this).tab('show');
        })

        $('a[data-toggle="tab"]').on('shown', function (e) {
        e.target // activated tab
        e.relatedTarget // previous tab
        })
    </script>


<div class="tab-content">


<!-- ------------------------------------- ONGLET Messages ------------------------------- -->
    <div class="tab-pane active" id="messages">
        <div class="form-group">
            <div class="col-lg-10">
            <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if(substr($parametre->ref2,0,3)=='MSG'): ?>

                    <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    <?php if($maj): ?>
                        <?php echo Form::textarea($parametre->ref2, $parametre->value, 
                            ['placeholder' => 'Texte', 'class' => 'form-control'
                            ,'rows' => '7'
                            ]); ?>

                    <?php else: ?>
                        <?php echo Form::textarea($parametre->ref2, $parametre->value, 
                            ['readonly', 'class' => 'form-control','rows' => '7']); ?>

                    <?php endif; ?>

                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>
<!-- FIN Onglet 1 -->

<!-- ------------------------------------- ONGLET Calculs et taxes ------------------------------- -->
    <div class="tab-pane" id="paramcalcul">
            <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

               <?php if( (substr($parametre->ref2,0,3)=='CAL') ): ?>
                <div class="form-group">
                    <div class="col-md-4">
                    <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    <?php if($maj): ?>
                        <?php echo Form::text($parametre->ref2, $parametre->value, 
                        ['placeholder' => 'Texte', 'class' => 'form-control'
                        
                        ]); ?>

                    <?php else: ?>
                        <?php echo Form::text($parametre->ref2, $parametre->value, 
                        ['readonly', 'class' => 'form-control']); ?>

                    <?php endif; ?>
                    </div>
                </div>
                <?php endif; ?>

                <?php if( (substr($parametre->ref2,0,4)=='TAUX') ): ?>
                    <div class="form-group">
                        <div class="table-responsive col-md-6">
                            <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                            <table id="_table" class="table table-condensed table-striped table-bordered" width="100px">
                                <thead>
                                    <tr>
                                        <th width='30px'>Exercice</th>
                                        <th width='40px'>%CLR</th>
                                        <th width='40px'>%CCPF</th>
                                        <th width='40px'>%Total</th> 
                                    </tr>
                                </thead>
                     
                                <tbody>
                                    <?php 
                                    if($parametre->value) $t_taux=explode("\r\n",$parametre->value); 
                                    rsort($t_taux);
                                    $max_annee=(intval(substr($t_taux[0],0,4))+1);
                                    $t_taux[]=$max_annee.";;";
                                    rsort($t_taux);
                                    
                                    foreach($t_taux as $taux) {
                                        $taux_values=explode(";",$taux);
                                        $annee=$taux_values[0];
                                        $taux_clr=$taux_values[1];
                                        $taux_ccpf=$taux_values[2];
                                        if($taux_clr=="") $taux_clr=0; 
                                        if($taux_ccpf=="") $taux_ccpf=0;
                                    ?>

                                        <tr>
                                            <td style="color:grey"><?php echo $annee; ?></td>
                                            <td align="center">
                                                <?php if($maj): ?>
                                                <?php echo Form::text($parametre->ref2."_clr_".$annee, 
                                                    $taux_clr, ['placeholder' => '%CLR', 'class' => 'form-control']); ?>

                                                <?php else: ?>
                                                <?php echo Form::text($parametre->ref2."_clr_".$annee, 
                                                    $taux_clr, ['readonly', 'class' => 'form-control']); ?>

                                                <?php endif; ?>
                                            </td>
                                            <td align="center">
                                                <?php if($maj): ?>
                                                <?php echo Form::text($parametre->ref2."_ccpf_".$annee, 
                                                    $taux_ccpf, ['placeholder' => '%CCPF', 'class' => 'form-control']); ?>

                                                <?php else: ?>
                                                <?php echo Form::text($parametre->ref2."_ccpf_".$annee, 
                                                    $taux_ccpf, ['readonly', 'class' => 'form-control']); ?>

                                                <?php endif; ?>
                                            </td>
                                            <td align="center"><?php echo $taux_clr+$taux_ccpf; ?> %</td>
                                        </tr>
                                    <?php } ?>


                                </tbody>
                            </table>
                        </div>
                    </div>
                <?php endif; ?>
                
               <?php if( (substr($parametre->ref2,0,3)=='LST') ): ?>
                <div class="form-group">
                    <div class="col-md-4">
                    <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    <?php if($maj): ?>
                        <?php echo Form::textarea($parametre->ref2, $parametre->value, ['placeholder' => 'Texte', 'class' => 'form-control','rows'=>'10']); ?>

                    <?php else: ?>
                        <?php echo Form::textarea($parametre->ref2, $parametre->value, ['readonly', 'class' => 'form-control','rows'=>'10']); ?>

                    <?php endif; ?>
                    </div>
                </div>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
<!-- FIN Onglet 2 -->


<!-- ------------------------------------- ONGLET Editions ------------------------------- -->
<div class="tab-pane" id="editions">
        <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if(substr($parametre->ref2,0,3)=='EDI'): ?>
                <div class="form-group">
                    <a href="#txt_<?php echo $parametre->ref2; ?>" data-toggle="collapse">
                    <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    </a>
                    <div id="txt_<?php echo $parametre->ref2; ?>" class="form-control  collapse">
                        <?php if($parametre->type=='T'): ?>
                        
                            <?php if($maj): ?>
                            <?php echo Form::textarea($parametre->ref2, $parametre->value, 
                                ['placeholder' => 'Texte', 
                                    'class' => 'form-control',
                                    'rows' => '4']); ?>

                            <?php else: ?>
                            <?php echo Form::textarea($parametre->ref2, $parametre->value, 
                                ['readonly', 
                                    'class' => 'form-control',
                                    'rows' => '4']); ?>

                            <?php endif; ?>
                        
                        <?php else: ?>
                            <?php echo Form::text($parametre->ref2, $parametre->value, 
                                ['placeholder' => 'Valeur', 'class' => 'form-control']); ?>

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

<!-- FIN Onglet 3 -->


<!-- ------------------------------------- ONGLET Recouvrement ------------------------------- -->
    <div class="tab-pane" id="recouvrement">
            <br/>
            <div class="form-group">
            <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if(substr($parametre->ref2,0,3)=='REC'): ?>
                <div class="form-group">
                    <div class="col-md-3">
                        <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    </div>
                </div>

                <div class="form-group">
                    <div class="col-md-2">
                        <?php echo Form::text($parametre->ref2, $parametre->value, 
                        ['placeholder' => 'Texte', 'class' => 'form-control']); ?>

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

    </div>


<!-- ------------------------------------- ONGLET Compta ------------------------------- -->
    <div class="tab-pane" id="compta">  
        <div class='row form-group'>  
            <div class="col-xs-2">    
                <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(substr($parametre->ref2,0,3)=='CPT'): ?>
                        <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                        <?php echo Form::text($parametre->ref2, $parametre->value, 
                        ['placeholder' => 'Texte', 'class' => 'form-control']); ?>

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

<!-- ------------------------------------- Emails ------------------------------- -->
    <div class="tab-pane" id="email">
        <div class="form-group">
            <div class="col-lg-10"> 
            <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if(substr($parametre->ref2,0,3)=='MAI'): ?>
                    <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                    <?php if($parametre->type=='T'): ?>
                        <?php echo Form::textarea($parametre->ref2, $parametre->value, 
                            ['placeholder' => 'Texte', 
                                'class' => 'form-control',
                                'rows' => '4']); ?>

                    <?php else: ?>
                        <?php echo Form::text($parametre->ref2, $parametre->value, 
                            ['placeholder' => 'Valeur', 'class' => 'form-control']); ?>

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

<!-- ------------------------------------- ONGLET Divers ------------------------------- -->
    <div class="tab-pane" id="divers">
        <div class="form-group">
            <div class="col-lg-10"> 
            <?php $__currentLoopData = $parametres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parametre): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if(substr($parametre->ref2,0,3)=='DIV'): ?>

                <?php echo Form::label($parametre->ref2, $parametre->info,['style'=>'padding-top:20px']); ?>

                <?php echo Form::text($parametre->ref2, $parametre->value, 
                    ['placeholder' => 'Texte', 'class' => 'form-control']); ?>


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


<!-- FIN Onglet 1 -->

</div>

<?php if( ($user->can("PAR_MAJ")) || $user->HasRole("ADMINISTRATEUR")): ?> 
<div class="col-lg-max"> 
    <div class="row"> 
        <div class='form-group'>
            <?php echo Form::submit('Enregistrer', ['class' => 'btn btn-primary']); ?>

        </div>
    </div>
</div>
<?php endif; ?>


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

</div>



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

<script>
$(document).ready(function() {
    $('#_table').dataTable( {
    	"width": "10%",
        "bAutoWidth": false,
        "bPaginate": false,
        "bInfo": false,
        "bFilter": false,
        } );
    } );



} );


$(function() {
$( "#accordion" ).accordion();
});

</script><?php /**PATH C:\xampp\htdocs\CPSWF\old_sipre\sipre\resources\views/param/index.blade.php ENDPATH**/ ?>