{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            Historique des paiements (page paiement)
        </div>
        <div class="table-responsive">
            <table class="table table-bordered dataTable" width="100%" cellspacing="0">
                <thead>
                <tr>
                    <th>#</th>
                    <th>Date</th>
                    <th>Référence</th>
                    <th>Payé le</th>
                    <th>Total</th>
                    <th>Nom</th>
                    <th>Prénom</th>
                    <th>Téléphone</th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th>#</th>
                    <th>Référence</th>
                    <th>Date</th>
                    <th>Payé le</th>
                    <th>Total</th>
                    <th>Nom</th>
                    <th>Prénom</th>
                    <th>Téléphone</th>
                </tr>
                </tfoot>
                <tbody>
                {% for item in items %}
                    <tr>
                        <td>{{ (items | length) - loop.index + 1 }}</td>
                        <td>{{ item.createdAt | date('d-m-Y') }}<br/>{{ item.createdAt | date('H:i:s') }}</td>
                        <td>{{ item.slug }}</td>
                        {% if item.payedAt %}
                            <td>{{ item.payedAt | date('d-m-Y') }}<br/>{{ item.payedAt| date('H:i:s') }}</td>
                        {% else %}
                            <td>-</td>
                        {% endif %}
                        <td>{{ item.amount / 100 }} € </td>
                        <td>{{ item.lastname }}</td>
                        <td>{{ item.firstname }}</td>
                        <td>{{ item.phone }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}
