
<ul class="nav nav-tabs" id="myTab" role="tablist">
    <li class="nav-item">
        <a class="nav-link {!! ($onglet_actif=='o_general')?'active show':'' !!}" href="#o_general" data-toggle="tab">Etat civil</a></li>
    <li class="nav-item">
        <a class="nav-link {!! ($onglet_actif=='o_adresse')?'active show':'' !!}" href="#o_adresse" data-toggle="tab">Adresse</a></li>
    <li class="nav-item">
        <a class="nav-link {!! ($onglet_actif=='o_famille')?'active show':'' !!}" href="#o_famille" data-toggle="tab">Famille</a></li>
    <li class="nav-item">
        <a class="nav-link {!! ($onglet_actif=='o_banque')?'active show':'' !!}" href="#o_banque" data-toggle="tab">Employeur/Banque</a></li>
    <li class="nav-item">
        <a class="nav-link {!! ($onglet_actif=='o_allocation')?'active show':'' !!}" href="#o_allocation" data-toggle="tab">{{ $title }}</a></li>
    @if(isset($beneficiaire))

        @if( ($user->HasRole('ADMINISTRATEUR') || $user->can('ALL_VER_VISU') || $user->can('SOC_VER_VISU') || $user->can('RET_VER_VISU')) && ($mode=="show"))
            <li class="nav-item">
                <a class="nav-link {!! ($onglet_actif=='o_versement')?'active show':'' !!}" href="#o_versement" data-toggle="tab">Versements</a></li>
        @else
            <li class="nav-item">
                <a class="nav-link disabled" href="#o_versement" data-toggle="tab">Versements</a></li>
        @endif
    @endif
</ul>

<div class="tab-content p-3">
    <!-- ------------------------------------- onglet NOM ------------------------------- -->
    <div class="tab-pane fade {!! ($onglet_actif=='o_general')?'active show':'' !!}" id="o_general" role="tabpanel" aria-labelledby="o_general-tab">
        @include("tiers.beneficiaires.rows_general")
    </div>
    <!-- ------------------------------------- onglet Adresse ------------------------------- -->
    <div class="tab-pane fade {!! ($onglet_actif=='o_adresse')?'active show':'' !!}" id="o_adresse" role="tabpanel" aria-labelledby="o_adresse-tab">
        @include("tiers.beneficiaires.rows_adresse")
    </div>
    <!-- ------------------------------------- onglet Conjoint-Famille ------------------------------- -->
    <div class="tab-pane fade {!! ($onglet_actif=='o_famille')?'active show':'' !!}" id="o_famille" role="tabpanel" aria-labelledby="o_famille-tab">
        @include("tiers.beneficiaires.rows_famille")
    </div>
    <!-- ------------------------------------- onglet Employeur/Banque ------------------------------- -->
    <div class="tab-pane fade {!! ($onglet_actif=='o_banque')?'active show':'' !!}" id="o_banque" role="tabpanel" aria-labelledby="o_banque-tab">
        @include("tiers.beneficiaires.rows_banque")
    </div>
    <!-- ------------------------------------- onglet AIdes pan/ ------------------------------- -->
    <div class="tab-pane fade {!! ($onglet_actif=='o_allocation')?'active show':'' !!}" id="o_allocation" role="tabpanel" aria-labelledby="o_allocation-tab">
        @include("tiers.beneficiaires.rows_".strtolower($type))
    </div>

    @if(isset($beneficiaire))
        @if( ($user->HasRole('ADMINISTRATEUR')|| $user->can('')) && ($mode=="show"))
            <!-- ------------------------------------- onglet Versements ------------------------------- -->
            <div class="tab-pane fade {!! ($onglet_actif=='o_versement')?'active show':'' !!}" id="o_versement" role="tabpanel" aria-labelledby="o_versement-tab">
                @include("tiers.beneficiaires.rows_versement")
            </div>
        @endif
    @endif
</div>


<div class='form-group'>
    @if($mode=="show")
        @if($user->hasRole("ADMINISTRATEUR") || $user->can("BEN_MAJ"))
            <a class="btn btn-primary" href="#" id="btn_modifier">Modifier</a>
        @endif
    @else
        {!! html()->button('Enregistrer')->value('Enregistrer')->type('submit')->attributes(['class' => 'btn btn-primary']) !!}
    @endif
    <a class="btn btn-warning"  href="{!! url('beneficiaires/'.$type) !!}">Retour</a>
</div>






