@include('forms.fbncheader')
@include('forms.fdatatables')


<div class='col-lg-10 col-lg-offset-1'>

    <h2></i>{!! $titre !!}</h2>

    <div class='col-xs-8 col-md-offset-1'>
        <h3>Nombre de bénéficiaires</h3>

<div class="row" style="margin-bottom:40px">   
            <div class="col-xs-3">
                {!! Form::label('annes', 'Année :' ) !!}
                {!! Form::select('exercice',$exercices,$exercice,
                    [
                        'id' => 'exercice_id','class' => 'form-control selectpicker',
                        'data-width' => "100%",'style' => 'font-weight:bold;'
                    ]
                ) 
                !!}
                <script>
                    $(document).ready(function() {
                        $('#exercice_id').on('change', function() {
                            location.href="{!! url('/stats/tdb_nbenfant/A/') !!}/"
                                +$('#exercice_id').val()+"/"+$('#mois_id').val();
                        });
                    });
                </script>
            </div>
            <div class="col-xs-2">
                {!! Form::label('mois', 'Mois :' ) !!}
                {!! Form::select('mois',$moiss,$mois,
                    [
                        'id' => 'mois_id','class' => 'form-control selectpicker',
                        'data-width' => "100%",'style' => 'font-weight:bold;'
                    ]
                ) 
                !!}
                <script>
                    $(document).ready(function() {
                        $('#mois_id').on('change', function() {
                            location.href="{!! url('/stats/tdb_nbenfant/A/') !!}/"
                                +$('#exercice_id').val()+"/"+$('#mois_id').val();
                        });
                    });
                </script>
            </div>
    </div>

        <div class="table-responsive">
            <table id="_table" class="table table-condensed">
                <tbody>
                    <th></th>
                    @foreach($t_header as $ref=>$libelle)
                    <th>{!! $libelle !!}</th>
                    @endforeach

                    @foreach($zones as $zone)
                    <tr  class='{!! $t_table[$zone]["classe"] !!}'  style='{!! $t_table[$zone]["style"] !!}'>
                        <td>{!! $t_table[$zone]['nom'] !!}</td>
                        <?php foreach($t_header as $ref=>$libelle) { ?>
                            <td class='{!! $t_table[$zone]["classe_".$ref] !!}'  style='{!! $t_table[$zone]["style_".$ref] !!}'>
                                {!!
                                Form::text($t_table[$zone]['nom'].'_'.$ref, $t_table[$zone]["value_".$ref], 
                                    ['placeholder' => '', 'class' => 'form-control', 'readonly'])
                                !!}
                            </td>
                        <?php } ?>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>






</div>
