{% extends 'frontend/base.html.twig' %}
{% block title %}Annuaire des adhérents{% endblock %}
{% block body %}
<div class="card">
<div class="card-header">
<h2>Annuaire des adhérents ({{ firms.getTotalItemCount }})</h2>
</div>
<div class="card-body">
<div class="mb-4">
{{ form_start(form) }}
{{ form_row(form.search) }}
<div class="text-end">
<button type="submit" class="btn btn-primary btn-radius btn-icon">
<i class="fas fa-search"></i>
</button>
<a href="{{ path('customer_phone_book') }}" class="btn btn-outline-primary btn-radius">
Réinitialiser
</a>
</div>
{{ form_end(form) }}
</div>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Entreprise</th>
<th>Téléphone</th>
<th>Email</th>
<th>Adresse</th>
<th>Contact responsable</th>
<th>Contact responsable tél.</th>
<th>Contact responsable email</th>
</tr>
</thead>
<tbody>
{% for firm in firms %}
{% set contact = firm.contactResponsableInContacts %}
<tr>
<td>{{ firm.raisonSocial }}</td>
<td>{{ firm.tel1 }}</td>
<td>{{ firm.email }}</td>
<td>
{{ firm.adresse }}<br>
{{ firm.adresse2 ? firm.adresse2 ~ '<br>' }}
{{ firm.codePostal }}<br>
{{ firm.ville }}<br>
</td>
<td>{{ contact ? contact.fullname : '' }}</td>
<td>{{ contact ? contact.telPortable : '' }}</td>
<td>{{ contact ? contact.emailContact : '' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="navigation mt-5 float-end">
{{ knp_pagination_render(firms) }}
</div>
</div>
</div>
</div>
{% endblock %}