<table class="manage-items">
    <thead>
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Email</th>
        <th>Phone Number</th>
        <th>Age</th>
        {% if can('LOGIN_AS_PATIENT') %}
            <th class="center">Login as</th>
        {% endif %}
        <th class="center">View</th>
    </tr>
    </thead>

    <tbody class="tabular">
    {% for patient in patients %}
        <tr id="rorder-{{ patient.id }}">
            <td>
                <a href="{{ route('admin-patients-profile', { id: patient.id }) }}">{{ patient.id }}</a>
            </td>
            <td>
                <a href="{{ route('admin-patients-profile', { id: patient.id }) }}">
                    {{ patient.addressBilling.firstname }} {{ patient.addressBilling.lastname }}
                </a>
            </td>
            <td>{{ patient.email }}</td>
            <td>{{ patient.contact_no }}</td>
            <td>{{ patient.age }}</td>

            {% if can('LOGIN_AS_PATIENT') %}
                <td>
                    <a href="{{ route('admin-login-as-member', { id: patient.id }) }}" target="_blank">
                        Login <i class="fa fa-sign-in" aria-hidden="true"></i>
                    </a>
                </td>
            {% endif %}

            <td class="center">
                <a href="{{ route('admin-patients-profile', { id: patient.id }) }}" class="edit">
                    <i class="fa fa-eye"></i>
                </a>
            </td>
        </tr>
    {% else %}
        <tr><td colspan="7">There were no patients found matching your search criteria</td></tr>
    {% endfor %}
    </tbody>
</table>
