{include file='structure/top.tpl'}

<table class="table table-hover scrollingTableList">
    <thead>
        <th class="center visible-lg id">
            <a href={if $order=="ref" && $sens=="ASC"}"?order=ref&sens=DESC"
                {else}"?order=ref&sens=ASC"{/if} style="text-decoration: none;">
                #{if $order=="ref"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="name">
            <a href={if $order=="nom" && $sens=="ASC"}"?order=nom&sens=DESC"
                {else}"?order=nom&sens=ASC"{/if} style="text-decoration: none;">
                nom{if $order=="nom"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-lg groupe">
            <a href={if $order=="groupe" && $sens=="ASC"}"?order=groupe&sens=DESC"
                {else}"?order=groupe&sens=ASC"{/if} style="text-decoration: none;">
                groupe{if $order=="groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg center freq">
            <a href={if $order=="frequence" && $sens=="ASC"}"?order=frequence&sens=DESC"
                {else}"?order=frequence&sens=ASC"{/if} style="text-decoration: none;">
                fréquence{if $order=="frequence"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg center panier_type">
            <a href={if $order=="panier_type" && $sens=="ASC"}"?order=panier_type&sens=DESC"
                {else}"?order=panier_type&sens=ASC"{/if} style="text-decoration: none;">
                type de panier{if $order=="panier_type"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg center items_long">
            <a href={if $order=="nb_paniers" && $sens=="ASC"}"?order=nb_paniers&sens=DESC"
                {else}"?order=nb_paniers&sens=ASC"{/if} style="text-decoration: none;">
                nb. de panier{if $order=="nb_paniers"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg center items_long">
            <a href={if $order=="prix_total" && $sens=="ASC"}"?order=prix_total&sens=DESC"
                {else}"?order=prix_total&sens=ASC"{/if} style="text-decoration: none;">
                prix total{if $order=="prix_total"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="btn_action right" colspan="2"><button class="btn btn-xs btn-info glyphicon glyphicon-plus" id="btnAddContratsType"></button></th>
    </thead>
    <tbody class="table progressLoadList" id="contratsTypesList" start="{$list_limits.start}" end="{$list_limits.end}" rest="{$list_limits.rest}">
    {include file='contrats_types/contrats_types_list_builder.tpl'}
    </tbody>
</table>

{include file='contrats_types/contrats_type_modal_view.tpl'}

<!-- MODAL ADD CONTRAT TYPES -->
<div class="modal fade" id="modalAddContratsType" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <div class="pull-right hidden-xs">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
                <h2 class="modal-title">
                    <img src="img/contrat.svg">
                    Ajouter un type de contrat
                </h2>
            </div>
            <div class="modal-body">
                <form class="formContratsType">
                    {include file='contrats_types/contrats_type_form.tpl'}
                </form>
            </div>
            <div class="modal-footer visible-xs">
                <div class="pull-right">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL ADD CONTRATS TYPE -->

<!-- MODAL EDIT CONTRATS TYPE -->
<div class="modal fade" id="modalEditContratsType" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <div class="pull-right hidden-xs">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
                <h2 class="modal-title">
                    <img src="img/contrat.svg">
                    Modifier un type de contrat
                </h2>
            </div>
            <div class="modal-body">
                <form class="formContratsType">
                    {include file='contrats_types/contrats_type_form.tpl'}
                </form>
            </div>
            <div class="modal-footer visible-xs">
                <div class="pull-right">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL EDIT CONTRATS TYPE -->

<!-- MODAL DELETE CONTRATS TYPE -->
<div class="modal fade" id="modalDeleteContratsType" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">
                    <img src="img/contrat.svg">
                    Supprimer un type de contrat
                </h2>
            </div>
            <div class="modal-body">
                <p>Etes-vous sûr de vouloir supprimer le type de contrat <b class="name">NAME</b> ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                <button type="button" class="btn btn-danger btnSave">Confirmer</button>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL DELETE CONTRATS TYPE -->

{include file='structure/bottom.tpl'}