<div class="table-responsive">
<table class="align-middle mb-0 table table-bordered">
<thead>
<tr style="background-color: #ddd;">
<th>Catégorie</th>
<th>Libellé</th>
<th>Date Début</th>
<th>Date Fin</th>
<th>Caisse</th>
<th width="10%">Action</th>
</tr>
</thead>
<tbody>
<tr>
<form
action="#"
hx-post="{{ path('accounting_expense_searh_table')}}"
hx-trigger="load, submit delay:500ms"
hx-target="#search-results"
hx-indicator="#htmx-indicator-results">
<td>
<select class="form-control select" name="accounting_expense_category" id="accounting_expense_category" style="width: 100%">
<option value="0">Toutes les catégories</option>
{% for category in accounting_expense_categories %}
<option value="{{ category.id }}" {% if category == accountingExpenseCategory %} selected="selected" {% endif %}>{{ category.name }}</option>
{% endfor %}
</select>
</td>
<td><input type="text" class="form-control" name="label" id="label" value="{{ label }}" placeholder="Rechercher par libellé..." style="border-bottom: 4px solid #ddd;" /></td>
<td><input type="date" class="form-control" name="startDate" id="startDate" value="{{ 'now'|date('Y-01-01') }}" style="border-bottom: 4px solid #ddd;" /></td>
<td><input type="date" class="form-control" name="endDate" id="endDate" value="{{ endDate|date('Y-m-d') }}" style="border-bottom: 4px solid #ddd;" /></td>
<td>
<select class="form-control select" name="checkout" id="checkout" style="width: 100%">
<option value="0">Toutes les caisses</option>
{% for _checkout in checkouts %}
<option value="{{ _checkout.id }}" {% if _checkout == checkout %} selected="selected" {% endif %}>{{ _checkout.label }} - [{{ (_checkout.cashedIn - (_checkout.spent + _checkout.paid))|number_format(0, ',', ' ') }}]</option>
{% endfor %}
</select>
</td>
<td class="text-center">
<button class="btn btn-primary"type="submit">
<i class="fa fa-search"></i>
</button>
</td>
</form>
</tr>
</tbody>
</table>
<br>
<span class="htmx-indicator text-danger" id="htmx-indicator-results">
<img src="{{ asset('spinner-3.gif') }}" width="20" />
Recherche en cour...
</span>
<table class="display table table-striped table-bordered">
<thead>
<tr>
<th class="text-center" width="5%">
<input type="checkbox" id="check-all" onclick="javascript:checkAllElt()">
</th>
<th width="5%">#</th>
<th width="20%">Libellé</th>
<th>Description</th>
<th width="10%" class="text-center">Montant</th>
<th width="10%" class="text-center">Etat</th>
<th width="10%">Date</th>
<th width="10%">Approuvé le</th>
<th width="10%">Payé le</th>
<th>Caisse</th>
<th>Catégorie</th>
<th>Créé par</th>
<th class="text-center" width="10%">Actions</th>
</tr>
</thead>
<tbody id="search-results"></tbody>
</table>
</div>
<br>
{# <nav aria-label="Page navigation example">
{{ knp_pagination_render(accounting_expenses) }}
</nav> #}