<div class="row">
    <div class="col-md-12 ">
        {!! html()->label('Mode de cotisation','mode_cotis') !!}
        <div class="form-group">
            <div class="col-md-4">
                Trimestrielles :
                {!! html()->radio('mode_cotis',($mode!="create")?$employeur->mode_cotis:null,'1' )
                    ->attributes([($mode=="show"?'disabled':''),'class' => ''])  !!}
                &nbsp;&nbsp;&nbsp;
                Mensuelles :
                {!! html()->radio('mode_cotis',($mode!="create")?$employeur->mode_cotis:null,'2' )
                    ->attributes([($mode=="show"?'disabled':''),'class' => ''])  !!}
            </div>
        </div>
    </div>
</div>


@if($mode!="create")
    <div class="form-group row">
        <div class="col-md-3">
            {!! html()->label( 'Dernière cotisation','der_cotis') !!}
            <div class="input-group">
                {!! html()->text('der_cotis', null)->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']) !!}
                <div class="input-group-append"><span class="input-group-text">CFP</span></div>
            </div>
        </div>

        <div class="col-md-3">
            {!! html()->label('der_mois', 'Mois concerné') !!}
            <div class="input-group">
                <div class='input-group date' id='datepicker_der_mois'>
                        {!! html()->text('der_mois', ($mode!="create")?$employeur->der_mois:null)
                            ->attributes([($mode=="show"?'disabled':''),'placeholder' => 'Mois concerné', 'class' => 'form-control']) !!}
                    <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
                </div>
            </div>
        </div>

        <div class="col-md-3">
            {!! html()->label( 'Solde antérieur','solde') !!}
            <div class="input-group">
                {!! html()->text('soldei', null)->attributes([($mode=="show"?'disabled':''),'class' => 'form-control']) !!}
                <div class="input-group-append"><span class="input-group-text">CFP</span></div>
            </div>
        </div>
    </div>



    <div class="form-group row">
        <div class="col-md-3">
            {!! html()->label( 'Dernière MED','date_med') !!}
            <div class='input-group date' id='datepicker_date_med'>
                    {!! html()->text('date_med', ($mode!="create")?$employeur->date_med:null)
                        ->attributes([($mode=="show"?'disabled':''),'placeholder' => 'Dernière MED', 'class' => 'form-control']) !!}
                <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
            </div>
        </div>

        <div class="col-md-3">
            {!! html()->label( 'Dernière MAJ','date_maj') !!}
            <div class='input-group date' id='datepicker_date_maj'>
                    {!! html()->text('date_maj', ($mode!="create")?$employeur->date_maj:null)
                        ->attributes([($mode=="show"?'disabled':''),'placeholder' => 'Dernière MAJ', 'class' => 'form-control']) !!}
                <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
            </div>
        </div>
    </div>

    <div class="form-group row">
        <div class="col-md-6">
            {!! html()->label( 'Libellé','nom_cont') !!}
            {!! html()->text('nom_cont', null)->attributes([($mode=="show"?'disabled':''),'placeholder' => 'Libellé du contentieux', 'class' => 'form-control']) !!}
        </div>

        <div class="col-md-3">
            {!! html()->label( 'Date du contentieux','date_cont') !!}
            <div class='input-group date' id='datepicker_date_cont'>
                    {!! html()->text('date_cont', ($mode!="create")?$employeur->date_cont:null)
                        ->attributes([($mode=="show"?'disabled':''),'placeholder' => 'Dernière MAJ', 'class' => 'form-control']) !!}
                <span class='input-group-addon'><span class='glyphicon glyphicon-calendar'></span></span>
            </div>
        </div>
    </div>

    <legend>Liste des cotisations (2 dernières années)</legend>
    <div class="form-group row" align="center">
        <div class="table-responsive col-lg-12" style="">
            <table id="_table_cotisation" style="background-color:white" class="table table-condensed table-striped table-bordered" width="100%" >
                <thead>
                    <tr>
                        <th width='1%'>Exercice</th>
                        <th width='10%'>Date</th>
                        <th width='10%'>CLR</th> 
                        <th width='10%'>CCPF</th>
                        <th width='10%'>Débit</th>
                        <th width='10%'>Crédit</th>
                        <th width='10%'>Mois</th>
                        <th width='1%'>Nb&nbsp;Mois</th>
                        <th width='1%'>Bord.&nbsp;Pub</th>
                        <th width='1%'>Bord.&nbsp;Pri</th>
                        <th width='10%'>Date&nbsp;encais.</th>
                        <th width='10%'>Date&nbsp;Dépôt.</th>
                        <th width='50px'>&nbsp;</th>
                    </tr>
                </thead>
     
                <tbody>
                    @foreach ($cotisations as $cotisation)
                    <tr>
                        <td align="center">{!! $cotisation->exercice !!}</td>
                        <td align="center">{!! $cotisation->date !!}</td>
                        <td align="right">{!! $cotisation->clr !!}</td>
                        <td align="right">{!! $cotisation->ccpf !!}</td>
                        <td align="right">{!! $cotisation->debit !!}</td>
                        <td align="right">{!! $cotisation->credit !!}</td>
                        <td align="center">{!! $cotisation->mois !!}</td>
                        <td align="center">{!! $cotisation->nbmois !!}</td>
                        <td>{!! $cotisation->bdx !!}</td>
                        <td>{!! $cotisation->bdx_prive !!}</td>
                        <td align="center">{!! $cotisation->encais_date !!}</td>
                        <td align="center">{!! $cotisation->date_depot !!}</td>
                        <td nowrap>
                            @if($user->can("COT_VISU") || $user->HasRole("ADMINISTRATEUR"))
                            <a href="{!! url('recouvrement/cotisations/show_box/'.$cotisation->id) !!}" 
                                class="various fancybox.iframe btn btn-warning" 
                                style="margin-right: 3px;">Détail</a>
                            @endif 
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group row">
        <div class="col-lg-12">


            <button type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-bordereau">
              Bordereau de cotisation
            </button>

                    
            <a href="javascript:" 
            id='btn_ajout_enfant' 
            onclick="$('#dialog-percotis').dialog( 'open' );return false;" 
            class="box_versement btn btn-info" 
            >Bordereau de cotisation</a>

            <a href="{!! url('cotisations_attestation_regul/'.$employeur->id) !!}" 
            id='btn_ajout_enfant'  class="box_versement fancybox.iframe btn btn-info" 
            target="_blank">Attestation de régularité</a>

            <a href="{!! url('cotisations_attestation_pmtech/'.$employeur->id) !!}" 
            id='btn_ajout_enfant'  class="box_versement fancybox.iframe btn btn-info" 
            target="_blank">Attestation de paiement échelonné</a>

            <!--
            <a href="{!! url('cotisations_attestation/'.$employeur->id) !!}" 
            id='btn_ajout_enfant'  class="box_versement fancybox.iframe btn btn-info" 
            target="_blank">Attestation</a>
        -->

            <a href="{!! url('cotisations_attestation_simple/'.$employeur->id) !!}" 
            id='btn_ajout_enfant'  class="box_versement fancybox.iframe btn btn-info" 
            target="_blank">Attestation simple</a>

            <a href="{!! url('cotisations_attestation_cotisation/'.$employeur->id) !!}" 
            id=''  class="btn btn-info" 
            target="_blank">Attestation de Situation</a>
        </div>
    </div>
@endif