{if !$frameDisplay}{include file='structure/top.tpl'}{/if}

<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=="prenom" && $sens=="ASC"}"?order=prenom&sens=DESC"
                {else}"?order=prenom&sens=ASC"{/if} style="text-decoration: none;">
                {if $order=="prenom"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}prénom
            </a>
            <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-md visible-lg tel">
            <a href={if $order=="tel" && $sens=="ASC"}"?order=tel&sens=DESC"
                {else}"?order=tel&sens=ASC"{/if} style="text-decoration: none;">
                téléphone{if $order=="tel"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg email">
            <a href={if $order=="email" && $sens=="ASC"}"?order=email&sens=DESC"
                {else}"?order=email&sens=ASC"{/if} style="text-decoration: none;">
                email{if $order=="email"} <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="btnAddClient"></button></th>
    </thead>
    <tbody class="table progressLoadList" id="clientsList" start="{$list_limits.start}" end="{$list_limits.end}" rest="{$list_limits.rest}">
    {include file='clients/clients_list_builder.tpl'}
    </tbody>
</table>

{include file='clients/client_modal_view.tpl'}

<!-- MODAL ADD CLIENT -->
<div class="modal fade" id="modalAddClient" 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 style="width:50px;" class="hidden-xs" src="img/client.svg">
                    Ajouter un client
                </h2>
            </div>
            <div class="modal-body">
                <form class="formClient">
                    {include file='clients/client_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 CLIENT -->

<!-- MODAL EDIT CLIENT -->
<div class="modal fade" id="modalEditClient" 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 style="width:50px;" class="hidden-xs" src="img/client.svg">
                    Modifier un client
                </h2>
            </div>
            <div class="modal-body">
                <form class="formClient">
                    {include file='clients/client_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 CLIENT -->

<!-- MODAL DELETE CLIENT -->
<div class="modal fade" id="modalDeleteClient" 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 style="width:50px;" class="hidden-xs" src="img/client.svg">
                    Supprimer un client
                </h2>
            </div>
            <div class="modal-body">
                <p>Etes-vous sûr de vouloir supprimer le client <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 CLIENT -->

{if !$frameDisplay}{include file='structure/bottom.tpl'}{/if}